Bug #93726 handle_fatal_signal (sig=11) in safe_mutex_lock | mysys/thr_mutex.cc:70
Submitted: 21 Dec 2018 18:36 Modified: 14 May 2019 17:35
Reporter: Ramesh Sivaraman Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Locking Severity:S6 (Debug Builds)
Version:8.0.13 OS:Ubuntu
Assigned to: CPU Architecture:Any
Tags: debug

[21 Dec 2018 18:36] Ramesh Sivaraman
Description:
GDB Info

#0  __pthread_kill (threadid=<optimized out>, signo=11) at ../sysdeps/unix/sysv/linux/pthread_kill.c:62
#1  0x000000000452fdd9 in my_write_core (sig=11) at /qa/binaries/MS-80_dbg/mysys/stacktrace.cc:278
#2  0x00000000031b367d in handle_fatal_signal (sig=11) at /qa/binaries/MS-80_dbg/sql/signal_handler.cc:249
#3  <signal handler called>
#4  __GI___pthread_mutex_lock (mutex=0x0) at ../nptl/pthread_mutex_lock.c:67
#5  0x00000000045339f2 in native_mutex_lock (mutex=0x0) at /qa/binaries/MS-80_dbg/include/thr_mutex.h:93
#6  0x0000000004533b16 in safe_mutex_lock (mp=0x0, try_lock=false, file=0x5cf9ca0 "/qa/binaries/MS-80_dbg/storage/perfschema/pfs_engine_table.h", line=396) at /qa/binaries/MS-80_dbg/mysys/thr_mutex.cc:70
#7  0x0000000004c06457 in my_mutex_lock (mp=0x6d9fa38 <pfs_external_table_shares+24>, file=0x5cf9ca0 "/qa/binaries/MS-80_dbg/storage/perfschema/pfs_engine_table.h", line=396) at /qa/binaries/MS-80_dbg/include/thr_mutex.h:180
#8  0x0000000004c0652c in inline_mysql_mutex_lock (that=0x6d9fa38 <pfs_external_table_shares+24>, src_file=0x5cf9ca0 "/qa/binaries/MS-80_dbg/storage/perfschema/pfs_engine_table.h", src_line=396) at /qa/binaries/MS-80_dbg/include/mysql/psi/mysql_mutex.h:272
#9  0x0000000004c0b7c0 in PFS_dynamic_table_shares::lock_share_list (this=0x6d9fa20 <pfs_external_table_shares>) at /qa/binaries/MS-80_dbg/storage/perfschema/pfs_engine_table.h:396
#10 0x0000000004c065ba in lock_pfs_external_table_shares () at /qa/binaries/MS-80_dbg/storage/perfschema/ha_perfschema.cc:86
#11 0x0000000004c0ad72 in ha_perfschema::index_flags (this=0x7f4f8c2b3d18) at /qa/binaries/MS-80_dbg/storage/perfschema/ha_perfschema.cc:1761
#12 0x000000000313731c in setup_key_part_field (share=0x7f4f8c2b1ba8, handler_file=0x7f4f8c2b3d18, primary_key_n=64, keyinfo=0x7f4f8c3038b0, key_n=0, key_part_n=0, usable_parts=0x7f502f99e89c, part_of_key_not_extended=true) at /qa/binaries/MS-80_dbg/sql/table.cc:739
#13 0x00000000032d5546 in prepare_share (thd=0x7f4c749ab080, share=0x7f4f8c2b1ba8, table_def=0x7f4f8c2eeab8) at /qa/binaries/MS-80_dbg/sql/dd_table_share.cc:392
#14 0x00000000032ddf27 in open_table_def (thd=0x7f4c749ab080, share=0x7f4f8c2b1ba8, table_def=...) at /qa/binaries/MS-80_dbg/sql/dd_table_share.cc:2236
#15 0x0000000002f3a6db in get_table_share (thd=0x7f4c749ab080, db=0x7f4f8c2bf5e0 "performance_schema", table_name=0x7f4f8c2bf638 "table_io_waits_summary_by_table", key=0x7f4f8c2cefdf "performance_schema", key_length=51, open_view=true, open_secondary=false) at /qa/binaries/MS-80_dbg/sql/sql_base.cc:779
#16 0x0000000002f3abc1 in get_table_share_with_discover (thd=0x7f4c749ab080, table_list=0x7f4f8c2cec10, key=0x7f4f8c2cefdf "performance_schema", key_length=51, open_secondary=false, error=0x7f502f99ec9c) at /qa/binaries/MS-80_dbg/sql/sql_base.cc:861
#17 0x0000000002f405fa in open_table (thd=0x7f4c749ab080, table_list=0x7f4f8c2cec10, ot_ctx=0x7f502f99f1b0) at /qa/binaries/MS-80_dbg/sql/sql_base.cc:3162
#18 0x0000000002f44bb5 in open_and_process_table (thd=0x7f4c749ab080, lex=0x7f4f8c2a7998, tables=0x7f4f8c2cec10, counter=0x7f502f99f23c, prelocking_strategy=0x7f502f99f260, has_prelocking_list=false, ot_ctx=0x7f502f99f1b0) at /qa/binaries/MS-80_dbg/sql/sql_base.cc:5004
#19 0x0000000002f4616f in open_tables (thd=0x7f4c749ab080, start=0x7f502f99f270, counter=0x7f502f99f23c, flags=32768, prelocking_strategy=0x7f502f99f260) at /qa/binaries/MS-80_dbg/sql/sql_base.cc:5649
#20 0x00000000032d112f in open_views_and_update_metadata (thd=0x7f4c749ab080, views=0x7f502f9a07b0, commit_dd_changes=false, uncommitted_tables=0x7f502f9a0950) at /qa/binaries/MS-80_dbg/sql/dd_sql_view.cc:414
#21 0x00000000032d24ec in update_view_metadata<dd::View_table> (thd=0x7f4c749ab080, db=0x55ea194 "information_schema", tbl_or_sf_name=0x5ba0206 "INNODB_BUFFER_PAGE", commit_dd_changes=false, uncommitted_tables=0x7f502f9a0950) at /qa/binaries/MS-80_dbg/sql/dd_sql_view.cc:661
#22 0x00000000032d1f02 in update_referencing_views_metadata (thd=0x7f4c749ab080, db=0x55ea194 "information_schema", table_name=0x5ba0206 "INNODB_BUFFER_PAGE", new_db=0x0, new_table_name=0x0, commit_dd_changes=false, uncommitted_tables=0x7f502f9a0950) at /qa/binaries/MS-80_dbg/sql/dd_sql_view.cc:678
#23 0x00000000032d2186 in update_referencing_views_metadata (thd=0x7f4c749ab080, db_name=0x55ea194 "information_schema", table_name=0x5ba0206 "INNODB_BUFFER_PAGE", commit_dd_changes=false, uncommitted_tables=0x7f502f9a0950) at /qa/binaries/MS-80_dbg/sql/dd_sql_view.cc:719
#24 0x00000000044321ad in (anonymous namespace)::store_plugin_and_referencing_views_metadata (thd=0x7f4c749ab080, plugin=0x7f502f9a0ae0, arg=0x7f502f9a0c70) at /qa/binaries/MS-80_dbg/sql/dd/info_schema/metadata.cc:359
#25 0x000000000302af81 in plugin_foreach_with_mask (thd=0x7f4c749ab080, funcs=0x7f502f9a0b80, type=4, state_mask=4294967287, arg=0x7f502f9a0c70) at /qa/binaries/MS-80_dbg/sql/sql_plugin.cc:2530
#26 0x000000000302b04f in plugin_foreach_with_mask (thd=0x7f4c749ab080, func=0x4431ff2 <(anonymous namespace)::store_plugin_and_referencing_views_metadata(THD*, plugin_ref, void*)>, type=4, state_mask=8, arg=0x7f502f9a0c70) at /qa/binaries/MS-80_dbg/sql/sql_plugin.cc:2543
#27 0x00000000044327be in (anonymous namespace)::update_plugins_I_S_metadata (thd=0x7f4c749ab080) at /qa/binaries/MS-80_dbg/sql/dd/info_schema/metadata.cc:446
#28 0x00000000044331da in dd::info_schema::update_I_S_metadata (thd=0x7f4c749ab080) at /qa/binaries/MS-80_dbg/sql/dd/info_schema/metadata.cc:615
#29 0x00000000032cf256 in bootstrap::handle_bootstrap (arg=0x7f4c749ab080) at /qa/binaries/MS-80_dbg/sql/bootstrap.cc:347
#30 0x0000000004c0e42a in pfs_spawn_thread (arg=0x7f4c74935df0) at /qa/binaries/MS-80_dbg/storage/perfschema/pfs.cc:2836
#31 0x00007f50326f66ba in start_thread (arg=0x7f502f9a1700) at pthread_create.c:333
#32 0x00007f5030aaa41d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

How to repeat:
Testcase (Server is crashing with startup command)

rm -Rf /dev/shm/1545414220
mkdir -p /dev/shm/1545414220/tmp

/qa/binaries/mysql-8.0.13-linux-x86_64-debug/bin/mysqld --no-defaults --initialize-insecure --basedir=/qa/binaries/mysql-8.0.13-linux-x86_64-debug --datadir=/dev/shm/1545414220/data

/qa/binaries/mysql-8.0.13-linux-x86_64-debug/bin/mysqld --no-defaults --basedir=/qa/binaries/mysql-8.0.13-linux-x86_64-debug --datadir=/dev/shm/1545414220/data --tmpdir=/dev/shm/1545414220/tmp --port=32959 --pid-file=/dev/shm/1545414220/pid.pid --core-file --socket=/dev/shm/1545414220/socket.sock --performance-schema-digests-size=1125899906842624 --performance-schema-max-sql-text-length=1125899906842624 --log-error=/dev/shm/1545414220/error.log.out &
[21 Dec 2018 20:46] MySQL Verification Team
Thank you for the bug report. Verified with debug built.

miguel@tikal:~/bug $ /home/miguel/bug/8.0/bin/mysqld --no-defaults --basedir=/home/miguel/bug/8.0 --datadir=/home/miguel/bug/8.0/data  --performance-schema-digests-size=1125899906842624 --performance-schema-max-sql-text-length=1125899906842624
20:33:54 UTC - mysqld got signal 11 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
Attempting to collect some information that could help diagnose the problem.
As this is a crash and something is definitely wrong, the information
collection process might fail.

key_buffer_size=8388608
read_buffer_size=131072
max_used_connections=0
max_threads=151
thread_count=1
connection_count=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 67884 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x55a8e7cdf580
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 7f4cfea74d48 thread_stack 0x46000
/home/miguel/bug/8.0/bin/mysqld(my_print_stacktrace(unsigned char*, unsigned long)+0x55) [0x55a8e45cd3d1]
/home/miguel/bug/8.0/bin/mysqld(handle_fatal_signal+0x3f2) [0x55a8e3284487]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12dd0) [0x7f4cff517dd0]
/lib/x86_64-linux-gnu/libpthread.so.0(__pthread_mutex_lock+0) [0x7f4cff50f960]
/home/miguel/bug/8.0/bin/mysqld(+0x41910ac) [0x55a8e45d10ac]
/home/miguel/bug/8.0/bin/mysqld(safe_mutex_lock(safe_mutex_t*, bool, char const*, unsigned int)+0x25) [0x55a8e45d11d0]
/home/miguel/bug/8.0/bin/mysqld(+0x48be977) [0x55a8e4cfe977]
/home/miguel/bug/8.0/bin/mysqld(+0x48bea4c) [0x55a8e4cfea4c]
/home/miguel/bug/8.0/bin/mysqld(PFS_dynamic_table_shares::lock_share_list()+0x28) [0x55a8e4cfeb8a]
/home/miguel/bug/8.0/bin/mysqld(+0x48b982d) [0x55a8e4cf982d]
/home/miguel/bug/8.0/bin/mysqld(ha_perfschema::index_flags(unsigned int, unsigned int, bool) const+0x1c) [0x55a8e4cfdfd0]
/home/miguel/bug/8.0/bin/mysqld(setup_key_part_field(TABLE_SHARE*, handler*, unsigned int, KEY*, unsigned int, unsigned int, unsigned int*, bool)+0x123) [0x55a8e32073b4]
/home/miguel/bug/8.0/bin/mysqld(+0x2f60937) [0x55a8e33a0937]
/home/miguel/bug/8.0/bin/mysqld(open_table_def(THD*, TABLE_SHARE*, dd::Table const&)+0x12c) [0x55a8e33a8f4d]
/home/miguel/bug/8.0/bin/mysqld(get_table_share(THD*, char const*, char const*, char const*, unsigned long, bool, bool)+0x8a3) [0x55a8e30079c2]
/home/miguel/bug/8.0/bin/mysqld(+0x2bc7e84) [0x55a8e3007e84]
/home/miguel/bug/8.0/bin/mysqld(open_table(THD*, TABLE_LIST*, Open_table_context*)+0x107a) [0x55a8e300d92a]
/home/miguel/bug/8.0/bin/mysqld(+0x2bd1f24) [0x55a8e3011f24]
/home/miguel/bug/8.0/bin/mysqld(open_tables(THD*, TABLE_LIST**, unsigned int*, unsigned int, Prelocking_strategy*)+0x3bc) [0x55a8e30134e4]
/home/miguel/bug/8.0/bin/mysqld(+0x2f5c4a9) [0x55a8e339c4a9]
/home/miguel/bug/8.0/bin/mysqld(+0x2f5d845) [0x55a8e339d845]
/home/miguel/bug/8.0/bin/mysqld(+0x2f5d25b) [0x55a8e339d25b]
/home/miguel/bug/8.0/bin/mysqld(update_referencing_views_metadata(THD*, char const*, char const*, bool, Uncommitted_tables_guard*)+0xa5) [0x55a8e339d4df]
/home/miguel/bug/8.0/bin/mysqld(+0x409b610) [0x55a8e44db610]
/home/miguel/bug/8.0/bin/mysqld(plugin_foreach_with_mask(THD*, bool (**)(THD*, st_plugin_int**, void*), int, unsigned int, void*)+0x3bf) [0x55a8e30f6e1b]
/home/miguel/bug/8.0/bin/mysqld(plugin_foreach_with_mask(THD*, bool (*)(THD*, st_plugin_int**, void*), int, unsigned int, void*)+0x5e) [0x55a8e30f6ee9]
/home/miguel/bug/8.0/bin/mysqld(+0x409bc1c) [0x55a8e44dbc1c]
/home/miguel/bug/8.0/bin/mysqld(dd::info_schema::update_I_S_metadata(THD*)+0x28) [0x55a8e44dc627]
/home/miguel/bug/8.0/bin/mysqld(+0x2f57fe5) [0x55a8e3397fe5]
/home/miguel/bug/8.0/bin/mysqld(+0x48c17ee) [0x55a8e4d017ee]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x8164) [0x7f4cff50d164]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x3f) [0x7f4cfeb95def]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0): Connection ID (thread ID): 2
Status: NOT_KILLED

The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
miguel@tikal:~/bug $ 8.0/bin/mysqld --version
/home/miguel/bug/8.0/bin/mysqld  Ver 8.0.15-debug for Linux on x86_64 (Source distribution)
===================================================================================================================

miguel@tikal:~/bug $ /home/miguel/bug/8.0/bin/mysqld --no-defaults --basedir=/home/miguel/bug/8.0 --datadir=/home/miguel/bug/8.0/data  --performance-schema-digests-size=1125899906842624 --performance-schema-max-sql-text-length=1125899906842624
2018-12-21T20:42:03.759303Z 0 [Warning] [MY-000080] [Server] option 'performance_schema_digests_size': signed value 1125899906842624 adjusted to 1048576.
2018-12-21T20:42:03.759324Z 0 [Warning] [MY-000080] [Server] option 'performance_schema_max_sql_text_length': signed value 1125899906842624 adjusted to 1048576.
2018-12-21T20:42:08.611715Z 0 [Warning] [MY-011041] [Server] Failed to allocate 1099511627776 bytes for buffer '' due to out-of-memory.
2018-12-21T20:42:09.042980Z 0 [Warning] [MY-010170] [Server] Performance schema disabled (reason: init failed).
2018-12-21T20:42:09.482435Z 0 [System] [MY-010116] [Server] /home/miguel/bug/8.0/bin/mysqld (mysqld 8.0.15) starting as process 7241
2018-12-21T20:42:14.684818Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2018-12-21T20:42:15.000777Z 0 [System] [MY-010931] [Server] /home/miguel/bug/8.0/bin/mysqld: ready for connections. Version: '8.0.15'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution.
2018-12-21T20:42:15.250239Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Socket: '/tmp/mysqlx.sock' bind-address: '::' port: 33060
[14 May 2019 17:35] Paul DuBois
Posted by developer:
 
Fixed in 8.0.17.

If the server was started with Performance Schema parameters that
caused an out-of-memory condition, startup failed.