Bug #54851 ndb.ndb_binlog_discover crashes the server
Submitted: 28 Jun 2010 6:42 Modified: 5 Jul 2010 6:14
Reporter: Alexander Nozdrin Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: General Severity:S1 (Critical)
Version:M3 (Celosia), M4 (Dahlia) OS:Any
Assigned to: Assigned Account CPU Architecture:Any
Tags: disabled, pb2, test failure

[28 Jun 2010 6:42] Alexander Nozdrin
Description:
It seems that ndb.ndb_binlog_discover started to crash the server
after WL#5349 too (see Bug#54850). Not 100% sure however if it is
not a coincidence.

Symptoms:

mysqltest: At line 29: query 'insert into t1 values(1)' failed with wrong errno 2013: 'Lost connection to MySQL server during query', instead of 0...

The result from queries just before the failure was:
drop table if exists t1;
create table t1 (a int key) engine=ndb;
reset master;

Server [mysqld.1.1 - pid: 28527, winpid: 28527, exit: 256] failed during test run
Server log from this test:
100628  1:39:03 [Note] NDB Binlog: CREATE TABLE Event: REPL$test/t1
100628  1:39:03 [Note] NDB Binlog: logging ./test/t1
100628  1:39:12 [Note] NDB Binlog: Node: 1, down, Subscriber bitmask 00
100628  1:39:12 [Note] NDB Binlog: cluster failure for ./mysql/ndb_schema at epoch 4108.
100628  1:39:12 [Note] NDB Binlog: ndb tables initially read only on reconnect.
100628  1:39:12 [Note] NDB Binlog: cluster failure for ./test/t1 at epoch 4108.
100628  1:39:12 [Note] NDB Binlog: cluster failure for ./mysql/ndb_apply_status at epoch 4108.
100628  1:39:27 [ERROR] /export/home/pb2/test/sb_1-1981047-1277646467.41/mysql-5.5.6-m3-linux-i686-test/libexec/mysqld: Incorrect information in file: './test/t1.frm'
mysqld: ha_ndbcluster_binlog.cc:369: int ndbcluster_binlog_open_table(THD*, NDB_SHARE*, TABLE_SHARE*, TABLE*, int): Assertion `(&(&LOCK_open)->m_mutex)->count > 0 && pthread_equal(pthread_self(), (&(&LOCK_open)->m_mutex)->thread)' failed.
100628  1:39:27 - mysqld got signal 6 ;
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=1048576
read_buffer_size=131072
max_used_connections=2
max_threads=151
thread_count=2
connection_count=2
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 60088 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

thd: 0x9911458
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 = 0xb40ec398 thread_stack 0x30000

How to repeat:
XRef: http://tinyurl.com/2ay6dmm
[5 Jul 2010 6:14] Sveta Smirnova
Thank you for the report.

Verified as described.

Backtrace:

#0  0x0000003429e0b002 in pthread_kill () from /lib64/libpthread.so.0
#0  0x0000003429e0b002 in pthread_kill () from /lib64/libpthread.so.0
#1  0x0000000000acf0f8 in my_write_core (sig=6) at stacktrace.c:326
#2  0x000000000068a813 in handle_segfault (sig=6) at mysqld.cc:2801
#3  <signal handler called>
#4  0x0000003429230015 in raise () from /lib64/libc.so.6
#5  0x0000003429231980 in abort () from /lib64/libc.so.6
#6  0x0000003429229726 in __assert_fail () from /lib64/libc.so.6
#7  0x00000000008afc07 in ndbcluster_binlog_open_table (thd=0xdf0bd78, share=0xdec9b08, table_share=0xdeedf08, table=0xdf1cbb8, reopen=0) at ha_ndbcluster_binlog.cc:369
#8  0x00000000008b02c2 in ndbcluster_binlog_init_share (share=0xdec9b08, _table=0xdec9218) at ha_ndbcluster_binlog.cc:482
#9  0x00000000008a5523 in ndbcluster_get_share (key=0xdef6a00 "./test/t1", table=0xdec9218, create_if_not_exists=true, have_lock=false) at ha_ndbcluster.cc:8699
#10 0x00000000008ada84 in get_share (key=0xdef6a00 "./test/t1", table=0xdec9218, create_if_not_exists=true, have_lock=false) at ha_ndbcluster_binlog.h:215
#11 0x000000000089f273 in ha_ndbcluster::open (this=0xdeb5cc8, name=0xdef6a00 "./test/t1", mode=2, test_if_locked=2) at ha_ndbcluster.cc:6634
#12 0x00000000007b985e in handler::ha_open (this=0xdeb5cc8, table_arg=0xdec9218, name=0xdef6a00 "./test/t1", mode=2, test_if_locked=2) at handler.cc:2126
#13 0x0000000000707508 in open_table_from_share (thd=0xdf0bd78, share=0xdef6698, alias=0xdecf7d0 "t1", db_stat=39, prgflag=44, ha_open_flags=0, outparam=0xdec9218, is_create_table=false) at table.cc:1943
#14 0x00000000006f353b in open_table (thd=0xdf0bd78, table_list=0xdecf7d8, mem_root=0x465a0ff0, ot_ctx=0x465a0fb0) at sql_base.cc:3016
#15 0x00000000006f5c98 in open_and_process_table (thd=0xdf0bd78, lex=0xdf0d668, tables=0xdecf7d8, counter=0x465a10f4, flags=0, prelocking_strategy=0x465a1140, has_prelocking_list=false, 
    ot_ctx=0x465a0fb0, new_frm_mem=0x465a0ff0) at sql_base.cc:4400
#16 0x00000000006f67db in open_tables (thd=0xdf0bd78, start=0x465a10c0, counter=0x465a10f4, flags=0, prelocking_strategy=0x465a1140) at sql_base.cc:4805
#17 0x00000000006f75e8 in open_and_lock_tables (thd=0xdf0bd78, tables=0xdecf7d8, derived=true, flags=0, prelocking_strategy=0x465a1140) at sql_base.cc:5388
#18 0x00000000006aaf50 in open_and_lock_tables (thd=0xdf0bd78, tables=0xdecf7d8, derived=true, flags=0) at ../../sql/sql_base.h:440
#19 0x0000000000741049 in mysql_insert (thd=0xdf0bd78, table_list=0xdecf7d8, fields=@0xdf0e1d8, values_list=@0xdf0e220, update_fields=@0xdf0e208, update_values=@0xdf0e1f0, duplic=DUP_ERROR, ignore=false)
    at sql_insert.cc:661
#20 0x000000000069f3a7 in mysql_execute_command (thd=0xdf0bd78) at sql_parse.cc:3265
#21 0x00000000006a67fe in mysql_parse (thd=0xdf0bd78, inBuf=0xdecf6f8 "insert into t1 values(1)", length=24, parser_state=0x465a2940) at sql_parse.cc:5918
#22 0x000000000069a338 in dispatch_command (command=COM_QUERY, thd=0xdf0bd78, packet=0xdecb6a9 "insert into t1 values(1)", packet_length=24) at sql_parse.cc:1136
#23 0x000000000069959d in do_command (thd=0xdf0bd78) at sql_parse.cc:808
#24 0x000000000069771e in do_handle_one_connection (thd_arg=0xdf0bd78) at sql_connect.cc:1196
#25 0x00000000006975ca in handle_one_connection (arg=0xdf0bd78) at sql_connect.cc:1135
#26 0x0000000000b4f6e8 in pfs_spawn_thread (arg=0xde9e8b8) at pfs.cc:1015
#27 0x0000003429e061b5 in start_thread () from /lib64/libpthread.so.0
#28 0x00000034292cd39d in clone () from /lib64/libc.so.6
#29 0x0000000000000000 in ?? ()