Bug #39500 mysqld core in ha_ndbcluster::add_row_check_if_batch_full_size()
Submitted: 17 Sep 2008 15:35
Reporter: Jonathan Miller Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Cluster: Replication Severity:S2 (Serious)
Version:mysql-5.1-telco-6.3 OS:Linux
Assigned to: CPU Architecture:Any
Triage: Triaged: D2 (Serious) / R6 (Needs Assessment) / E6 (Needs Assessment)

[17 Sep 2008 15:35] Jonathan Miller
Description:
#0  0x0000003907e0b142 in pthread_kill () from /lib64/libpthread.so.0
#1  0x0000000000627151 in handle_segfault (sig=11) at mysqld.cc:2511
#2  <signal handler called>
#3  free_root (root=0x1974bb60, MyFlags=2) at my_alloc.c:302
#4  0x00000000007ab381 in ha_ndbcluster::add_row_check_if_batch_full_size (
    this=<value optimized out>, thd_ndb=0x1974baa0, size=76) at ha_ndbcluster.cc:870
#5  0x00000000007c0e3f in ha_ndbcluster::ndb_write_row (this=0x2aaab41094e0,
    record=0x2aaab41085d0 "´┐Żndb1812", ' ' <repeats 13 times>, primary_key_update=false,
    batched_update=false) at ha_ndbcluster.h:644
#6  0x00000000007c14f5 in ha_ndbcluster::write_row (this=0x1974bb60,
    record=0x2 <Address 0x2 out of bounds>) at ha_ndbcluster.cc:3110
#7  0x000000000071caaf in handler::ha_write_row (this=0x2aaab41094e0,
    buf=0x2aaab41085d0 "´┐Żndb1812", ' ' <repeats 13 times>) at handler.cc:4489
#8  0x00000000006aea2d in write_record (thd=0x198cdbf0, table=0x2aaab417e6b0, info=0x425edd60)
    at sql_insert.cc:1557
#9  0x00000000006b35d4 in mysql_insert (thd=0x198cdbf0, table_list=0x198142f8, fields=dwarf2_read_address: Corrupted DWARF expression.
)
    at sql_insert.cc:812
#10 0x00000000006372ac in mysql_execute_command (thd=0x198cdbf0) at sql_parse.cc:3016
#11 0x000000000063d372 in mysql_parse (thd=0x198cdbf0,
    inBuf=0x198141d0 "INSERT into trans (scriptId,startTime) VALUES('ndb1812',now())",
    length=62, found_semicolon=0x425efe48) at sql_parse.cc:5717
#12 0x000000000063d757 in dispatch_command (command=COM_QUERY, thd=0x198cdbf0,
    packet=<value optimized out>, packet_length=<value optimized out>) at sql_parse.cc:1152
#13 0x000000000063e866 in do_command (thd=0x198cdbf0) at sql_parse.cc:809
#14 0x000000000062f39c in handle_one_connection (arg=0x198cdbf0) at sql_connect.cc:1115
#15 0x0000003907e06307 in start_thread () from /lib64/libpthread.so.0
---Type <return> to continue, or q <return> to quit---f 4
#16 0x00000039072d1ded in clone () from /lib64/libc.so.6
(gdb)
(gdb) f 4
#4  0x00000000007ab381 in ha_ndbcluster::add_row_check_if_batch_full_size (
    this=<value optimized out>, thd_ndb=0x1974baa0, size=76) at ha_ndbcluster.cc:870
870         free_root(&(thd_ndb->m_batch_mem_root), MY_MARK_BLOCKS_FREE);
(gdb) l
865      */
866     bool
867     ha_ndbcluster::add_row_check_if_batch_full_size(Thd_ndb *thd_ndb, uint size)
868     {
869       if (thd_ndb->m_unsent_bytes == 0)
870         free_root(&(thd_ndb->m_batch_mem_root), MY_MARK_BLOCKS_FREE);
871
872       uint unsent= thd_ndb->m_unsent_bytes;
873       unsent+= size;
874       thd_ndb->m_unsent_bytes= unsent;
(gdb) f 3
#3  free_root (root=0x1974bb60, MyFlags=2) at my_alloc.c:302
302         next->left= next->size - ALIGN_SIZE(sizeof(USED_MEM));
Current language:  auto; currently c
(gdb) l
297       *last= next=root->used;
298
299       /* now go through the used blocks and mark them free */
300       for (; next; next= next->next)
301       {
302         next->left= next->size - ALIGN_SIZE(sizeof(USED_MEM));
303         TRASH_MEM(next);
304       }
305
306       /* Now everything is set; Indicate that nothing is used anymore */

How to repeat:
not sure, was running tpc-b and load_and_delete.pl in continues loop with following my.cnf

[atrt]
basedir=/data0/cr_autotest/run-cr-2-mysqld-mysql-5.1-telco-6.3/run
baseport=15000
clusters= .master,.slave
replicate= 1.master:1.slave

[ndb_mgmd]

[mysqld]
skip-grant-tables
skip-innodb
loose-slave-allow-batching
ndb_use_exact_count=0
loose-ndb-cluster-connection-pool=2
loose-ndb_extra_logging=9
loose-engine_condition_pushdown=1
loose-ndb_cache_check_time=1000
log-bin

[cluster_config]
NoOfReplicas = 2
DataMemory = 4000M
IndexMemory = 400M
MaxNoOfSavedMessages = 1000
NoOfFragmentLogFiles = 300
MaxNoOfConcurrentOperations = 250000
MaxNoOfLocalOperations = 275000
MaxNoOfConcurrentIndexOperations = 20000
MaxNoOfAttributes=4096
MaxNoOfOrderedIndexes=1024
MaxNoOfUniqueHashIndexes=1024
DiskPageBufferMemory=128MB
LockPagesInMainMemory=1
DiskCheckpointSpeed=16M
LogLevelStatistic=15
LogLevelError=15
LogLevelCongestion=15

[cluster_config.master]
RedoBuffer=64M
ndb_mgmd = ndb19
ndbd = ndb19,ndb19
mysqld = ndb18,ndb18
ndbapi = ndb18,ndb18

[cluster_config.ndbd.1.master]
FileSystemPath=/data1/

[cluster_config.ndbd.2.master]
FileSystemPath=/data2/

[cluster_config.slave]
RedoBuffer=64M
ndb_mgmd = ndb20
ndbd = ndb20,ndb20
mysqld = ndb20
ndbapi= ndb20,ndb20,ndb18

[cluster_config.ndbd.1.slave]
FileSystemPath=/data1/

[cluster_config.ndbd.2.slave]
FileSystemPath=/data2/