Bug #65896 mysqld segfault during RENAME TABLE
Submitted: 13 Jul 2012 19:31 Modified: 28 Jun 2016 16:17
Reporter: Timothy Thompson Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S2 (Serious)
Version:7.2.6 OS:Linux (Debian 6.0.4)
Assigned to: Bogdan Kecman CPU Architecture:Any

[13 Jul 2012 19:31] Timothy Thompson
Description:
During a RENAME TABLE event, the SQL nodes will frequently crash.
The SQL node the RENAME is being executed on never seems to crash, however. The backtrace leading up to the crash often differs slightly, but the last function is always my_hash_sort_bin. The issue doesn't always occur, and it doesn't seem to make a difference which table(s) is/are renamed. Of the four SQL nodes in our cluster, all 3 nodes the RENAME is not being run on have crashed several times, though usually not at the same time.

Rename event on node mgmt1 (also an sql node):
120713 11:48:43 [Note] NDB Binlog: CREATE TABLE Event: REPL$ascend/tn_sip_stg
120713 11:49:46 [Note] NDB Binlog: RENAME Event: REPL$ascend/tn_sip_trash
120713 11:49:46 [Note] NDB Binlog: RENAME Event: REPL$ascend/tn_sip

Resulting crash on node sql1:
18:49:47 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.
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.

key_buffer_size=268435456
read_buffer_size=262144
max_used_connections=93
max_threads=1024
thread_count=91
connection_count=91
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 1060304 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x4147e70
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 = 7fdaa7172ea8 thread_stack 0x40000
/usr/local/mysql/bin/mysqld(my_print_stacktrace+0x35)[0x819175]
/usr/local/mysql/bin/mysqld(handle_fatal_signal+0x403)[0x6e50b3]
/lib/libpthread.so.0(+0xeff0)[0x7fdacbb40ff0]
/usr/local/mysql/bin/mysqld(my_hash_sort_bin+0x25)[0xacd075]
/usr/local/mysql/bin/mysqld(my_hash_first_from_hash_value+0x152)[0x7ffc32]
/usr/local/mysql/bin/mysqld(my_hash_first+0x6f)[0x7ffd2f]
/usr/local/mysql/bin/mysqld(my_hash_search+0x11)[0x7ffd61]
/usr/local/mysql/bin/mysqld[0x94a1e9]
/usr/local/mysql/bin/mysqld(_Z20ndbcluster_get_sharePKcP5TABLEbb+0x66)[0x94a326]
/usr/local/mysql/bin/mysqld(_ZNK24Ndb_schema_event_handler9get_shareEPNS_13Ndb_schema_opE+0x40)[0x972ea0]
/usr/local/mysql/bin/mysqld(_ZN24Ndb_schema_event_handler27handle_schema_op_post_epochEPNS_13Ndb_schema_opE+0x28f)[0x97525f]
/usr/local/mysql/bin/mysqld(ndb_binlog_thread_func+0x12e0)[0x971c20]
/lib/libpthread.so.0(+0x68ca)[0x7fdacbb388ca]
/lib/libc.so.6(clone+0x6d)[0x7fdacadd992d]

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

How to repeat:
RENAME TABLE liveTable TO liveTable_old, liveTable_staging TO liveTable

Will not always result in a crash, and it is unknown if activity (SELECTs) against the table are required to result in a crash.
[13 Jul 2012 19:31] Timothy Thompson
Additional trace examples:

21:11:55 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.
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.

key_buffer_size=268435456
read_buffer_size=262144
max_used_connections=105
max_threads=1024
thread_count=104
connection_count=104
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 1060304 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x7f0edd708380
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 = 7f0eec463e98 thread_stack 0x40000
/usr/local/mysql/bin/mysqld(my_print_stacktrace+0x35)[0x819175]
/usr/local/mysql/bin/mysqld(handle_fatal_signal+0x403)[0x6e50b3]
/lib/libpthread.so.0(+0xeff0)[0x7f0f115cfff0]
/usr/local/mysql/bin/mysqld(my_hash_sort_bin+0x25)[0xacd075]
/usr/local/mysql/bin/mysqld(my_hash_insert+0x14b)[0x8002ab]
/usr/local/mysql/bin/mysqld[0x94a28f]
/usr/local/mysql/bin/mysqld(_Z20ndbcluster_get_sharePKcP5TABLEbb+0x66)[0x94a326]
/usr/local/mysql/bin/mysqld(_Z30ndbcluster_create_binlog_setupP3THDP3NdbPKcjS4_S4_P5TABLE+0x3e)[0x96f17e]
/usr/local/mysql/bin/mysqld(_ZN13ha_ndbcluster6createEPKcP5TABLEP24st_ha_create_information+0x48f)[0x94fe2f]
/usr/local/mysql/bin/mysqld(_Z27ha_create_table_from_engineP3THDPKcS2_+0x1cd)[0x6eb25d]
/usr/local/mysql/bin/mysqld(_ZN18Open_table_context24recover_from_failed_openEP3THD+0xa1)[0x5b79b1]
/usr/local/mysql/bin/mysqld(_Z11open_tablesP3THDPP10TABLE_LISTPjjP19Prelocking_strategy+0x350)[0x5b9540]
/usr/local/mysql/bin/mysqld(_Z20open_and_lock_tablesP3THDP10TABLE_LISTbjP19Prelocking_strategy+0x44)[0x5ba004]
/usr/local/mysql/bin/mysqld[0x5e9405]
/usr/local/mysql/bin/mysqld(_Z21mysql_execute_commandP3THD+0x2206)[0x5eea26]
/usr/local/mysql/bin/mysqld(_ZN18Prepared_statement7executeEP6Stringb+0x31d)[0x5fe3bd]
/usr/local/mysql/bin/mysqld(_ZN18Prepared_statement12execute_loopEP6StringbPhS2_+0x7c)[0x6011ac]
/usr/local/mysql/bin/mysqld(_Z19mysqld_stmt_executeP3THDPcj+0x175)[0x601735]
/usr/local/mysql/bin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0xc71)[0x5f2521]
/usr/local/mysql/bin/mysqld(_Z24do_handle_one_connectionP3THD+0x167)[0x68a0f7]
/usr/local/mysql/bin/mysqld(handle_one_connection+0x54)[0x68a164]
/lib/libpthread.so.0(+0x68ca)[0x7f0f115c78ca]
/lib/libc.so.6(clone+0x6d)[0x7f0f1086892d]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7f0edd721878): is an invalid pointer
Connection ID (thread ID): 1114
Status: NOT_KILLED

19:16:07 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.
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.

key_buffer_size=268435456
read_buffer_size=262144
max_used_connections=105
max_threads=1024
thread_count=104
connection_count=104
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 1060304 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x3431ea0
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 = 7f6d0de1fea8 thread_stack 0x40000
/usr/local/mysql/bin/mysqld(my_print_stacktrace+0x35)[0x819175]
/usr/local/mysql/bin/mysqld(handle_fatal_signal+0x403)[0x6e50b3]
/lib/libpthread.so.0(+0xeff0)[0x7f6d327edff0]
/usr/local/mysql/bin/mysqld(my_hash_sort_bin+0x25)[0xacd075]
/usr/local/mysql/bin/mysqld(my_hash_first_from_hash_value+0x152)[0x7ffc32]
/usr/local/mysql/bin/mysqld(my_hash_first+0x6f)[0x7ffd2f]
/usr/local/mysql/bin/mysqld(my_hash_search+0x11)[0x7ffd61]
/usr/local/mysql/bin/mysqld[0x94a1e9]
/usr/local/mysql/bin/mysqld(_Z20ndbcluster_get_sharePKcP5TABLEbb+0x66)[0x94a326]
/usr/local/mysql/bin/mysqld[0x95581b]
/usr/local/mysql/bin/mysqld[0x6e59d3]
/usr/local/mysql/bin/mysqld(_Z24plugin_foreach_with_maskP3THDPFcS0_P13st_plugin_intPvEijS3_+0x1ee)[0x5f898e]
/usr/local/mysql/bin/mysqld(_Z11ha_discoverP3THDPKcS2_PPhPm+0x5d)[0x6e6b6d]
/usr/local/mysql/bin/mysqld(_Z27ha_create_table_from_engineP3THDPKcS2_+0x8d)[0x6eb11d]
/usr/local/mysql/bin/mysqld(_Z28ndb_create_table_from_engineP3THDPKcS2_+0x88)[0x951448]
/usr/local/mysql/bin/mysqld(_ZN24Ndb_schema_event_handler16handle_schema_opEPNS_13Ndb_schema_opE+0x47f)[0x973e3f]
/usr/local/mysql/bin/mysqld(_ZN24Ndb_schema_event_handler12handle_eventEP3NdbP17NdbEventOperation+0x350)[0x974250]
/usr/local/mysql/bin/mysqld(ndb_binlog_thread_func+0x2151)[0x972a91]
/lib/libpthread.so.0(+0x68ca)[0x7f6d327e58ca]
/lib/libc.so.6(clone+0x6d)[0x7f6d31a8692d]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0): is an invalid pointer
Connection ID (thread ID): 1
Status: NOT_KILLED
[28 Jun 2016 16:17] Bogdan Kecman
can't reproduce on 7.2.23 after more then an hour of doing the same thing ... the original is not easy to reproduce so might be fixed but might not can't say for sure.. might be fixed by bug#17882305