Bug #85076 | handle_fatal_signal calls unsafe function pthread_getspecific - it can crash | ||
---|---|---|---|
Submitted: | 20 Feb 2017 7:14 | ||
Reporter: | Shane Bester (Platinum Quality Contributor) | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: Errors | Severity: | S3 (Non-critical) |
Version: | 5.6 | OS: | Linux (x64) |
Assigned to: | CPU Architecture: | Any |
[20 Feb 2017 7:14]
Shane Bester
[20 Feb 2017 7:14]
MySQL Verification Team
fwiw, backtrace() shouldn't be called either as it's not signal-safe, but I think we need to use this for ease of use to study log files.
[20 Feb 2017 7:16]
MySQL Verification Team
http://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html
[20 Feb 2017 7:21]
MySQL Verification Team
here is an example of backtrace() crashing in the signal handler: (gdb) bt #0 in ?? () from /lib64/libgcc_s.so.1 #1 in _Unwind_Backtrace () from /lib64/libgcc_s.so.1 #2 in __GI___backtrace (array=<optimized out>, size=128) at ../sysdeps/x86_64/backtrace.c:109 #3 in my_print_stacktrace (stack_bottom=0x7f8df8a06e48 "", thread_stack=262144) at ./mysys/stacktrace.c:224 #4 in handle_fatal_signal (sig=11) at ./sql/signal_handler.cc:162 #5 <signal handler called> #6 0x000000000166312c in ?? () #7 0x6574616765726700 in ?? () #8 0x0000000000002b21 in ?? () #9 0x2e20363100200064 in ?? () #10 0x0000000000000000 in ?? ()