Bug #81908 Add demanging of stacktraces for OS X
Submitted: 17 Jun 2016 12:39 Modified: 20 Jun 2016 16:58
Reporter: Jon Olav Hauglid Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:8.0.0 OS:Any
Assigned to: CPU Architecture:Any

[17 Jun 2016 12:39] Jon Olav Hauglid
Description:
The signal handler that prints out stacktrace after MySQL crashes tries to demangle the stacktrace
using the __cxa__demangle() call. However this is only done when the server was built with GCC
even if Clang (used by OS X) also supports it.

This means that we on OS X currently get e.g.:
0   mysqld                              0x0000000108305848 my_print_stacktrace + 72
1   mysqld                              0x00000001081ddcde handle_fatal_signal + 910
2   libsystem_platform.dylib            0x00007fff8df7652a _sigtramp + 26
3   mysqld                              0x00000001097b8acd _ZL6nochar + 239437
4   libsystem_c.dylib                   0x00007fff8ac5a6e7 abort + 129
5   mysqld                              0x00000001087f7774 _Z23ut_dbg_assertion_failedPKcS0_m + 228
6   mysqld                              0x000000010874e389 _ZL23row_upd_sec_index_entryP10upd_node_tP9que_thr_t + 2841
7   mysqld                              0x0000000108749e4c _ZL16row_upd_sec_stepP10upd_node_tP9que_thr_t + 284
8   mysqld                              0x0000000108744add _ZL7row_updP10upd_node_tP9que_thr_t + 1245
9   mysqld                              0x00000001087444c8 _Z12row_upd_stepP9que_thr_t + 664
10  mysqld                              0x00000001086d1cff _ZL36row_update_for_mysql_using_upd_graphPKhP14row_prebuilt_t + 5727
11  mysqld                              0x00000001086d00e4 _Z20row_update_for_mysqlPKhP14row_prebuilt_t + 148
12  mysqld                              0x00000001085221ed _ZN11ha_innobase10delete_rowEPKh + 733
13  mysqld                              0x00000001074dff08 _ZN7handler13ha_delete_rowEPKh + 616

when we could instead have gotten:
0   mysqld                              0x0000000110a78858 my_print_stacktrace + 72
1   mysqld                              0x0000000110950cee handle_fatal_signal + 910
2   libsystem_platform.dylib            0x00007fff8df7652a _sigtramp + 26
3   mysqld                              0x0000000111f2bacd nochar + 239437
4   libsystem_c.dylib                   0x00007fff8ac5a6e7 abort + 129
5   mysqld                              0x0000000110f6a774 ut_dbg_assertion_failed(char const*, char const*, unsigned long) + 228
6   mysqld                              0x0000000110ec1389 row_upd_sec_index_entry(upd_node_t*, que_thr_t*) + 2841
7   mysqld                              0x0000000110ebce4c row_upd_sec_step(upd_node_t*, que_thr_t*) + 284
8   mysqld                              0x0000000110eb7add row_upd(upd_node_t*, que_thr_t*) + 1245
9   mysqld                              0x0000000110eb74c8 row_upd_step(que_thr_t*) + 664
10  mysqld                              0x0000000110e44cff row_update_for_mysql_using_upd_graph(unsigned char const*, row_prebuilt_t*) + 5727
11  mysqld                              0x0000000110e430e4 row_update_for_mysql(unsigned char const*, row_prebuilt_t*) + 148
12  mysqld                              0x0000000110c951ed ha_innobase::delete_row(unsigned char const*) + 733
13  mysqld                              0x000000010fc52f18 handler::ha_delete_row(unsigned char const*) + 616

How to repeat:
Get the server to crash on OS X and check the console output.

Suggested fix:
Also use __cxa__demangle() on OS X.
[18 Jun 2016 21:38] Omer Barnir
Posted by developer:
 
Reported version value updated to reflect release name change from 5.8 to 8.0
[20 Jun 2016 16:58] Paul DuBois
Posted by developer:
 
Noted in 8.0.0 changelog.

On OS X, stack trace demangling now occurs for builds compiled using
Clang, just as for GCC.