Bug #75227 Assertion `thd->killed != THD::KILL_BAD_DATA || error > 0' failed
Submitted: 16 Dec 2014 5:41 Modified: 25 Nov 2019 21:48
Reporter: Ramesh Sivaraman (OCA) Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server: DML Severity:S3 (Non-critical)
Version:5.6.21, 5.6.23 OS:Linux (CentOS 7)
Assigned to: CPU Architecture:Any
Tags: debug

[16 Dec 2014 5:41] Ramesh Sivaraman
Description:
mysqld: /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_insert.cc:1159: bool mysql_insert(THD*, TABLE_LIST*, List<Item>&, List<List<Item> >&, List<Item>&
, List<Item>&, enum_duplicates, bool): Assertion `thd->killed != THD::KILL_BAD_DATA || error > 0' failed.
05:33:08 UTC - mysqld got signal 6 ;

** GDB info

+bt
#0  0x00007f556e624771 in pthread_kill () from /lib64/libpthread.so.0
#1  0x0000000000a954ea in my_write_core (sig=6) at /ssd/ramesh/mysql-server/mysql-5.6/mysys/stacktrace.c:422
#2  0x0000000000726494 in handle_fatal_signal (sig=6) at /ssd/ramesh/mysql-server/mysql-5.6/sql/signal_handler.cc:230
#3  <signal handler called>
#4  0x00007f556d4305c9 in raise () from /lib64/libc.so.6
#5  0x00007f556d431cd8 in abort () from /lib64/libc.so.6
#6  0x00007f556d429536 in __assert_fail_base () from /lib64/libc.so.6
#7  0x00007f556d4295e2 in __assert_fail () from /lib64/libc.so.6
#8  0x00000000007b2431 in mysql_insert (thd=0x7f54db35f000, table_list=0x7f54d181f0f8, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_ERROR, ignore=false) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_insert.cc:1159
#9  0x00000000007d43b7 in mysql_execute_command (thd=0x7f54db35f000) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_parse.cc:3443
#10 0x00000000007dbdbc in mysql_parse (thd=0x7f54db35f000, rawbuf=0x7f54d181f010 "INSERT INTO t1 VALUES('')", length=25, parser_state=0x7f556ebd9e70) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_parse.cc:6245
#11 0x00000000007cf36f in dispatch_command (command=COM_QUERY, thd=0x7f54db35f000, packet=0x7f54cfe75001 "INSERT INTO t1 VALUES('')", packet_length=25) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_parse.cc:1332
#12 0x00000000007ce45e in do_command (thd=0x7f54db35f000) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_parse.cc:1034
#13 0x0000000000796879 in do_handle_one_connection (thd_arg=0x7f54db35f000) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_connect.cc:982
#14 0x0000000000796362 in handle_one_connection (arg=0x7f54db35f000) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_connect.cc:898
#15 0x0000000000d71288 in pfs_spawn_thread (arg=0x7f5567f3e2e0) at /ssd/ramesh/mysql-server/mysql-5.6/storage/perfschema/pfs.cc:1860
#16 0x00007f556e61fdf3 in start_thread () from /lib64/libpthread.so.0
#17 0x00007f556d4f101d in clone () from /lib64/libc.so.6
(gdb) +set logging off

How to repeat:
** Startup parameters.

--plugin-load=audit_log=audit_log.so  --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

*** Testcase

DROP DATABASE test;CREATE DATABASE test;USE test;
set sql_mode=4194304;
create table t1(a int unsigned)partition by hash(a div 2) partitions 4;
ALTER TABLE t1 MODIFY a CHAR(1);
INSERT INTO t1 VALUES('');
[16 Dec 2014 9:28] Umesh Shastry
Hello Ramesh Sivaraman,

Thank you for the report and test case.
Confirmed that latest 5.6.23 debug build asserts.

Thanks,
Umesh
[16 Dec 2014 9:29] Umesh Shastry
// 5.6.23 debug build

scripts/mysql_install_db --basedir=/export/umesh/mysql-5.6.23 --datadir=/export/umesh/mysql-5.6.23/75227
bin/mysqld-debug --basedir=/export/umesh/mysql-5.6.23 --datadir=/export/umesh/mysql-5.6.23/75227 --core-file --socket=/tmp/75227.sock  --port=15000 --log-error=/export/umesh/mysql-5.6.23/75227/log.err --plugin-load=audit_log=audit_log.so  --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: df34098068ae4a07f245ad13a4819ca01bde71df
date: 2014-11-18 09:54:31 +0530
build-date: 2014-11-18 18:01:47 +0100
short: df34098
branch: mysql-5.6

MySQL source 5.6.23

(gdb) bt
#0  0x00007f9854a0b771 in pthread_kill () from /lib64/libpthread.so.0
#1  0x0000000000b0070b in my_write_core (sig=6) at /pb2/build/sb_0-13700644-1416330726.69/mysqlcom-pro-5.6.23/mysys/stacktrace.c:422
#2  0x000000000077ec8c in handle_fatal_signal (sig=6) at /pb2/build/sb_0-13700644-1416330726.69/mysqlcom-pro-5.6.23/sql/signal_handler.cc:230
#3  <signal handler called>
#4  0x00007f98536115c9 in raise () from /lib64/libc.so.6
#5  0x00007f9853612cd8 in abort () from /lib64/libc.so.6
#6  0x00007f985360a536 in __assert_fail_base () from /lib64/libc.so.6
#7  0x00007f985360a5e2 in __assert_fail () from /lib64/libc.so.6
#8  0x000000000080d43c in mysql_insert (thd=0x22cffc0, table_list=0x7f97fc0050b8, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_ERROR, ignore=false)
    at /pb2/build/sb_0-13700644-1416330726.69/mysqlcom-pro-5.6.23/sql/sql_insert.cc:1159
#9  0x000000000082fe15 in mysql_execute_command (thd=0x22cffc0) at /pb2/build/sb_0-13700644-1416330726.69/mysqlcom-pro-5.6.23/sql/sql_parse.cc:3443
#10 0x0000000000838085 in mysql_parse (thd=0x22cffc0, rawbuf=0x7f97fc004fd0 "INSERT INTO t1 VALUES('')", length=25, parser_state=0x7f982a393700)
    at /pb2/build/sb_0-13700644-1416330726.69/mysqlcom-pro-5.6.23/sql/sql_parse.cc:6357
#11 0x000000000082aa07 in dispatch_command (command=COM_QUERY, thd=0x22cffc0, packet=0x23b35e1 "INSERT INTO t1 VALUES('')", packet_length=25)
    at /pb2/build/sb_0-13700644-1416330726.69/mysqlcom-pro-5.6.23/sql/sql_parse.cc:1332
#12 0x0000000000829a6c in do_command (thd=0x22cffc0) at /pb2/build/sb_0-13700644-1416330726.69/mysqlcom-pro-5.6.23/sql/sql_parse.cc:1034
#13 0x00000000007f0e5f in do_handle_one_connection (thd_arg=0x22cffc0) at /pb2/build/sb_0-13700644-1416330726.69/mysqlcom-pro-5.6.23/sql/sql_connect.cc:982
#14 0x00000000007f0930 in handle_one_connection (arg=0x22cffc0) at /pb2/build/sb_0-13700644-1416330726.69/mysqlcom-pro-5.6.23/sql/sql_connect.cc:898
#15 0x0000000000e652e1 in pfs_spawn_thread (arg=0x23201d0) at /pb2/build/sb_0-13700644-1416330726.69/mysqlcom-pro-5.6.23/storage/perfschema/pfs.cc:1860
#16 0x00007f9854a06df3 in start_thread () from /lib64/libpthread.so.0
#17 0x00007f98536d247d in clone () from /lib64/libc.so.6
[16 Dec 2014 9:35] Umesh Shastry
// 5.7.6 didn't assert

bin/mysql_install_db --basedir=/export/umesh/mysql-5.7.6 --datadir=/export/umesh/mysql-5.7.6/75227 -v
bin/mysqld-debug --basedir=/export/umesh/mysql-5.7.6 --datadir=/export/umesh/mysql-5.7.6/75227 --core-file --socket=/tmp/75227.sock  --port=15000 --log-error=/export/umesh/mysql-5.7.6/75227/log.err --plugin-load=audit_log=audit_log.so  --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 --server_id=1 2>&1 &

// build used

commit: 1982dd7ab813e3cdb28d3bb119cc7b706cf01b15
date: 2014-11-27 13:27:39 +0300
build-date: 2014-11-27 12:38:45 +0100
short: 1982dd7
branch: mysql-trunk

MySQL source 5.7.6