Bug #48747 Segmentation fault due to MDL in 5.1-rep+3
Submitted: 13 Nov 2009 1:10 Modified: 7 Mar 2010 18:46
Reporter: Alfranio Junior Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Locking Severity:S2 (Serious)
Version:5.1-rep+3 OS:Any
Assigned to: CPU Architecture:Any
Tags: locking, mdl, segmentation fault

[13 Nov 2009 1:10] Alfranio Junior
Description:
Segmentation fault while executing RQG against mysql-5.1-rep+3:

# 01:01:33 #0  0xb7f73430 in __kernel_vsyscall ()
# 01:01:33 #1  0xb7f34158 in pthread_kill () from /lib/tls/i686/cmov/libpthread.so.0
# 01:01:33 #2  0x0874b885 in my_write_core (sig=11) at stacktrace.c:310
# 01:01:33 #3  0x082c9611 in handle_segfault (sig=11) at mysqld.cc:2576
# 01:01:33 #4  <signal handler called>
# 01:01:33 #5  0x0861ab23 in mi_get_status (param=0xa6c62f0, concurrent_insert=0) at mi_locking.c:287
# 01:01:33 #6  0x08755153 in thr_lock (data=0xa6c6520, owner=0xa19d764, lock_type=TL_WRITE) at thr_lock.c:701
# 01:01:33 #7  0x08755c7a in thr_multi_lock (data=0xb1d0011c, count=55, owner=0xa19d764) at thr_lock.c:995
# 01:01:33 #8  0x082c0118 in mysql_lock_tables (thd=0xa19cf40, tables=0xb241f870, count=37, flags=4, need_reopen=0xb368be87) at lock.cc:279
# 01:01:33 #9  0x08328fab in lock_tables (thd=0xa19cf40, tables=0xa203e18, count=37, need_reopen=0xb368be87) at sql_base.cc:5150
# 01:01:33 #10 0x08333b7c in open_and_lock_tables_derived (thd=0xa19cf40, tables=0xa203e18, derived=true) at sql_base.cc:4993
# 01:01:33 #11 0x082e9191 in open_and_lock_tables (thd=0xa19cf40, tables=0xa203e18) at mysql_priv.h:1469
# 01:01:33 #12 0x0837933a in mysql_insert (thd=0xa19cf40, table_list=0xa203e18, fields=@0xa19e58c, values_list=@0xa19e5b0, update_fields=@0xa19e5a4,
# 01:01:33     update_values=@0xa19e598, duplic=DUP_ERROR, ignore=false) at sql_insert.cc:611
# 01:01:33 #13 0x082df396 in mysql_execute_command (thd=0xa19cf40) at sql_parse.cc:3173
# 01:01:33 #14 0x082e5fe1 in mysql_parse (thd=0xa19cf40, inBuf=0xa203c58 "INSERT INTO `table0_key_pk_parts_2_int_autoinc` ( `int_not_null` ) VALUES ( NULL )",
# 01:01:33     length=82, found_semicolon=0xb368d090) at sql_parse.cc:5967
# 01:01:33 #15 0x082e6dc5 in dispatch_command (command=COM_QUERY, thd=0xa19cf40,
# 01:01:33     packet=0xa19ff79 " INSERT INTO `table0_key_pk_parts_2_int_autoinc` ( `int_not_null` ) VALUES ( NULL ) ", packet_length=84) at sql_parse.cc:1225
# 01:01:33 #16 0x082e8340 in do_command (thd=0xa19cf40) at sql_parse.cc:866
# 01:01:33 #17 0x082d3397 in handle_one_connection (arg=0xa19cf40) at sql_connect.cc:1127
# 01:01:33 #18 0xb7f2f50f in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
# 01:01:33 #19 0xb7e20a0e in clone () from /lib/tls/i686/cmov/libc.so.6
# 01:01:33 Test completed with failure status 101.
# 01:01:33 gentest.pl exited with exit status 101

How to repeat:
perl runall.pl --basedir=/export/home/tmp/mysql5.1/mysql-5.1/
--grammar=/export/home/tmp/RQG/mysql-test-extra-6.0/mysql-test/gentest/conf/replication.yy
--gendata=/export/home/tmp/RQG/mysql-test-extra-6.0/mysql-test/gentest/conf/replication_single_engine.zz --rpl_mode=row

Please, change the configuration files as follows:

=== modified file 'conf/replication.yy'
--- conf/replication.yy 2009-07-24 10:55:17 +0000
+++ conf/replication.yy 2009-11-10 23:38:53 +0000
@@ -81,7 +81,7 @@
        binlog_format_row ; delete ; binlog_format_restore ;

 binlog_format_statement:
-       SET @binlog_format_saved = @@binlog_format ; SET BINLOG_FORMAT = 'STATEMENT' ;
+       SET @binlog_format_saved = @@binlog_format ; SET BINLOG_FORMAT = 'ROW' ;

 binlog_format_row:
        SET @binlog_format_saved = @@binlog_format ; SET BINLOG_FORMAT = 'ROW' ;

=== modified file 'conf/replication_single_engine.zz'
--- conf/replication_single_engine.zz   2009-10-27 11:24:57 +0000
+++ conf/replication_single_engine.zz   2009-11-10 23:40:52 +0000
@@ -1,7 +1,8 @@
 $tables = {
         rows => [0, 1, 10, 100],
         partitions => [ undef , 'KEY (pk) PARTITIONS 2' ],
-       pk => [ undef, 'int auto_increment' ]
+       pk => [ 'int auto_increment' ]
+       #pk => [ undef, 'int auto_increment' ]
 };

 $fields = {
[7 Mar 2010 18:46] Philip Stoev
Duplicate of bug #45603.

Please re-open if you still observe it after you have merged in the fix for bug #45603.