MDEV-18417/MDEV-18656/MDEV-18417: Work around compiler ASAN bug
In a Ubuntu Xenial build environment, the compiler identified as g++-5.real (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609 seems to be emitting incorrect code for the compilation unit trx0rec.cc, triggering a bogus-looking AddressSanitizer report of an invalid read of something in the function trx_undo_rec_get_pars(). This is potentially affecting any larger tests where the InnoDB purge subsystem is being exercised. When the optimization level of trx0rec.cc is limited to -O1, no bogus failure is being reported. With -O2 or -O3, a lot of things seemed to be inlined in the function, and the disassembly of the generated code did not make sense to me.
This commit is contained in:
parent
1933cf98e8
commit
828cc2ba7c
@ -1,4 +1,5 @@
|
||||
# Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2019, MariaDB Corporation.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -74,6 +75,12 @@ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DUNIV_DEBUG -DUNIV_SYNC_DEB
|
||||
CHECK_FUNCTION_EXISTS(sched_getcpu HAVE_SCHED_GETCPU)
|
||||
|
||||
IF(NOT MSVC)
|
||||
# Work around MDEV-18417, MDEV-18656, MDEV-18417
|
||||
IF(WITH_ASAN AND CMAKE_COMPILER_IS_GNUCC AND
|
||||
CMAKE_C_COMPILER_VERSION VERSION_LESS "6.0.0")
|
||||
SET_SOURCE_FILES_PROPERTIES(trx/trx0rec.cc PROPERTIES COMPILE_FLAGS -O1)
|
||||
ENDIF()
|
||||
|
||||
# either define HAVE_IB_GCC_ATOMIC_BUILTINS or not
|
||||
# workaround for old gcc on x86, gcc atomic ops only work under -march=i686
|
||||
IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "i686" AND CMAKE_COMPILER_IS_GNUCC AND
|
||||
|
Loading…
x
Reference in New Issue
Block a user