Bug #21298 ndbcluster_log_schema_op locks already freed mutex
Description:
Test cases rpl_truncate_7ndb fails quite randomly. When examining the core files it looks like safe_mutex_lock has detected a lock of an already free mutex in schema_share.
#2 0x0852137c in write_core (sig=11) at stacktrace.c:220
#3 0x082a56c3 in handle_segfault (sig=11) at mysqld.cc:2177
#4 <signal handler called>
#5 0x089d1d98 in safe_mutex_lock (mp=0xa8,
file=0x8b2a875 "ha_ndbcluster_binlog.cc", line=1473) at thr_mutex.c:98
#6 0x0848e5d9 in ndbcluster_log_schema_op (thd=0xa0546b8, share=0xa0bb760,
query=0xb79816f0 "drop table `t1`", query_length=15, db=0xa0b93aa "test",
table_name=0xa0b93af "t1", ndb_table_id=5, ndb_table_version=9,
type=SOT_DROP_TABLE, new_db=0x0, new_table_name=0x0, have_lock_open=1)
at ha_ndbcluster_binlog.cc:1473
#7 0x0846bd9b in ha_ndbcluster::delete_table (h=0xa0b4150, ndb=0xa056310,
path=0xb7982a10 "./test/t1", db=0xa0b4254 "test",
table_name=0xa0b4351 "t1") at ha_ndbcluster.cc:5375
#8 0x0846c293 in ha_ndbcluster::delete_table (this=0xa0b4150,
name=0xb7982a10 "./test/t1") at ha_ndbcluster.cc:5438
#9 0x0840ed14 in ha_delete_table (thd=0xa0546b8, table_type=0x8e098a0,
path=0xb7982a10 "./test/t1", db=0xa0b4148 "test", alias=0xa0b3f80 "t1",
generate_warning=true) at handler.cc:1369
#10 0x084a3dac in mysql_rm_table_part2 (thd=0xa0546b8, tables=0xa0b3fa8,
if_exists=false, drop_temporary=false, drop_view=false,
dont_log_query=false) at sql_table.cc:1636
---Type <return> to continue, or q <return> to quit---
#11 0x084a31d6 in mysql_rm_table (thd=0xa0546b8, tables=0xa0b3fa8,
if_exists=0 '\0', drop_temporary=0 '\0') at sql_table.cc:1411
#12 0x082d7844 in mysql_execute_command (thd=0xa0546b8) at sql_parse.cc:3577
#13 0x082e1ab5 in mysql_parse (thd=0xa0546b8, inBuf=0xa0b9831 "DROP TABLE t1",
length=13) at sql_parse.cc:6089
#14 0x083a8d9d in Query_log_event::exec_event (this=0xa0dfa40, rli=0xa05f314,
query_arg=0xa0b9831 "DROP TABLE t1", q_len_arg=13) at log_event.cc:1821
#15 0x083a8639 in Query_log_event::exec_event (this=0xa0dfa40, rli=0xa05f314)
at log_event.cc:1699
#16 0x08504107 in exec_relay_log_event (thd=0xa0546b8, rli=0xa05f314)
at slave.cc:3151
#17 0x08506425 in handle_slave_sql (arg=0xa05e4b8) at slave.cc:3702
How to repeat:
Detected by PushBuild, See for example this test run https://intranet.mysql.com/~knielsen/getlog.pl?dir=mysql-5.1-new-maint&entry=msvensson@nep...
Suggested fix:
Protect the schema_share access.
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.053 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.
Description: Test cases rpl_truncate_7ndb fails quite randomly. When examining the core files it looks like safe_mutex_lock has detected a lock of an already free mutex in schema_share. #2 0x0852137c in write_core (sig=11) at stacktrace.c:220 #3 0x082a56c3 in handle_segfault (sig=11) at mysqld.cc:2177 #4 <signal handler called> #5 0x089d1d98 in safe_mutex_lock (mp=0xa8, file=0x8b2a875 "ha_ndbcluster_binlog.cc", line=1473) at thr_mutex.c:98 #6 0x0848e5d9 in ndbcluster_log_schema_op (thd=0xa0546b8, share=0xa0bb760, query=0xb79816f0 "drop table `t1`", query_length=15, db=0xa0b93aa "test", table_name=0xa0b93af "t1", ndb_table_id=5, ndb_table_version=9, type=SOT_DROP_TABLE, new_db=0x0, new_table_name=0x0, have_lock_open=1) at ha_ndbcluster_binlog.cc:1473 #7 0x0846bd9b in ha_ndbcluster::delete_table (h=0xa0b4150, ndb=0xa056310, path=0xb7982a10 "./test/t1", db=0xa0b4254 "test", table_name=0xa0b4351 "t1") at ha_ndbcluster.cc:5375 #8 0x0846c293 in ha_ndbcluster::delete_table (this=0xa0b4150, name=0xb7982a10 "./test/t1") at ha_ndbcluster.cc:5438 #9 0x0840ed14 in ha_delete_table (thd=0xa0546b8, table_type=0x8e098a0, path=0xb7982a10 "./test/t1", db=0xa0b4148 "test", alias=0xa0b3f80 "t1", generate_warning=true) at handler.cc:1369 #10 0x084a3dac in mysql_rm_table_part2 (thd=0xa0546b8, tables=0xa0b3fa8, if_exists=false, drop_temporary=false, drop_view=false, dont_log_query=false) at sql_table.cc:1636 ---Type <return> to continue, or q <return> to quit--- #11 0x084a31d6 in mysql_rm_table (thd=0xa0546b8, tables=0xa0b3fa8, if_exists=0 '\0', drop_temporary=0 '\0') at sql_table.cc:1411 #12 0x082d7844 in mysql_execute_command (thd=0xa0546b8) at sql_parse.cc:3577 #13 0x082e1ab5 in mysql_parse (thd=0xa0546b8, inBuf=0xa0b9831 "DROP TABLE t1", length=13) at sql_parse.cc:6089 #14 0x083a8d9d in Query_log_event::exec_event (this=0xa0dfa40, rli=0xa05f314, query_arg=0xa0b9831 "DROP TABLE t1", q_len_arg=13) at log_event.cc:1821 #15 0x083a8639 in Query_log_event::exec_event (this=0xa0dfa40, rli=0xa05f314) at log_event.cc:1699 #16 0x08504107 in exec_relay_log_event (thd=0xa0546b8, rli=0xa05f314) at slave.cc:3151 #17 0x08506425 in handle_slave_sql (arg=0xa05e4b8) at slave.cc:3702 How to repeat: Detected by PushBuild, See for example this test run https://intranet.mysql.com/~knielsen/getlog.pl?dir=mysql-5.1-new-maint&entry=msvensson@nep... Suggested fix: Protect the schema_share access.