Bug #52431 Crash in innobase_build_index_translation on SHOW TABLE STATUS
Submitted: 29 Mar 2010 11:03 Modified: 7 Apr 2010 1:10
Reporter: Philip Stoev Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: InnoDB Plugin storage engine Severity:S2 (Serious)
Version:mysql-trunk-runtime-exp OS:Any
Assigned to: Assigned Account CPU Architecture:Any

[29 Mar 2010 11:03] Philip Stoev
Description:
When executing a RQG DDL/MDL workload, mysqld crashed as follows:

# 13:53:55 #0  0x000000315b00c216 in pthread_kill () from /lib64/libpthread.so.0
# 13:53:55 #1  0x00000000009dc963 in my_write_core (sig=11) at /1tb/bzr/mysql-trunk-runtime-exp/mysys/stacktrace.c:326
# 13:53:55 #2  0x000000000051b7aa in handle_segfault (sig=11) at /1tb/bzr/mysql-trunk-runtime-exp/sql/mysqld.cc:2751
# 13:53:55 #3  <signal handler called>
# 13:53:55 #4  0x00000000008ebc5e in innobase_build_index_translation (table=0x393b758, ib_table=0x3937238, share=0x7fe3c0067a58)
# 13:53:55     at /1tb/bzr/mysql-trunk-runtime-exp/storage/innobase/handler/ha_innodb.cc:3213
# 13:53:55 #5  0x00000000008eeba0 in ha_innobase::open (this=0x396f008, name=0x7fe3c002fe80 "./test/table0_innodb_int_autoinc", mode=2, test_if_locked=2)
# 13:53:55     at /1tb/bzr/mysql-trunk-runtime-exp/storage/innobase/handler/ha_innodb.cc:3507
# 13:53:55 #6  0x000000000070cae6 in handler::ha_open (this=0x396f008, table_arg=0x393b758, name=0x7fe3c002fe80 "./test/table0_innodb_int_autoinc", mode=2,
# 13:53:55     test_if_locked=2) at /1tb/bzr/mysql-trunk-runtime-exp/sql/handler.cc:2093
# 13:53:55 #7  0x00000000006507b2 in open_table_from_share (thd=0x39db868, share=0x7fe3c002fad8, alias=0x3942b50 "table0_innodb_int_autoinc", db_stat=39, prgflag=44,
# 13:53:55     ha_open_flags=0, outparam=0x393b758, is_create_table=false) at /1tb/bzr/mysql-trunk-runtime-exp/sql/table.cc:1916
# 13:53:55 #8  0x0000000000563c13 in open_table (thd=0x39db868, table_list=0x39367d8, mem_root=0x7fe3c78160b0, ot_ctx=0x7fe3c78160f0, flags=2050)
# 13:53:55     at /1tb/bzr/mysql-trunk-runtime-exp/sql/sql_base.cc:2916
# 13:53:55 #9  0x00000000005649c6 in open_and_process_table (thd=0x39db868, lex=0x39dd0d0, tables=0x39367d8, counter=0x7fe3c781624c, flags=2050,
# 13:53:55     prelocking_strategy=0x7fe3c78161d0, has_prelocking_list=false, ot_ctx=0x7fe3c78160f0, new_frm_mem=0x7fe3c78160b0)
# 13:53:55     at /1tb/bzr/mysql-trunk-runtime-exp/sql/sql_base.cc:4251
# 13:53:55 #10 0x00000000005651d0 in open_tables (thd=0x39db868, start=0x7fe3c7816210, counter=0x7fe3c781624c, flags=2050, prelocking_strategy=0x7fe3c78161d0)
# 13:53:55     at /1tb/bzr/mysql-trunk-runtime-exp/sql/sql_base.cc:4651
# 13:53:55 #11 0x0000000000568808 in open_tables (thd=0x39db868, tables=0x7fe3c7816210, counter=0x7fe3c781624c, flags=2050)
# 13:53:55     at /1tb/bzr/mysql-trunk-runtime-exp/sql/mysql_priv.h:1596
# 13:53:55 #12 0x0000000000565623 in open_normal_and_derived_tables (thd=0x39db868, tables=0x39367d8, flags=2050)
# 13:53:55     at /1tb/bzr/mysql-trunk-runtime-exp/sql/sql_base.cc:5268
# 13:53:55 #13 0x0000000000618e8e in get_all_tables (thd=0x39db868, tables=0x3acc498, cond=0x0) at /1tb/bzr/mysql-trunk-runtime-exp/sql/sql_show.cc:3525
# 13:53:55 #14 0x0000000000604082 in get_schema_tables_result (join=0x3935078, executed_place=PROCESSED_BY_JOIN_EXEC)
# 13:53:55     at /1tb/bzr/mysql-trunk-runtime-exp/sql/sql_show.cc:6646
# 13:53:55 #15 0x00000000005fbdac in JOIN::exec (this=0x3935078) at /1tb/bzr/mysql-trunk-runtime-exp/sql/sql_select.cc:1829
# 13:53:55 #16 0x00000000005f89c4 in mysql_select (thd=0x39db868, rref_pointer_array=0x39dd940, tables=0x3acc498, wild_num=0, fields=@0x39dd878, conds=0x0, og_num=0,
# 13:53:55     order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2684619520, result=0x3941ff0, unit=0x39dd170, select_lex=0x39dd770)
# 13:53:55     at /1tb/bzr/mysql-trunk-runtime-exp/sql/sql_select.cc:2506
# 13:53:55 #17 0x00000000005fde71 in handle_select (thd=0x39db868, lex=0x39dd0d0, result=0x3941ff0, setup_tables_done_option=0)
# 13:53:55     at /1tb/bzr/mysql-trunk-runtime-exp/sql/sql_select.cc:271
# 13:53:55 #18 0x00000000005a8554 in execute_sqlcom_select (thd=0x39db868, all_tables=0x3acc498) at /1tb/bzr/mysql-trunk-runtime-exp/sql/sql_parse.cc:4839
# 13:53:55 #19 0x00000000005aa40c in mysql_execute_command (thd=0x39db868) at /1tb/bzr/mysql-trunk-runtime-exp/sql/sql_parse.cc:2324
# 13:53:55 #20 0x00000000005b1bcb in mysql_parse (thd=0x39db868, inBuf=0x3acae98 "SHOW TABLE STATUS", length=17, found_semicolon=0x7fe3c7818ed0)
# 13:53:55     at /1tb/bzr/mysql-trunk-runtime-exp/sql/sql_parse.cc:5871
# 13:53:55 #21 0x00000000005b27e6 in dispatch_command (command=COM_QUERY, thd=0x39db868, packet=0x39e7739 "SHOW TABLE STATUS", packet_length=17)
# 13:53:55     at /1tb/bzr/mysql-trunk-runtime-exp/sql/sql_parse.cc:1023
# 13:53:55 #22 0x00000000005b3c95 in do_command (thd=0x39db868) at /1tb/bzr/mysql-trunk-runtime-exp/sql/sql_parse.cc:709
# 13:53:55 #23 0x000000000067e3fa in do_handle_one_connection (thd_arg=0x39db868) at /1tb/bzr/mysql-trunk-runtime-exp/sql/sql_connect.cc:1173
# 13:53:55 #24 0x000000000067e4c9 in handle_one_connection (arg=0x39db868) at /1tb/bzr/mysql-trunk-runtime-exp/sql/sql_connect.cc:1112
# 13:53:55 #25 0x000000315b0073da in start_thread () from /lib64/libpthread.so.0
# 13:53:55 #26 0x000000315a4e627d in clone () from /lib64/libc.so.6

(gdb) list
3208    for (ulint count = 0; count < mysql_num_index; count++) {
3209
3210            /* Fetch index pointers into index_mapping according to mysql
3211            index sequence */
3212            index_mapping[count] = dict_table_get_index_on_name(
3213                    ib_table, table->key_info[count].name);
3214
3215            if (!index_mapping[count]) {
3216                    sql_print_error("Cannot find index %s in InnoDB "
3217                                    "index dictionary.",

(gdb) print index_mapping
$1 = (dict_index_t **) 0x0

How to repeat:
The core and the binary will be provided. The RQG command line was:

# 13:49:25 # runall.pl \
# 13:49:25 # --grammar=conf/WL5004_sql.yy \
# 13:49:25 # --gendata=conf/WL5004_data.zz \
# 13:49:25 # --queries=1M \
# 13:49:25 # --duration=1200 \
# 13:49:25 # --reporters=Deadlock,ErrorLog,Backtrace,Shutdown \
# 13:49:25 # --mysqld=--innodb-lock-wait-timeout=1 \
# 13:49:25 # --mysqld=--loose-lock-wait-timeout=1 \
# 13:49:25 # --mysqld=--secure-file-priv=/tmp/ \
# 13:49:25 # --engine=Innodb \
# 13:49:25 # --rows=10 \
# 13:49:25 # --threads=4 \
# 13:49:25 # --mysqld=--transaction-isolation=READ-UNCOMMITTED \
# 13:49:25 # --mysqld=--log-output=table \
# 13:49:25 # --mysqld=--innodb_flush_log_at_trx_commit=0 \
# 13:49:25 # --mask-level=2 \
# 13:49:25 # --mysqld=--big-tables \
# 13:49:25 # --mysqld=--open_files_limit=10 \
# 13:49:25 # --mysqld=--table_cache=10 \
# 13:49:25 # --mysqld=--tmp_table_size=1K \
# 13:49:25 # --mask=62228 \
# 13:49:25 # --queries=100000000 \
# 13:49:25 # --duration=1200 \
# 13:49:25 # --basedir=/1tb/bzr/mysql-trunk-runtime-exp \
# 13:49:25 # --seed=time \
# 13:49:25 # --vardir=/1tb/vardir/experimental1/current
[29 Mar 2010 11:12] Philip Stoev
Source:

revision-id: kostja@sun.com-20100327120632-xvhcrtay402f8x52
date: 2010-03-27 15:06:32 +0300
build-date: 2010-03-29 14:10:18 +0300
revno: 3138
branch-nick: mysql-trunk-runtime-exp

Core and binary:

http://mysql-systemqa.s3.amazonaws.com/var-bug52431.zip
[7 Apr 2010 1:10] Jimmy Yang
Duplicate of bug #52580:

A recent change in bug #51557 removed the protection on ha_innobase::open with mutex LOCK_open protection. innobase_build_index_translation() in ha_innodb::open() now require native mutex protection with this LOCK_open protection gone.