Skip to content

Commit 77306a4

Browse files
lkshminarayananPiotr Obrzut
authored andcommitted
Bug#30031130: MYSQL SERVER SEGFAULTS AT
STD::CONDITION_VARIABLE::WAIT_FOR IN SOLARIS/X86 When a MySQL Server built with ndbcluster engine is run in a Solaris/x86 platform, it crashes everytime when NDB_SCHEMA_OBJECT::client_wait_completed() method is called. The segfault happens when this method calls the std::condition_variable::wait_for() method. This particular crash happens only in the release builds. The reason seems to be an issue with the compiler used in Solaris. When the optimization level -xO2 is used, it fills the wait_for() call with a bogus code that triggers this segfault during runtime. Fixed the issue by making the release builds use optimization level -xO1 for ndbcluster instead. Change-Id: I8471970169cd971958ac2f5aa6dcb0ccd8d083a3
1 parent 4869291 commit 77306a4

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

cmake/os/SunOS.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved.
22
#
33
# This program is free software; you can redistribute it and/or modify
44
# it under the terms of the GNU General Public License, version 2.0,
@@ -28,6 +28,8 @@ INCLUDE(CheckCXXSourceCompiles)
2828
SET(SOLARIS 1)
2929
IF(CMAKE_SYSTEM_PROCESSOR MATCHES "sparc")
3030
SET(SOLARIS_SPARC 1)
31+
ELSE()
32+
SET(SOLARIS_INTEL 1)
3133
ENDIF()
3234

3335
IF (NOT "${CMAKE_C_FLAGS}${CMAKE_CXX_FLAGS}" MATCHES "-m32|-m64")

storage/ndb/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,15 @@ SET(NDBCLUSTER_SOURCES
9393
# Include directories used when building ha_ndbcluster
9494
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/storage/ndb/include)
9595

96+
IF(SOLARIS_INTEL)
97+
# Sun Studio 12.6 on x86 machines creates a bogus code
98+
# when -xO2 is used and crashes the executable whenever
99+
# it calls std::condition_variable::wait_for()
100+
STRING_APPEND(CMAKE_CXX_FLAGS_RELWITHDEBINFO " -xO1")
101+
STRING_APPEND(CMAKE_CXX_FLAGS_RELEASE " -xO1")
102+
STRING_APPEND(CMAKE_CXX_FLAGS_MINSIZEREL " -xO1")
103+
ENDIF()
104+
96105
IF(NOT WITHOUT_SERVER)
97106
MYSQL_ADD_PLUGIN(ndbcluster ${NDBCLUSTER_SOURCES} STORAGE_ENGINE
98107
DEFAULT STATIC_ONLY

0 commit comments

Comments
 (0)