Bug #76925 handle_fatal_signal (sig=11) in ha_innobase::store_key_val_for_row
Submitted: 4 May 2015 10:37 Modified: 4 May 2015 11:18
Reporter: Ramesh Sivaraman Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DML Severity:S3 (Non-critical)
Version:5.6.23, 5.6.25 OS:Linux (CentOS 7)
Assigned to: CPU Architecture:Any
Tags: debug

[4 May 2015 10:37] Ramesh Sivaraman
Description:
#0  0x00007ffaaddd4771 in __pthread_kill (threadid=<optimized out>, signo=11) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:61
#1  0x0000000000a980a6 in my_write_core (sig=11) at /sda/mysql-server-5.6/mysys/stacktrace.c:422
#2  0x00000000007277f0 in handle_fatal_signal (sig=11) at /sda/mysql-server-5.6/sql/signal_handler.cc:230
#3  <signal handler called>
#4  0x0000000000b7c573 in ha_innobase::store_key_val_for_row (this=0x7ffa8f497c10, keynr=64, buff=0x7ffa8f498538 "", buff_len=29, record=0x7ffa8f497ed8 "\377\200") at /sda/mysql-server-5.6/storage/innobase/handler/ha_innodb.cc:5729
#5  0x0000000000b8180d in ha_innobase::position (this=0x7ffa8f497c10, record=0x7ffa8f497ed8 "\377\200") at /sda/mysql-server-5.6/storage/innobase/handler/ha_innodb.cc:8404
#6  0x0000000000998338 in JOIN_CACHE_BNL::join_matching_records (this=0x7ffa8f557f18, skip_last=false) at /sda/mysql-server-5.6/sql/sql_join_buffer.cc:1868
#7  0x0000000000997e94 in JOIN_CACHE::join_records (this=0x7ffa8f557f18, skip_last=false) at /sda/mysql-server-5.6/sql/sql_join_buffer.cc:1708
#8  0x000000000099b1c7 in JOIN_CACHE::end_send (this=0x7ffa8f557f18) at /sda/mysql-server-5.6/sql/sql_join_buffer.h:457
#9  0x00000000007a4476 in sub_select_op (join=0x7ffa8f420b68, join_tab=0x7ffa8f557aa8, end_of_records=true) at /sda/mysql-server-5.6/sql/sql_executor.cc:1053
#10 0x00000000007a45ad in sub_select (join=0x7ffa8f420b68, join_tab=0x7ffa8f5577a8, end_of_records=true) at /sda/mysql-server-5.6/sql/sql_executor.cc:1209
#11 0x00000000007a410d in do_select (join=0x7ffa8f420b68) at /sda/mysql-server-5.6/sql/sql_executor.cc:935
#12 0x00000000007a203d in JOIN::exec (this=0x7ffa8f420b68) at /sda/mysql-server-5.6/sql/sql_executor.cc:194
#13 0x00000000008027a7 in mysql_execute_select (thd=0x7ffa9d7ee000, select_lex=0x7ffa9d7f0878, free_join=true) at /sda/mysql-server-5.6/sql/sql_select.cc:1100
#14 0x0000000000802aa3 in mysql_select (thd=0x7ffa9d7ee000, tables=0x7ffa8f41f248, wild_num=0, fields=..., conds=0x7ffa8f4208f8, order=0x7ffa9d7f0a40, group=0x7ffa9d7f0978, having=0x0, select_options=2147748608, result=0x7ffa8f420b40, unit=0x7ffa9d7f0230, select_lex=0x7ffa9d7f0878) at /sda/mysql-server-5.6/sql/sql_select.cc:1221
#15 0x0000000000800b2b in handle_select (thd=0x7ffa9d7ee000, result=0x7ffa8f420b40, setup_tables_done_option=0) at /sda/mysql-server-5.6/sql/sql_select.cc:110
#16 0x00000000007da980 in execute_sqlcom_select (thd=0x7ffa9d7ee000, all_tables=0x7ffa8f41f248) at /sda/mysql-server-5.6/sql/sql_parse.cc:5103
#17 0x00000000007d3730 in mysql_execute_command (thd=0x7ffa9d7ee000) at /sda/mysql-server-5.6/sql/sql_parse.cc:2649
#18 0x00000000007dd54a in mysql_parse (thd=0x7ffa9d7ee000, rawbuf=0x7ffa8f41f010 "SELECT c1 FROM t1 WHERE c1 IN(SELECT c2 FROM t1)", length=48, parser_state=0x7ffaae38be70) at /sda/mysql-server-5.6/sql/sql_parse.cc:6357
#19 0x00000000007d06bc in dispatch_command (command=COM_QUERY, thd=0x7ffa9d7ee000, packet=0x7ffa96be1001 "", packet_length=48) at /sda/mysql-server-5.6/sql/sql_parse.cc:1332
#20 0x00000000007cf7ab in do_command (thd=0x7ffa9d7ee000) at /sda/mysql-server-5.6/sql/sql_parse.cc:1034
#21 0x0000000000797b3d in do_handle_one_connection (thd_arg=0x7ffa9d7ee000) at /sda/mysql-server-5.6/sql/sql_connect.cc:982
#22 0x0000000000797626 in handle_one_connection (arg=0x7ffa9d7ee000) at /sda/mysql-server-5.6/sql/sql_connect.cc:898
#23 0x0000000000b5d7f0 in pfs_spawn_thread (arg=0x7ffaa87fe600) at /sda/mysql-server-5.6/storage/perfschema/pfs.cc:1860
#24 0x00007ffaaddcfdf5 in start_thread (arg=0x7ffaae38d700) at pthread_create.c:308
#25 0x00007ffaacca11ad in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113
(

How to repeat:
DROP DATABASE test;CREATE DATABASE test;USE test;
CREATE TABLE t1 SELECT 100000000000000000000000000000000000000000000000000000000000000000000000000000001 AS c1;
INSERT INTO t1 VALUES();
ALTER TABLE t1 ADD UNIQUE KEY i1(c1);
ALTER TABLE t1 ADD c2 BINARY(1);
CREATE TABLE t2(a INT UNSIGNED,b INT UNSIGNED,c CHAR(1),d CHAR (1),e VARCHAR(1),f BINARY (1),g BLOB,h BLOB,id INT,KEY(b),KEY(e))ENGINE=InnoDB;
ALTER TABLE t2 CHANGE COLUMN a a CHAR(1);
SELECT c1 FROM t1 WHERE c1 IN(SELECT c2 FROM t1);

 The attached tarball gives the testcase as an exact match of our
system,
  including some handy utilities

  $ vi {epoch}_mybase # Update base path in this file (the only change
  required!). For non-binary (i.e.
non-tarball/non-build-binary-distribution) distributions please update
SOURCE_DIR location also.
  $ ./{epoch}_init # Initializes the data dir
  $ ./{epoch}_start # Starts mysqld
  $ ./{epoch}_cl # To check mysqld is up
  $ ./{epoch}_run # Run the testcase with pquery binary(produces
  output)
  $ vi /dev/shm/{epoch}/error.log.out # Verify the error log
  $ ./{epoch}_gdb # Brings you to a gdb prompt attached to correct
  mysqld
  & generated core
  $ ./{epoch}_parse_core # Create {epoch}_STD.gdb and
{epoch}_FULL.gdb;
  standard and full var gdb stack traces
  etc.
[4 May 2015 10:38] Ramesh Sivaraman
Testcase bundle

Attachment: 1430715139_bug_bundle.tar.gz (application/gzip, text), 1012.28 KiB.

[4 May 2015 11:18] MySQL Verification Team
Hello Ramesh Sivaraman,

Thank you for the report and test case.
Observed that 5.6.25 debug builds affected.

Thanks,
Umesh
[4 May 2015 11:19] MySQL Verification Team
// 5.6.25

// Start up and build details
scripts/mysql_install_db --basedir=/export/umesh/server/binaries/mysql-5.6.25 --datadir=/export/umesh/server/binaries/mysql-5.6.25/76925
bin/mysqld-debug  --no-defaults --basedir=/export/umesh/server/binaries/mysql-5.6.25 --datadir=/export/umesh/server/binaries/mysql-5.6.25/76925 --core-file --socket=/tmp/mysql_ushastry.sock  --port=15000 --log-error=/export/umesh/server/binaries/mysql-5.6.25/76925/log.err --innodb_file_per_table=1 --innodb_flush_method=O_DIRECT --log-bin=binlog --binlog_format=MIXED --event-scheduler=ON --maximum-bulk_insert_buffer_size=1M --maximum-join_buffer_size=1M --maximum-max_heap_table_size=1M --maximum-max_join_size=1M --maximum-myisam_max_sort_file_size=1M --maximum-myisam_mmap_size=1M --maximum-myisam_sort_buffer_size=1M --maximum-optimizer_trace_max_mem_size=1M --maximum-preload_buffer_size=1M --maximum-query_alloc_block_size=1M --maximum-query_prealloc_size=1M --maximum-range_alloc_block_size=1M --maximum-read_buffer_size=1M --maximum-read_rnd_buffer_size=1M --maximum-sort_buffer_size=1M --maximum-tmp_table_size=1M --maximum-transaction_alloc_block_size=1M --maximum-transaction_prealloc_size=1M --log-output=none --sql_mode=ONLY_FULL_GROUP_BY 2>&1 &

commit: 2cb773b3eaae2a452644fefd0bc683211669f9c7
date: 2015-05-01 07:15:24 +0530
build-date: 2015-05-01 04:02:35 +0200
short: 2cb773b
branch: mysql-5.6

MySQL source 5.6.25

Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `bin/mysqld-debug --no-defaults --basedir=/export/umesh/server/binaries/mysql-5.'.
Program terminated with signal 11, Segmentation fault.
#0  0x00007fe6b96ba771 in pthread_kill () from /lib64/libpthread.so.0
Missing separate debuginfos, use: debuginfo-install glibc-2.17-55.0.4.el7_0.1.x86_64 libaio-0.3.109-12.el7.x86_64 libgcc-4.8.2-16.2.el7_0.x86_64 libstdc++-4.8.2-16.2.el7_0.x86_64 nss-softokn-freebl-3.16.2-1.el7_0.x86_64
(gdb) bt
#0  0x00007fe6b96ba771 in pthread_kill () from /lib64/libpthread.so.0
#1  0x0000000000ae1aa7 in my_write_core (sig=11) at /export/home/pb2/build/sb_0-15183613-1430447075.13/mysqlcom-pro-5.6.25/mysys/stacktrace.c:422
#2  0x000000000074611e in handle_fatal_signal (sig=11) at /export/home/pb2/build/sb_0-15183613-1430447075.13/mysqlcom-pro-5.6.25/sql/signal_handler.cc:230
#3  <signal handler called>
#4  0x0000000000baa6f1 in ha_innobase::store_key_val_for_row (this=0x7fe65801e7b0, keynr=64, buff=0x7fe65801fb38 "", buff_len=29, record=0x7fe65801ea78 "\377\200")
    at /export/home/pb2/build/sb_0-15183613-1430447075.13/mysqlcom-pro-5.6.25/storage/innobase/handler/ha_innodb.cc:5717
#5  0x0000000000baaee6 in ha_innobase::position (this=0x7fe65801e7b0, record=0x7fe65801ea78 "\377\200")
    at /export/home/pb2/build/sb_0-15183613-1430447075.13/mysqlcom-pro-5.6.25/storage/innobase/handler/ha_innodb.cc:8392
#6  0x00000000009d1eb4 in JOIN_CACHE_BNL::join_matching_records (this=0x7fe6580770e8, skip_last=false)
    at /export/home/pb2/build/sb_0-15183613-1430447075.13/mysqlcom-pro-5.6.25/sql/sql_join_buffer.cc:1868
#7  0x00000000009d0b45 in JOIN_CACHE::join_records (this=0x7fe6580770e8, skip_last=false) at /export/home/pb2/build/sb_0-15183613-1430447075.13/mysqlcom-pro-5.6.25/sql/sql_join_buffer.cc:1708
#8  0x00000000009d55e2 in JOIN_CACHE::end_send (this=0x7fe6580770e8) at /export/home/pb2/build/sb_0-15183613-1430447075.13/mysqlcom-pro-5.6.25/sql/sql_join_buffer.h:457
#9  0x00000000007ce584 in sub_select_op (join=0x7fe658006b28, join_tab=0x7fe658076c78, end_of_records=true)
    at /export/home/pb2/build/sb_0-15183613-1430447075.13/mysqlcom-pro-5.6.25/sql/sql_executor.cc:1053
#10 0x00000000007ce0c1 in sub_select (join=0x7fe658006b28, join_tab=0x7fe658076978, end_of_records=true)
    at /export/home/pb2/build/sb_0-15183613-1430447075.13/mysqlcom-pro-5.6.25/sql/sql_executor.cc:1209
#11 0x00000000007cfbd5 in do_select (join=0x7fe658006b28) at /export/home/pb2/build/sb_0-15183613-1430447075.13/mysqlcom-pro-5.6.25/sql/sql_executor.cc:935
#12 0x00000000007d04b7 in JOIN::exec (this=0x7fe658006b28) at /export/home/pb2/build/sb_0-15183613-1430447075.13/mysqlcom-pro-5.6.25/sql/sql_executor.cc:194
#13 0x000000000083313a in mysql_execute_select (thd=0x3eff0c0, select_lex=0x3f01588, free_join=true)
    at /export/home/pb2/build/sb_0-15183613-1430447075.13/mysqlcom-pro-5.6.25/sql/sql_select.cc:1100
#14 0x0000000000833af9 in mysql_select (thd=0x3eff0c0, tables=0x7fe658005208, wild_num=0, fields=..., conds=0x7fe6580068b8, order=0x3f01750, group=0x3f01688, having=0x0,
    select_options=2147748608, result=0x7fe658006b00, unit=0x3f00f40, select_lex=0x3f01588) at /export/home/pb2/build/sb_0-15183613-1430447075.13/mysqlcom-pro-5.6.25/sql/sql_select.cc:1221
#15 0x0000000000833cf5 in handle_select (thd=0x3eff0c0, result=0x7fe658006b00, setup_tables_done_option=0)
    at /export/home/pb2/build/sb_0-15183613-1430447075.13/mysqlcom-pro-5.6.25/sql/sql_select.cc:110
#16 0x00000000007f9aa8 in execute_sqlcom_select (thd=0x3eff0c0, all_tables=0x7fe658005208) at /export/home/pb2/build/sb_0-15183613-1430447075.13/mysqlcom-pro-5.6.25/sql/sql_parse.cc:5134
#17 0x00000000007fafd3 in mysql_execute_command (thd=0x3eff0c0) at /export/home/pb2/build/sb_0-15183613-1430447075.13/mysqlcom-pro-5.6.25/sql/sql_parse.cc:2656
#18 0x00000000008025de in mysql_parse (thd=0x3eff0c0, rawbuf=0x7fe658004fd0 "SELECT c1 FROM t1 WHERE c1 IN(SELECT c2 FROM t1)", length=48, parser_state=0x7fe68ef30700)
    at /export/home/pb2/build/sb_0-15183613-1430447075.13/mysqlcom-pro-5.6.25/sql/sql_parse.cc:6386
#19 0x0000000000804202 in dispatch_command (command=COM_QUERY, thd=0x3eff0c0, packet=0x3fe2591 "", packet_length=48)
    at /export/home/pb2/build/sb_0-15183613-1430447075.13/mysqlcom-pro-5.6.25/sql/sql_parse.cc:1340
#20 0x0000000000805a8e in do_command (thd=0x3eff0c0) at /export/home/pb2/build/sb_0-15183613-1430447075.13/mysqlcom-pro-5.6.25/sql/sql_parse.cc:1037
#21 0x00000000007bb4c1 in do_handle_one_connection (thd_arg=0x3eff0c0) at /export/home/pb2/build/sb_0-15183613-1430447075.13/mysqlcom-pro-5.6.25/sql/sql_connect.cc:982
#22 0x00000000007bb587 in handle_one_connection (arg=0x3eff0c0) at /export/home/pb2/build/sb_0-15183613-1430447075.13/mysqlcom-pro-5.6.25/sql/sql_connect.cc:898
#23 0x0000000000b93588 in pfs_spawn_thread (arg=0x3f53700) at /export/home/pb2/build/sb_0-15183613-1430447075.13/mysqlcom-pro-5.6.25/storage/perfschema/pfs.cc:1860
#24 0x00007fe6b96b5df3 in start_thread () from /lib64/libpthread.so.0
#25 0x00007fe6b838147d in clone () from /lib64/libc.so.6
(gdb)