Skip to content
Snippets Groups Projects
Commit d92c7b9c authored by Otto Kekäläinen's avatar Otto Kekäläinen
Browse files

Fix mysqld crash on s390x that stemmed from WolfSSL

The mysqld binary was crashing on s390x with the following stack trace:
 stack_bottom = 0x0 thread_stack 0x49000
 /<<PKGBUILDDIR>>/builddir/sql/mysqld(my_print_stacktrace+0x2a)[0x12afc293a]
 mysys/stacktrace.c:270(my_print_stacktrace)[0x12a9c7ca4]
 [0x3ffed0f3f0e]
 sql/signal_handler.cc:209(handle_fatal_signal)[0x12af9dfce]
 src/tfm.c:3642(fp_copy)[0x12af9fa8c]
 src/tfm.c:1601(_fp_exptmod)[0x12afa044e]
 src/tfm.c:2277(fp_exptmod)[0x12afa0aa0]
 src/tfm.c:4021(fp_prime_miller_rabin_ex)[0x12afa10f6]
 src/tfm.c:4283(mp_prime_is_prime_ex)[0x12af8393a]
 src/dh.c:2108(_DhSetKey)[0x12af844b6]
 src/dh.c:2154(wc_DhSetCheckKey)[0x12af2dade]
 src/ssl.c:1744(wolfSSL_CTX_SetTmpDH)[0x12af5083e]
 src/ssl.c:38473(wolfSSL_CTX_set_tmp_dh)[0x12b025eba]
 vio/viosslfactories.c:340(new_VioSSLFd)[0x12b0260cc]
 vio/viosslfactories.c:413(new_VioSSLAcceptorFd)[0x12a6cab58]
 /lib/s390x-linux-gnu/libc.so.6(__libc_start_main+0x10a)[0x3ff88f2a90a]
 /<<PKGBUILDDIR>>/builddir/sql/mysqld(+0x5bcae4)[0x12a6bcae4]
 [0x0]

From analysis by Marko Mäkelä: The pointer that _fp_exptmod() is passing
as the first parameter of fp_copy() is bad on this architecture for some
reason. It seems to me that adding -DWC_NO_CACHE_RESISTANT to the
CMAKE_C_FLAGS on this architecture could address the problem.
parent 42e4fbeb
No related branches found
No related tags found
No related merge requests found
......@@ -54,6 +54,14 @@ ifneq ($(DEB_HOST_ARCH),amd64)
CMAKEFLAGS += -DWITHOUT_TOKUDB=true
endif
# Add extra flag to avoid WolfSSL code crashing the entire mysqld on s390x. This
# can be removed once upstream has made the code s390x compatible, see
# https://jira.mariadb.org/browse/MDEV-21705 and
# https://github.com/wolfSSL/wolfssl/issues/2828
ifeq ($(DEB_HOST_ARCH),s390x)
CFLAGS += -DWC_NO_CACHE_RESISTANT
endif
# Add support for verbose builds
MAKEFLAGS += VERBOSE=1
......@@ -101,7 +109,7 @@ endif
-DINSTALL_PLUGINDIR=lib/$(DEB_HOST_MULTIARCH)/mariadb19/plugin \
-DINSTALL_MYSQLTESTDIR=share/mysql/mysql-test \
-DPLUGIN_AUTH_SOCKET=STATIC \
-DWITH_SSL=bundled \
-DWITH_SSL=bundled \
-DPLUGIN_AWS_KEY_MANAGEMENT=NO \
-DWITH_INNODB_SNAPPY=ON \
-DDEB=$(DEB_VENDOR) ..'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment