Bug #40646 mysqld core in NdbDictionary::Column::getAttrId
Submitted: 11 Nov 2008 17:38 Modified: 24 Feb 2009 22:20
Reporter: Jonathan Miller Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Replication Severity:S1 (Critical)
Version:mysql5.1-telco-6.4 (debug) OS:Linux
Assigned to: Jonathan Miller CPU Architecture:Any

[11 Nov 2008 17:38] Jonathan Miller
Description:
Program terminated with signal 11, Segmentation fault.
#0  0x0000003907e0b142 in pthread_kill () from /lib64/libpthread.so.0
(gdb) bt
#0  0x0000003907e0b142 in pthread_kill () from /lib64/libpthread.so.0
#1  0x000000000062e871 in handle_segfault (sig=11) at mysqld.cc:2509
#2  <signal handler called>
#3  NdbDictionary::Column::getAttrId (this=0x0) at NdbDictionary.cpp:361
#4  0x0000000000938126 in NdbDictionaryImpl::createRecord (this=0xcfed2e8,
    table=0xcff64d0, recSpec=0x414b5fd0, length=2, elemSize=1, flags=2,
    defaultRecord=false) at NdbDictionaryImpl.cpp:6072
#5  0x0000000000932eb8 in NdbDictionary::Dictionary::createRecord (this=0xcfed2e8,
    table=<value optimized out>, recSpec=0x414b5fd0, length=2, elemSize=24, flags=2)
    at NdbDictionary.cpp:2170
#6  0x00000000007bdd85 in ha_ndbcluster::add_table_ndb_record (this=0xd029b20,
    dict=0xcfed2e8) at ha_ndbcluster.cc:1673
#7  0x00000000007be7c1 in ha_ndbcluster::get_metadata (this=0xd029b20,
    thd=0x2aaaac009c90, path=<value optimized out>) at ha_ndbcluster.cc:1389
#8  0x00000000007c2c02 in ha_ndbcluster::open (this=0xd029b20,
    name=0xcff6450 "./test/t1", mode=<value optimized out>,
    test_if_locked=<value optimized out>) at ha_ndbcluster.cc:7882
#9  0x00000000007212fe in handler::ha_open (this=0x0,
    table_arg=<value optimized out>, name=0xcff6450 "./test/t1", mode=2,
    test_if_locked=1) at handler.cc:2036
#10 0x000000000068a2b1 in open_table_from_share (thd=0x2aaaac009c90,
    share=0xcff60f0, alias=<value optimized out>, db_stat=0,
    prgflag=<value optimized out>, ha_open_flags=0, outparam=0x414b70f0,
    open_mode=OTM_OPEN) at table.cc:1914
#11 0x0000000000682797 in open_unireg_entry (thd=0x2aaaac009c90, entry=0x414b70f0,
    table_list=0x414b7980, alias=0xcfface0 "t1", cache_key=0xd021d78 "test",
    cache_key_length=8, mem_root=0x2aaaac00c528, flags=0) at sql_base.cc:3892
#12 0x0000000000683008 in reopen_table (table=0xcff8d90) at sql_base.cc:3041
#13 0x000000000073888f in mysql_fast_or_online_alter_table (thd=0x2aaaac009c90,
    table=0xcff8d90, altered_table=0xd01ff70, create_info=0x414b9e20,
    alter_info=0x414b8cd0, ha_alter_flags=0x414b8d00, keys_onoff=LEAVE_AS_IS)
    at sql_table.cc:5986
#14 0x000000000073e209 in mysql_alter_table (thd=0x2aaaac009c90,
    new_db=0xcfb1048 "test", new_name=0xcfb0cd8 "t1", create_info=0x414b9e20,
---Type <return> to continue, or q <return> to quit---
    table_list=0xcfb0d10, alter_info=0x414b9f00, order_num=0, order=0x0,
    ignore=false) at sql_table.cc:7048
#15 0x000000000063e747 in mysql_execute_command (thd=0x2aaaac009c90)
    at sql_parse.cc:2752
#16 0x0000000000644e32 in mysql_parse (thd=0x2aaaac009c90,
    inBuf=0xcfb0c30 "alter table t1 add (b int)", length=26,
    found_semicolon=0x414bae48) at sql_parse.cc:5730
#17 0x0000000000645217 in dispatch_command (command=COM_QUERY, thd=0x2aaaac009c90,
    packet=<value optimized out>, packet_length=<value optimized out>)
    at sql_parse.cc:1152
#18 0x0000000000646326 in do_command (thd=0x2aaaac009c90) at sql_parse.cc:809
#19 0x0000000000636d3c in handle_one_connection (arg=0x2aaaac009c90)
    at sql_connect.cc:1115
#20 0x0000003907e06307 in start_thread () from /lib64/libpthread.so.0
#21 0x00000039072d1ded in clone () from /lib64/libc.so.6
(gdb) f 3
#3  NdbDictionary::Column::getAttrId (this=0x0) at NdbDictionary.cpp:361
361     NdbDictionary::Column::getAttrId() const {
(gdb) l
356     NdbDictionary::Column::getColumnNo() const {
357       return m_impl.m_column_no;
358     }
359
360     int
361     NdbDictionary::Column::getAttrId() const {
362       return m_impl.m_attrId;;
363     }
364
365     bool
(gdb) f 2
#2  <signal handler called>
(gdb) l
366     NdbDictionary::Column::equal(const NdbDictionary::Column & col) const {
367       return m_impl.equal(col.m_impl);
368     }
369
370     int
371     NdbDictionary::Column::getSizeInBytes() const
372     {
373       return m_impl.m_attrSize * m_impl.m_arraySize;
374     }
375
(gdb)

How to repeat:
ndb_binlog_basic and ndb_binlog_multi both test the epoch stuff.

Standalone

alias runtest='MYSQL_DUMP='\''../client/mysqldump --no-defaults -uroot
--socket=var/tmp/master.sock'\''
MYSQL_DUMP_SLAVE='\''../client/mysqldump --no-defaults -uroot
--socket=var/tmp/slave.sock'\'' NDB_TOOLS_DIR=../storage/ndb/tools
NDB_TOOLS_OUTPUT=`pwd`/var/log/ndb_tools.log
NDB_BACKUP_DIR=`pwd`/var/ndbcluster-9311 NDBCLUSTER_PORT=9311
NDBCLUSTER_PORT_SLAVE=9312 MASTER_MYPORT=9306 MASTER_MYPORT1=9307
SLAVE_MYPORT=9308 NDB_EXTRA_TEST=1 NDB_STATUS_OK=1
NDB_MGM=../storage/ndb/src/mgmclient/ndb_mgm ../client/mysqltest -D test
-u root --socket=var/tmp/master.sock'

runtest < x.test

distributed

a.sh
. /space/cluster_rep_auto/cr-autotest.conf
alias runtest='MYSQL_DUMP='\''$MYSQLDUMP --no-defaults -uroot
--host=$MASTER --port=$MASTER_PORT'\''
MYSQL_DUMP_SLAVE='\''$MYSQLDUMP --no-defaults -uroot
--host=$SLAVE --port=$SLAVE_PORT'\'' NDB_TOOLS_DIR=/space/tools
NDB_TOOLS_OUTPUT=$TEST_TMP_DIR/ndb_tools.log
NDB_BACKUP_DIR=$TEST_TMP_DIR NDBCLUSTER_PORT=$NDB_MASTER_PORT
NDBCLUSTER_PORT_SLAVE=$NDB_SLAVE_PORT MASTER_MYPORT=$MASTER_PORT
MASTER_MYPORT1=$MASTER_PORT
SLAVE_MYPORT=$SLAVE_PORT NDB_EXTRA_TEST=1 NDB_STATUS_OK=1
NDB_MGM=$NDB_MGM $INSTALL_BIN_DIR/mysqltest -D test --host=$MASTER --port=$MASTER_PORT'

runtest < /data0/cr_autotest/mysql-test/suite/ndb_binlog/t/ndb_binlog_basic.test
runtest < /data0/cr_autotest/mysql-test/suite/ndb_binlog/t/ndb_binlog_multi.test
[11 Nov 2008 22:11] Jonathan Miller
mysqltest: At line 28: query 'alter table t1 add (b int)' failed: 2013: Lost connection to MySQL server during query

ndb_binlog_basic.test
[23 Feb 2009 11:38] Jonas Oreland
my guess is that this is same as http://bugs.mysql.com/bug.php?id=41905
therefor updating status on this (also) to QA testing
[24 Feb 2009 22:20] Jonathan Miller
Tests pass in latest clone