Failing assertion: mode != LOCK_X || lock_table_has(thr_get_trx(thr), index->table, LOCK_IX) in

Bug #1395579 reported by Ramesh Sivaraman on 2014-11-24
44
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Fix Released
Medium
Krunal Bauskar
5.1
Won't Fix
Undecided
Unassigned
5.5
Fix Released
Medium
Krunal Bauskar
5.6
Fix Released
Medium
Krunal Bauskar

Bug Description

***** Testcase (Only with debug build)

DROP DATABASE test;CREATE DATABASE test;USE test;
CREATE TABLE t1(c1 DOUBLE,c2 CHAR (1),c3 INT(1),c4 CHAR (1) KEY,c5 DOUBLE UNIQUE KEY,c6 FIXED(0,0) DEFAULT 3.141592);
INSERT INTO t1(c1)VALUES(0);
SET innodb_fake_changes=1;
XA START'';
insert INTO t1 select * FROM t1;
SET innodb_fake_changes=0;
REPLACE INTO t1(c1,c2)VALUES(0,0),(0,0);

**** GDB info

#0 0x00007fe21aad5771 in pthread_kill () from /lib64/libpthread.so.0
#1 0x0000000000ab7e66 in my_write_core (sig=6) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.21-7
0.0/mysys/stacktrace.c:422
#2 0x000000000072fcd3 in handle_fatal_signal (sig=6) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.
6.21-70.0/sql/signal_handler.cc:236
#3 <signal handler called>
#4 0x00007fe2196d95c9 in raise () from /lib64/libc.so.6
#5 0x00007fe2196dacd8 in abort () from /lib64/libc.so.6
#6 0x0000000000b34e42 in lock_clust_rec_read_check_and_lock (flags=0, block=0x7fe198fff218, rec=0x7fe1a8fec07f "", index=0x7fe15cc6cff8, offsets=0x7f
e21b089b40, mode=LOCK_X, gap_mode=1024, thr=0x7fe15cc798d0) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-ser
ver-5.6.21-70.0/storage/innobase/lock/lock0lock.cc:6451
#7 0x0000000000bbe797 in row_ins_set_exclusive_rec_lock (type=1024, block=0x7fe198fff218, rec=0x7fe1a8fec07f "", index=0x7fe15cc6cff8, offsets=0x7fe2
1b089b40, thr=0x7fe15cc798d0) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.21-70.0/storage/innoba
se/row/row0ins.cc:1385
#8 0x0000000000bbfd37 in row_ins_duplicate_error_in_clust (flags=0, cursor=0x7fe21b089f00, entry=0x7fe15cc6c0f8, thr=0x7fe15cc798d0, mtr=0x7fe21b089f80) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.21-70.0/storage/innobase/row/row0ins.cc:2190
#9 0x0000000000bc03e8 in row_ins_clust_index_entry_low (flags=0, mode=2, index=0x7fe15cc6cff8, n_uniq=1, entry=0x7fe15cc6c0f8, n_ext=0, thr=0x7fe15cc798d0) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.21-70.0/storage/innobase/row/row0ins.cc:2398
#10 0x0000000000bc169b in row_ins_clust_index_entry (index=0x7fe15cc6cff8, entry=0x7fe15cc6c0f8, thr=0x7fe15cc798d0, n_ext=0) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.21-70.0/storage/innobase/row/row0ins.cc:2897
#11 0x0000000000bc199b in row_ins_index_entry (index=0x7fe15cc6cff8, entry=0x7fe15cc6c0f8, thr=0x7fe15cc798d0) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.21-70.0/storage/innobase/row/row0ins.cc:2995
#12 0x0000000000bc1c7c in row_ins_index_entry_step (node=0x7fe15cc79620, thr=0x7fe15cc798d0) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.21-70.0/storage/innobase/row/row0ins.cc:3072
#13 0x0000000000bc1f80 in row_ins (node=0x7fe15cc79620, thr=0x7fe15cc798d0) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.21-70.0/storage/innobase/row/row0ins.cc:3212
#14 0x0000000000bc2305 in row_ins_step (thr=0x7fe15cc798d0) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.21-70.0/storage/innobase/row/row0ins.cc:3337
#15 0x0000000000bda66e in row_insert_for_mysql (mysql_rec=0x7fe15cc9c010 <incomplete sequence \354>, prebuilt=0x7fe15cc79078) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.21-70.0/storage/innobase/row/row0mysql.cc:1367
#16 0x0000000000ad7345 in ha_innobase::write_row (this=0x7fe15ccab510, record=0x7fe15cc9c010 <incomplete sequence \354>) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.21-70.0/storage/innobase/handler/ha_innodb.cc:7296
#17 0x000000000064cc73 in handler::ha_write_row (this=0x7fe15ccab510, buf=0x7fe15cc9c010 <incomplete sequence \354>) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.21-70.0/sql/handler.cc:7659
#18 0x00000000007c4339 in write_record (thd=0x7fe17a23a000, table=0x7fe15cc52600, info=0x7fe21b08a970, update=0x7fe21b08a9f0) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.21-70.0/sql/sql_insert.cc:1680
#19 0x00000000007c221c in mysql_insert (thd=0x7fe17a23a000, table_list=0x7fe15cc1f110, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_REPLACE, ignore=false) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.21-70.0/sql/sql_insert.cc:1085
#20 0x00000000007e556f in mysql_execute_command (thd=0x7fe17a23a000) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.21-70.0/sql/sql_parse.cc:3855
#21 0x00000000007ed49f in mysql_parse (thd=0x7fe17a23a000, rawbuf=0x7fe15cc1f010 "REPLACE INTO t1(c1,c2)VALUES(0,0),(0,0)", length=39, parser_state=0x7fe21b08bdf0) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.21-70.0/sql/sql_parse.cc:6777
#22 0x00000000007df8be in dispatch_command (command=COM_QUERY, thd=0x7fe17a23a000, packet=0x7fe179e91001 "REPLACE INTO t1(c1,c2)VALUES(0,0),(0,0)", packet_length=39) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.21-70.0/sql/sql_parse.cc:1432
#23 0x00000000007de7dc in do_command (thd=0x7fe17a23a000) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.21-70.0/sql/sql_parse.cc:1049
#24 0x00000000007a6785 in do_handle_one_connection (thd_arg=0x7fe17a23a000) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.21-70.0/sql/sql_connect.cc:1532
#25 0x00000000007a628d in handle_one_connection (arg=0x7fe17a23a000) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.21-70.0/sql/sql_connect.cc:1443
#26 0x0000000000dc648c in pfs_spawn_thread (arg=0x7fe214348ce0) at /mnt/workspace/percona-server-5.6-binaries-debug-yassl/label_exp/centos6-64/percona-server-5.6.21-70.0/storage/perfschema/pfs.cc:1860
#27 0x00007fe21aad0df3 in start_thread () from /lib64/libpthread.so.0
#28 0x00007fe21979a01d in clone () from /lib64/libc.so.6

*** Error info

2014-11-24 04:16:20 19017 [Note] Event Scheduler: scheduler thread started with id 1
2014-11-24 04:16:28 7fe21b08d700 InnoDB: Assertion failure in thread 140609092900608 in file lock0lock.cc line 6452
InnoDB: Failing assertion: mode != LOCK_X || lock_table_has(thr_get_trx(thr), index->table, LOCK_IX)
InnoDB: We intentionally generate a memory trap.
[..]
stack_bottom = 7fe21b08ce18 thread_stack 0x40000
/ssd/ramesh/Percona-Server-5.6.21-rel70.0-693.Linux.x86_64-debug/bin/mysqld(my_print_stacktrace+0x35)[0xab7de4]
/ssd/ramesh/Percona-Server-5.6.21-rel70.0-693.Linux.x86_64-debug/bin/mysqld(handle_fatal_signal+0x41a)[0x72fada]
/lib64/libpthread.so.0(+0xf130)[0x7fe21aad8130]
/lib64/libc.so.6(gsignal+0x39)[0x7fe2196d95c9]
/lib64/libc.so.6(abort+0x148)[0x7fe2196dacd8]
/ssd/ramesh/Percona-Server-5.6.21-rel70.0-693.Linux.x86_64-debug/bin/mysqld[0xb34e42]
/ssd/ramesh/Percona-Server-5.6.21-rel70.0-693.Linux.x86_64-debug/bin/mysqld[0xbbe797]
/ssd/ramesh/Percona-Server-5.6.21-rel70.0-693.Linux.x86_64-debug/bin/mysqld[0xbbfd37]
/ssd/ramesh/Percona-Server-5.6.21-rel70.0-693.Linux.x86_64-debug/bin/mysqld[0xbc03e8]
/ssd/ramesh/Percona-Server-5.6.21-rel70.0-693.Linux.x86_64-debug/bin/mysqld[0xbc169b]
/ssd/ramesh/Percona-Server-5.6.21-rel70.0-693.Linux.x86_64-debug/bin/mysqld[0xbc199b]
/ssd/ramesh/Percona-Server-5.6.21-rel70.0-693.Linux.x86_64-debug/bin/mysqld[0xbc1c7c]
/ssd/ramesh/Percona-Server-5.6.21-rel70.0-693.Linux.x86_64-debug/bin/mysqld[0xbc1f80]
/ssd/ramesh/Percona-Server-5.6.21-rel70.0-693.Linux.x86_64-debug/bin/mysqld[0xbc2305]
/ssd/ramesh/Percona-Server-5.6.21-rel70.0-693.Linux.x86_64-debug/bin/mysqld[0xbda66e]
/ssd/ramesh/Percona-Server-5.6.21-rel70.0-693.Linux.x86_64-debug/bin/mysqld[0xad7345]
/ssd/ramesh/Percona-Server-5.6.21-rel70.0-693.Linux.x86_64-debug/bin/mysqld(_ZN7handler12ha_write_rowEPh+0x18f)[0x64cc73]
/ssd/ramesh/Percona-Server-5.6.21-rel70.0-693.Linux.x86_64-debug/bin/mysqld(_Z12write_recordP3THDP5TABLEP9COPY_INFOS4_+0xb84)[0x7c4339]
/ssd/ramesh/Percona-Server-5.6.21-rel70.0-693.Linux.x86_64-debug/bin/mysqld(_Z12mysql_insertP3THDP10TABLE_LISTR4ListI4ItemERS3_IS5_ES6_S6_15enum_duplicatesb+0xf7c)[0x7c221c]
/ssd/ramesh/Percona-Server-5.6.21-rel70.0-693.Linux.x86_64-debug/bin/mysqld(_Z21mysql_execute_commandP3THD+0x3260)[0x7e556f]
/ssd/ramesh/Percona-Server-5.6.21-rel70.0-693.Linux.x86_64-debug/bin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_state+0x5a6)[0x7ed49f]
/ssd/ramesh/Percona-Server-5.6.21-rel70.0-693.Linux.x86_64-debug/bin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0xc88)[0x7df8be]
/ssd/ramesh/Percona-Server-5.6.21-rel70.0-693.Linux.x86_64-debug/bin/mysqld(_Z10do_commandP3THD+0x3ac)[0x7de7dc]
/ssd/ramesh/Percona-Server-5.6.21-rel70.0-693.Linux.x86_64-debug/bin/mysqld(_Z24do_handle_one_connectionP3THD+0x1c4)[0x7a6785]
/ssd/ramesh/Percona-Server-5.6.21-rel70.0-693.Linux.x86_64-debug/bin/mysqld(handle_one_connection+0x33)[0x7a628d]
/ssd/ramesh/Percona-Server-5.6.21-rel70.0-693.Linux.x86_64-debug/bin/mysqld(pfs_spawn_thread+0x159)[0xdc648c]
/lib64/libpthread.so.0(+0x7df3)[0x7fe21aad0df3]
/lib64/libc.so.6(clone+0x6d)[0x7fe21979a01d]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7fe15cc1f010): REPLACE INTO t1(c1,c2)VALUES(0,0),(0,0)
Connection ID (thread ID): 2
Status: NOT_KILLED

tags: added: fake-changes

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-1589

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers