Bug #87576 Assertion `bitmap_is _clear_all(&table->tmp_set)' failed
Submitted: 29 Aug 2017 9:48 Modified: 29 Aug 2017 10:08
Reporter: Ramesh Sivaraman Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:5.7.19 OS:Ubuntu
Assigned to: CPU Architecture:Any
Tags: debug

[29 Aug 2017 9:48] Ramesh Sivaraman
Description:
mysqld: /qa/mytest/mysql-server_dbg/sql/binlog.cc:11348: void THD::binlog_prepare_row_images(TABLE*): Assertion `bitmap_is
_clear_all(&table->tmp_set)' failed.
09:41:39 UTC - mysqld got signal 6 ;

GDB info.

#0  __pthread_kill (threadid=<optimized out>, signo=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:62
#1  0x000000000196f4be in my_write_core (sig=6) at /qa/mytest/mysql-server_dbg/mysys/stacktrace.c:249
#2  0x0000000000f09901 in handle_fatal_signal (sig=6) at /qa/mytest/mysql-server_dbg/sql/signal_handler.cc:220
#3  <signal handler called>
#4  0x00007f16826d8428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
#5  0x00007f16826da02a in __GI_abort () at abort.c:89
#6  0x00007f16826d0bd7 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x21de0c0 "bitmap_is_clear_all(&table->tmp_set)", file=file@entry=0x21d8738 "/qa/mytest/mysql-server_dbg/sql/binlog.cc", line=line@entry=11348, function=function@entry=0x21e0880 <THD::binlog_prepare_row_images(TABLE*)::__PRETTY_FUNCTION__> "void THD::binlog_prepare_row_images(TABLE*)") at assert.c:92
#7  0x00007f16826d0c82 in __GI___assert_fail (assertion=0x21de0c0 "bitmap_is_clear_all(&table->tmp_set)", file=0x21d8738 "/qa/mytest/mysql-server_dbg/sql/binlog.cc", line=11348, function=0x21e0880 <THD::binlog_prepare_row_images(TABLE*)::__PRETTY_FUNCTION__> "void THD::binlog_prepare_row_images(TABLE*)") at assert.c:101
#8  0x00000000018dcff0 in THD::binlog_prepare_row_images (this=0x7f1646c19000, table=0x7f1646c5a220) at /qa/mytest/mysql-server_dbg/sql/binlog.cc:11348
#9  0x00000000018dc8a2 in THD::binlog_update_row (this=0x7f1646c19000, table=0x7f1646c5a220, is_trans=false, before_record=0x7f1646c84310 <incomplete sequence \371>, after_record=0x7f1646c842f8 <incomplete sequence \371>, extra_row_info=0x0) at /qa/mytest/mysql-server_dbg/sql/binlog.cc:11227
#10 0x0000000000fa0740 in Update_rows_log_event::binlog_row_logging_function (thd=0x7f1646c19000, table=0x7f1646c5a220, is_transactional=false, before_record=0x7f1646c84310 <incomplete sequence \371>, after_record=0x7f1646c842f8 <incomplete sequence \371>) at /qa/mytest/mysql-server_dbg/sql/log_event.h:3527
#11 0x0000000000f9b14d in binlog_log_row (table=0x7f1646c5a220, before_record=0x7f1646c84310 <incomplete sequence \371>, after_record=0x7f1646c842f8 <incomplete sequence \371>, log_func=0xfa06fe <Update_rows_log_event::binlog_row_logging_function(THD*, TABLE*, bool, unsigned char const*, unsigned char const*)>) at /qa/mytest/mysql-server_dbg/sql/handler.cc:7851
#12 0x0000000000f9be9f in handler::ha_update_row (this=0x7f1646c84030, old_data=0x7f1646c84310 <incomplete sequence \371>, new_data=0x7f1646c842f8 <incomplete sequence \371>) at /qa/mytest/mysql-server_dbg/sql/handler.cc:8023
#13 0x00000000016cdb15 in Query_result_update::do_updates (this=0x7f1646c9bf38) at /qa/mytest/mysql-server_dbg/sql/sql_update.cc:2669
#14 0x00000000016cdf5e in Query_result_update::send_eof (this=0x7f1646c9bf38) at /qa/mytest/mysql-server_dbg/sql/sql_update.cc:2753
#15 0x00000000015bbafa in do_select (join=0x7f1646d010b8) at /qa/mytest/mysql-server_dbg/sql/sql_executor.cc:993
#16 0x00000000015b971c in JOIN::exec (this=0x7f1646d010b8) at /qa/mytest/mysql-server_dbg/sql/sql_executor.cc:199
#17 0x000000000165baee in handle_query (thd=0x7f1646c19000, lex=0x7f1646c1b2f8, result=0x7f1646c9bf38, added_options=1342177408, removed_options=131072) at /qa/mytest/mysql-server_dbg/sql/sql_select.cc:184
#18 0x00000000016ca2ad in mysql_multi_update (thd=0x7f1646c19000, fields=0x7f1646c2c1d8, values=0x7f1646c2cf48, handle_duplicates=DUP_ERROR, select_lex=0x7f1646c2c0a0, result=0x7f1684c19348) at /qa/mytest/mysql-server_dbg/sql/sql_update.cc:1672
#19 0x00000000016ce92b in Sql_cmd_update::execute_multi_table_update (this=0x7f1646c2cf38, thd=0x7f1646c19000) at /qa/mytest/mysql-server_dbg/sql/sql_update.cc:2979
#20 0x00000000016cea77 in Sql_cmd_update::execute (this=0x7f1646c2cf38, thd=0x7f1646c19000) at /qa/mytest/mysql-server_dbg/sql/sql_update.cc:3006
#21 0x0000000001607045 in mysql_execute_command (thd=0x7f1646c19000, first_level=true) at /qa/mytest/mysql-server_dbg/sql/sql_parse.cc:3579
#22 0x000000000160ce4b in mysql_parse (thd=0x7f1646c19000, parser_state=0x7f1684c1a510) at /qa/mytest/mysql-server_dbg/sql/sql_parse.cc:5574
#23 0x0000000001601c13 in dispatch_command (thd=0x7f1646c19000, com_data=0x7f1684c1adc0, command=COM_QUERY) at /qa/mytest/mysql-server_dbg/sql/sql_parse.cc:1461
#24 0x0000000001600a60 in do_command (thd=0x7f1646c19000) at /qa/mytest/mysql-server_dbg/sql/sql_parse.cc:999
#25 0x00000000017437d3 in handle_connection (arg=0x7f1659bff5c0) at /qa/mytest/mysql-server_dbg/sql/conn_handler/connection_handler_per_thread.cc:300
#26 0x0000000001e2e9c1 in pfs_spawn_thread (arg=0x7f166afe1b20) at /qa/mytest/mysql-server_dbg/storage/perfschema/pfs.cc:2188
#27 0x00007f16833156ba in start_thread (arg=0x7f1684c1b700) at pthread_create.c:333
#28 0x00007f16827aa3dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

How to repeat:
# mysqld options required for replay:  --sql_mode=ONLY_FULL_GROUP_BY --log-bin
CREATE TABLE t1(cik int,pk_1 int,pk_2 int,ci int,key(cik),primary key (pk_1,pk_2)) ENGINE=MyISAM;
INSERT INTO t1 VALUES(0,0,2,0);
SET binlog_row_image=MINIMAL;
insert into t1 values(0,_ucs2 0x0563001fc0563,_ucs2 0x0563001fc0563,0);
UPDATE t1 AS A NATURAL JOIN t1 B SET A.pk_1=5,B.pk_1=7;
[29 Aug 2017 10:08] MySQL Verification Team
Hello Ramesh,

Thank you for the report and test case.
Observed that 5.7.19 debug build is affected.

Thanks,
Umesh
[29 Aug 2017 10:09] MySQL Verification Team
## 5.7.19 - debug build

rm -rf 87573
bin/mysqld --initialize-insecure --basedir=$PWD --datadir=$PWD/87573 -v
bin/mysqld-debug --no-defaults --sql_mode=ONLY_FULL_GROUP_BY --log-bin --server-id=1 --basedir=$PWD --datadir=$PWD/87573 --core-file --socket=/tmp/mysql_ushastry.sock --port=3306 --log-error=$PWD/87573/log.err 2>&1 &

(gdb) bt
#0  0x00007f2f246d6771 in pthread_kill () from /lib64/libpthread.so.0
#1  0x00000000018d40b5 in my_write_core (sig=6) at /export/home/pb2/build/sb_0-23948522-1498142411.21/mysql-5.7.19/mysys/stacktrace.c:249
#2  0x0000000000ed66b6 in handle_fatal_signal (sig=6) at /export/home/pb2/build/sb_0-23948522-1498142411.21/mysql-5.7.19/sql/signal_handler.cc:220
#3  <signal handler called>
#4  0x00007f2f230d05d7 in raise () from /lib64/libc.so.6
#5  0x00007f2f230d1cc8 in abort () from /lib64/libc.so.6
#6  0x00007f2f230c9546 in __assert_fail_base () from /lib64/libc.so.6
#7  0x00007f2f230c95f2 in __assert_fail () from /lib64/libc.so.6
#8  0x000000000184ad6e in THD::binlog_prepare_row_images (this=0x7f2ec4000b70, table=0x7f2ec4010cd0)
    at /export/home/pb2/build/sb_0-23948522-1498142411.21/mysql-5.7.19/sql/binlog.cc:11348
#9  0x000000000184a66f in THD::binlog_update_row (this=0x7f2ec4000b70, table=0x7f2ec4010cd0, is_trans=false, before_record=0x7f2ec4011960 <incomplete sequence \371>,
    after_record=0x7f2ec4011948 <incomplete sequence \371>, extra_row_info=0x0) at /export/home/pb2/build/sb_0-23948522-1498142411.21/mysql-5.7.19/sql/binlog.cc:11227
#10 0x0000000000f622ff in Update_rows_log_event::binlog_row_logging_function (thd=0x7f2ec4000b70, table=0x7f2ec4010cd0, is_transactional=false,
    before_record=0x7f2ec4011960 <incomplete sequence \371>, after_record=0x7f2ec4011948 <incomplete sequence \371>)
    at /export/home/pb2/build/sb_0-23948522-1498142411.21/mysql-5.7.19/sql/log_event.h:3528
#11 0x0000000000f5cf82 in binlog_log_row (table=0x7f2ec4010cd0, before_record=0x7f2ec4011960 <incomplete sequence \371>,
    after_record=0x7f2ec4011948 <incomplete sequence \371>,
    log_func=0xf622b9 <Update_rows_log_event::binlog_row_logging_function(THD*, TABLE*, bool, unsigned char const*, unsigned char const*)>)
    at /export/home/pb2/build/sb_0-23948522-1498142411.21/mysql-5.7.19/sql/handler.cc:7851
#12 0x0000000000f5dc4c in handler::ha_update_row (this=0x7f2ec4011680, old_data=0x7f2ec4011960 <incomplete sequence \371>,
    new_data=0x7f2ec4011948 <incomplete sequence \371>) at /export/home/pb2/build/sb_0-23948522-1498142411.21/mysql-5.7.19/sql/handler.cc:8023
#13 0x000000000164951b in Query_result_update::do_updates (this=0x7f2ec493e6b8) at /export/home/pb2/build/sb_0-23948522-1498142411.21/mysql-5.7.19/sql/sql_update.cc:2669
#14 0x0000000001649924 in Query_result_update::send_eof (this=0x7f2ec493e6b8) at /export/home/pb2/build/sb_0-23948522-1498142411.21/mysql-5.7.19/sql/sql_update.cc:2753
#15 0x0000000001541ec8 in do_select (join=0x7f2ec4940e98) at /export/home/pb2/build/sb_0-23948522-1498142411.21/mysql-5.7.19/sql/sql_executor.cc:993
#16 0x000000000153fbce in JOIN::exec (this=0x7f2ec4940e98) at /export/home/pb2/build/sb_0-23948522-1498142411.21/mysql-5.7.19/sql/sql_executor.cc:199
#17 0x00000000015dcb5e in handle_query (thd=0x7f2ec4000b70, lex=0x7f2ec4002ce0, result=0x7f2ec493e6b8, added_options=1342177408, removed_options=131072)
    at /export/home/pb2/build/sb_0-23948522-1498142411.21/mysql-5.7.19/sql/sql_select.cc:184
#18 0x0000000001645e33 in mysql_multi_update (thd=0x7f2ec4000b70, fields=0x7f2ec4005778, values=0x7f2ec40064e8, handle_duplicates=DUP_ERROR, select_lex=0x7f2ec4005640,
    result=0x7f2f18056dd8) at /export/home/pb2/build/sb_0-23948522-1498142411.21/mysql-5.7.19/sql/sql_update.cc:1672
#19 0x000000000164a2e9 in Sql_cmd_update::execute_multi_table_update (this=0x7f2ec40064d8, thd=0x7f2ec4000b70)
    at /export/home/pb2/build/sb_0-23948522-1498142411.21/mysql-5.7.19/sql/sql_update.cc:2979
#20 0x000000000164a42c in Sql_cmd_update::execute (this=0x7f2ec40064d8, thd=0x7f2ec4000b70)
    at /export/home/pb2/build/sb_0-23948522-1498142411.21/mysql-5.7.19/sql/sql_update.cc:3006
#21 0x000000000158cc13 in mysql_execute_command (thd=0x7f2ec4000b70, first_level=true)
    at /export/home/pb2/build/sb_0-23948522-1498142411.21/mysql-5.7.19/sql/sql_parse.cc:3579
#22 0x0000000001592ba7 in mysql_parse (thd=0x7f2ec4000b70, parser_state=0x7f2f18058690)
    at /export/home/pb2/build/sb_0-23948522-1498142411.21/mysql-5.7.19/sql/sql_parse.cc:5574
#23 0x000000000158756e in dispatch_command (thd=0x7f2ec4000b70, com_data=0x7f2f18058e00, command=COM_QUERY)
    at /export/home/pb2/build/sb_0-23948522-1498142411.21/mysql-5.7.19/sql/sql_parse.cc:1461
#24 0x0000000001586371 in do_command (thd=0x7f2ec4000b70) at /export/home/pb2/build/sb_0-23948522-1498142411.21/mysql-5.7.19/sql/sql_parse.cc:999
#25 0x00000000016bc734 in handle_connection (arg=0x42c7040)
    at /export/home/pb2/build/sb_0-23948522-1498142411.21/mysql-5.7.19/sql/conn_handler/connection_handler_per_thread.cc:300
#26 0x000000000198c9f8 in pfs_spawn_thread (arg=0x428e0f0) at /export/home/pb2/build/sb_0-23948522-1498142411.21/mysql-5.7.19/storage/perfschema/pfs.cc:2188
#27 0x00007f2f246d1df5 in start_thread () from /lib64/libpthread.so.0
#28 0x00007f2f2319160d in clone () from /lib64/libc.so.6
(gdb)