Bug #61509 | mysqld (5.1.57) segfaults with gcc 4.6 | ||
---|---|---|---|
Submitted: | 14 Jun 2011 9:40 | Modified: | 29 Jan 2014 0:44 |
Reporter: | Ondej Sur | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Compiling | Severity: | S1 (Critical) |
Version: | 5.1.57, 5.5.17, 5.5.28 | OS: | Linux (Debian unstable) |
Assigned to: | CPU Architecture: | Any | |
Tags: | segfault |
[14 Jun 2011 9:40]
Ondej Sur
[9 Nov 2011 20:54]
Clint Byrum
This still affects 5.5.17 btw, exact same result.
[6 Dec 2011 10:00]
Bjoern Boschman
is there a way to assign this ticket also to 5.5 branch and if applicable also to 5.6 branch to raise the Severity also into more current versions. I think that this could speed up things
[6 Dec 2011 13:15]
Jonas Oreland
how about patch attached to http://bugs.mysql.com/bug.php?id=62856 ?
[19 Jan 2012 1:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".
[19 Jan 2012 3:10]
Clint Byrum
As I stated, this was seen in 5.5.17, not just 5.1, so I don't think that this is a duplicate of http://bugs.mysql.com/bug.php?id=62856
[20 Jan 2012 13:56]
Valeriy Kravchuk
Clone off date for 5.5.17 was October 19, 2011, 2 days before that other bug was reported. So, the fact that 5.5.17 is also affected proves nothing. Had you tried the patch, or recent 5.5.20 version (it should NOT be affected)?
[21 Feb 2012 1:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".
[25 Aug 2012 8:24]
Laurynas Biveinis
The problem here does not seem to be the stack direction issue (although it might pile up additional issues on the top), but rather the IMHO broken inline assemly in taocrypt arc4.cpp: (only interesting parts) __attribute__ ((noinline)) void ARC4::AsmProcess(byte* out, const byte* in, word32 length) { AS2( mov [esp], ebp ) // length } This assumes a certain calling convention and does not expose it to the compiler (attribute((noinline)) might be a poor attempt at that). The compiler cannot even tell if the args are used there. The proper way to write this function is to use the GCC extended asm syntax to pass the args the to the inline asm. I'm testing a workaround of adding -fno-omit-frame-pointer to taocrypt/src/Makefile.am, this might buy some time before the next compiler version breaks things again.
[27 Aug 2012 10:23]
Laurynas Biveinis
We see this on 5.1 only. Before, 30 SSL test crashes: http://jenkins.percona.com/job/percona-server-5.1-trunk/619/BUILD_TYPE=debug,Host=ubuntu-o... http://jenkins.percona.com/job/percona-server-5.1-trunk/619/BUILD_TYPE=debug,Host=ubuntu-o... After, no SSL test crashes: http://jenkins.percona.com/job/percona-server-5.1-param/395/BUILD_TYPE=debug,Host=ubuntu-o... http://jenkins.percona.com/job/percona-server-5.1-param/395/BUILD_TYPE=debug,Host=ubuntu-o... The workaround: === modified file 'Percona-Server/extra/yassl/taocrypt/src/Makefile.am' --- Percona-Server/extra/yassl/taocrypt/src/Makefile.am 2012-02-13 11:40:12 +0000 +++ Percona-Server/extra/yassl/taocrypt/src/Makefile.am 2012-08-27 05:43:12 +0000 @@ -24,7 +24,7 @@ tftables.cpp twofish.cpp crypto.cpp rabbit.cpp hc128.cpp libtaocrypt_la_CXXFLAGS = @yassl_taocrypt_extra_cxxflags@ -DYASSL_PURE_C \ - @yassl_thread_cxxflags@ + @yassl_thread_cxxflags@ -fno-omit-frame-pointer EXTRA_DIST = $(wildcard ../include/*.hpp)
[29 Jan 2014 0:44]
Paul DuBois
Noted in 5.5.7 changelog. mysqld segfaulted if compiled with gcc 4.6.
[27 Mar 2014 14:22]
Laurynas Biveinis
Per my comment on 25 Aug 2012 8:24, the inline asm in taocrypt was broken as the input and output variables were not marked as such, thus the compiler was free to miscompile. This has been fixed with (didn't check whether fully or partially) with 5.5$ bzr log -r 4594 -n0 ------------------------------------------------------------ revno: 4594 committer: Anirudh Mangipudi <anirudh.mangipudi@oracle.com> branch nick: mysql-5.5 timestamp: Thu 2014-02-06 11:16:55 +0530 message: Bug#14211271 ISSUES WITH SSL ON DEBIAN WHEEZY I386 AND KFREEBSD-I386 Problem: It was reported that on Debian and KFreeBSD platforms, i386 architecture machines certain SSL tests are failing. main.ssl_connect rpl.rpl_heartbeat_ssl rpl.rpl_ssl1 rpl.rpl_ssl main.ssl_cipher, main.func_encrypt were the tests that were reportedly failing (crashing). The reason for the crashes are said to be due to the assembly code of yaSSL. Solution: There was initially a workaround suggested i.e., to enable -DTAOCRYPT_DISABLE_X86ASM flag which would prevent the crash, but at an expense of 4X reduction of speed. Since this was unacceptable, the fix was the functions using assembly, now input variables from the function call using extended inline assembly on GCC instead of relying on direct assembly code.