Bug #42701 mysqld crash if no cluster connection available
Submitted: 9 Feb 2009 16:10 Modified: 9 Feb 2009 18:16
Reporter: Magnus Blåudd Email Updates:
Status: Not a Bug Impact on me:
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S1 (Critical)
Version: OS:Any
Assigned to: CPU Architecture:Any

[9 Feb 2009 16:10] Magnus Blåudd

Logging: ./mtr alias --mysqld=--ndbcluster
MySQL Version 5.1.30

TEST                           RESULT         TIME (ms)

main.alias                     [ fail ]

mysqltest: At line 2: query 'DROP TABLE IF EXISTS t1' failed: 2013: Lost connection to MySQL server during query

How to repeat:
(gdb) where
#0  0x00007f939d3b01e6 in pthread_kill () from /lib/libpthread.so.0
#1  0x0000000000b37ed0 in my_write_core (sig=11) at stacktrace.c:310
#2  0x00000000006bb7e4 in handle_segfault (sig=11) at mysqld.cc:2508
#3  <signal handler called>
#4  0x0000000000a920e3 in Ndb_cluster_connection_impl::get_connect_count (
    this=0x1eb3cd0) at ./TransporterFacade.hpp:360
#5  0x0000000000a8ef7e in Ndb_cluster_connection::get_connect_count (
    this=0x1e989a0) at ndb_cluster_connection.cpp:265
#6  0x00000000008ea3eb in Thd_ndb (this=0x1f31060) at ha_ndbcluster.cc:618
#7  0x00000000008ea601 in ha_ndbcluster::seize_thd_ndb ()
    at ha_ndbcluster.cc:8187
#8  0x00000000008ea700 in check_ndb_in_thd (thd=0x1f1f508, validate_ndb=false)
    at ha_ndbcluster.cc:8279
#9  0x000000000090c717 in ndbcluster_global_schema_lock (thd=0x1f1f508, 
    no_lock_queue=0, report_cluster_disconnected=1)
    at ha_ndbcluster_binlog.cc:790
#10 0x0000000000914430 in ndbcluster_binlog_func (hton=0x1eb3a38, 
    thd=0x1f1f508, fn=BFN_GLOBAL_SCHEMA_LOCK, arg=0x40834cd4)
    at ha_ndbcluster_binlog.cc:965
#11 0x00000000007fefc8 in binlog_func_foreach (thd=0x1f1f508, bfn=0x40834ce0)
    at handler.cc:3911
#12 0x00000000007ff0b8 in ha_global_schema_lock (thd=0x1f1f508, no_queue=0)
    at handler.cc:3960
#13 0x00000000007ff14d in Ha_global_schema_lock_guard::lock (this=0x40834df0, 
    no_queue=0) at handler.cc:3990
#14 0x0000000000829903 in mysql_rm_table_part2 (thd=0x1f1f508, 
    tables=0x1f5dbd0, if_exists=true, drop_temporary=false, drop_view=false, 
    dont_log_query=false) at sql_table.cc:1573
#15 0x000000000082a578 in mysql_rm_table (thd=0x1f1f508, tables=0x1f5dbd0, 
    if_exists=1 '\001', drop_temporary=0 '\0') at sql_table.cc:1497
#16 0x00000000006d0bdf in mysql_execute_command (thd=0x1f1f508)
    at sql_parse.cc:3281
#17 0x00000000006d6014 in mysql_parse (thd=0x1f1f508, 
    inBuf=0x1f5daf8 "DROP TABLE IF EXISTS t1", length=23, 
    found_semicolon=0x40836bd8) at sql_parse.cc:5790
#18 0x00000000006d6d96 in dispatch_command (command=COM_QUERY, thd=0x1f1f508, 
    packet=0x1f4dcd9 "DROP TABLE IF EXISTS t1", packet_length=23)
    at sql_parse.cc:1200
#19 0x00000000006d81db in do_command (thd=0x1f1f508) at sql_parse.cc:857
#20 0x00000000006c4f7e in handle_one_connection (arg=0x1f1f508)
    at sql_connect.cc:1115
#21 0x00007f939d3ab3ea in start_thread () from /lib/libpthread.so.0
#22 0x00007f939c110c6d in clone () from /lib/libc.so.6
#23 0x0000000000000000 in ?? ()

Suggested fix:
Don't allow usage of Ndb object before TransporterFacade and ClusterMgr has been created.
[9 Feb 2009 18:16] Magnus Blåudd
Occurred in an old clone of 6.4, not the fresh 6.3 clone that I thought I had.