Bug #73869 !table || (!table->read_set || bitmap_is_set(table->read_set, field_index))
Submitted: 10 Sep 2014 6:58 Modified: 13 Nov 2014 20:17
Reporter: Roel Van de Paar Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DML Severity:S2 (Serious)
Version:5.6.20, 5.6.23 OS:Any
Assigned to: CPU Architecture:Any

[10 Sep 2014 6:58] Roel Van de Paar
Description:
2014-09-10 19:47:39 19032 [Note] /sda/mysql-5.6.20-linux-x86_64-debug/bin/mysqld-debug: ready for connections.
Version: '5.6.20-debug-log'  socket: '/sda/324483/current1_1/tmp/master.sock'  port: 13000  MySQL Community Server (GPL)
mysqld-debug: /bzr/mysql-5.6/sql/field.cc:3819: virtual longlong Field_long::val_int(): Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))' failed.
16:51:04 UTC - mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.

key_buffer_size=1048576
read_buffer_size=131072
max_used_connections=4
max_threads=151
thread_count=2
connection_count=2
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 61081 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x7fefe3a54000
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 7ff01738be20 thread_stack 0x40000
/sda/mysql-5.6.20-linux-x86_64-debug/bin/mysqld-debug(my_print_stacktrace+0x35)[0xa902dc]
/sda/mysql-5.6.20-linux-x86_64-debug/bin/mysqld-debug(handle_fatal_signal+0x3f3)[0x7234a3]
/lib64/libpthread.so.0(+0xf130)[0x7ff016dd8130]
/lib64/libc.so.6(gsignal+0x39)[0x7ff015be1989]
/lib64/libc.so.6(abort+0x148)[0x7ff015be3098]
/lib64/libc.so.6(+0x2e8f6)[0x7ff015bda8f6]
/lib64/libc.so.6(+0x2e9a2)[0x7ff015bda9a2]
/sda/mysql-5.6.20-linux-x86_64-debug/bin/mysqld-debug(_ZN10Field_long7val_intEv+0x75)[0x8f727f]
/sda/mysql-5.6.20-linux-x86_64-debug/bin/mysqld-debug(_ZN12ha_partition28set_auto_increment_if_higherEP5Field+0x33)[0xe147b5]
/sda/mysql-5.6.20-linux-x86_64-debug/bin/mysqld-debug(_ZN12ha_partition10update_rowEPKhPh+0x4dc)[0xe0a1d4]
/sda/mysql-5.6.20-linux-x86_64-debug/bin/mysqld-debug(_ZN7handler13ha_update_rowEPKhPh+0x165)[0x6421ab]
/sda/mysql-5.6.20-linux-x86_64-debug/bin/mysqld-debug(_Z12mysql_updateP3THDP10TABLE_LISTR4ListI4ItemES6_PS4_jP8st_ordery15enum_duplicatesbPySB_+0x1bf6)[0x85f1fe]
/sda/mysql-5.6.20-linux-x86_64-debug/bin/mysqld-debug(_Z21mysql_execute_commandP3THD+0x272a)[0x7d1052]
/sda/mysql-5.6.20-linux-x86_64-debug/bin/mysqld-debug(_Z11mysql_parseP3THDPcjP12Parser_state+0x485)[0x7d8fa4]
/sda/mysql-5.6.20-linux-x86_64-debug/bin/mysqld-debug(_Z16dispatch_command19enum_server_commandP3THDPcj+0xcbe)[0x7cc557]
/sda/mysql-5.6.20-linux-x86_64-debug/bin/mysqld-debug(_Z10do_commandP3THD+0x33e)[0x7cb646]
/sda/mysql-5.6.20-linux-x86_64-debug/bin/mysqld-debug(_Z24do_handle_one_connectionP3THD+0x1b6)[0x793a61]
/sda/mysql-5.6.20-linux-x86_64-debug/bin/mysqld-debug(handle_one_connection+0x33)[0x79354a]
/sda/mysql-5.6.20-linux-x86_64-debug/bin/mysqld-debug(pfs_spawn_thread+0x159)[0xade888]
/lib64/libpthread.so.0(+0x7df3)[0x7ff016dd0df3]
/lib64/libc.so.6(clone+0x6d)[0x7ff015ca23dd]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7fefd5c20010): UPDATE   `view_table500_innodb_compressed_key_pk_parts_2_int` SET `c21` = 2 WHERE `pk` >= 'b'
Connection ID (thread ID): 9
Status: NOT_KILLED

How to repeat:
Run attached cmd file (RQG)
[10 Sep 2014 6:59] Roel Van de Paar
See bug #47150
[10 Sep 2014 7:05] Roel Van de Paar
I am uploading mysql-bug-73869-BUNDLE_53.tar.gz to SFTP server which contains all info (core, stack traces, detailed stack traces, cmd used, vardir etc.)
[13 Nov 2014 7:52] MySQL Verification Team
Hello Roel,

Thank you for the bug report and test case.
I could not repeat the issue at my end using GA(5.6.21) and latest build( 5.6.23) with debug and optimized builds.

Could you please confirm exact build details, also it looks like you are using TokuDB engine and in my case it was using InnoDB.

If possible could you please provide simplified repeatable test case?

Thank,
Umesh
[13 Nov 2014 10:06] Roel Van de Paar
Umesh, hi!

I never provided a testcase with this bug. The idea here is that your developers review the code against the coredump. In many cases this leads to finding the bug, sometimes even easily. Can you check with Marko, Shane or any other developer?

Also, yes we have TokuDB in Percona Server, but looking at the crashing query;

Query (7fefd5c20010): UPDATE   `view_table500_innodb_compressed_key_pk_parts_2_int` SET `c21` = 2 WHERE `pk` >= 'b'

This looks to be an InnoDB table update, so I expect that TokuDB engine being present is unrelated, unless the table was altered. How did you come to the TokuDB conclusion?

Thanks
[13 Nov 2014 11:06] MySQL Verification Team
Roel,  I'm on vacation so just had a quick look :)  I guess the table structure from the stack trace above.

----
drop table if exists t1;
create table t1(a tinyint unsigned auto_increment, b tinyint, key(a),primary key(b))engine=innodb partition by hash(b) partitions 5;
insert into t1(a,b) values (0,1),(1,2),(2,3),(3,4);
update t1 set a=2 where b > 0;
----

Version: '5.6.20-enterprise-commercial-advanced-debug' MySQL Enterprise Server - Advanced Edition Debug (Commercial)
Assertion failed: !table || (!table->read_set || bitmap_is_set(table->read_set, field_index)), file ..\..\mysqlcom-pro-5.6.20\sql\field.cc, line 3156
R6010

mysqld-debug.exe!my_sigabrt_handler()[my_thr_init.c:458]
mysqld-debug.exe!raise()[winsig.c:593]
mysqld-debug.exe!abort()[abort.c:81]
mysqld-debug.exe!_wassert()[assert.c:153]
mysqld-debug.exe!Field_tiny::val_int()[field.cc:3156]
mysqld-debug.exe!ha_partition::set_auto_increment_if_higher()[ha_partition.h:1079]
mysqld-debug.exe!ha_partition::update_row()[ha_partition.cc:4124]
mysqld-debug.exe!handler::ha_update_row()[handler.cc:7306]
mysqld-debug.exe!mysql_update()[sql_update.cc:818]
mysqld-debug.exe!mysql_execute_command()[sql_parse.cc:3307]
mysqld-debug.exe!mysql_parse()[sql_parse.cc:6245]
mysqld-debug.exe!dispatch_command()[sql_parse.cc:1335]
mysqld-debug.exe!do_command()[sql_parse.cc:1034]
mysqld-debug.exe!do_handle_one_connection()[sql_connect.cc:982]
mysqld-debug.exe!handle_one_connection()[sql_connect.cc:899]
mysqld-debug.exe!pfs_spawn_thread()[pfs.cc:1862]
mysqld-debug.exe!pthread_start()[my_winthread.c:62]
mysqld-debug.exe!_callthreadstartex()[threadex.c:314]
mysqld-debug.exe!_threadstartex()[threadex.c:297]
[13 Nov 2014 13:46] MySQL Verification Team
Thank you Shane, Roel.
I was using the 'cmd' provided in the mysql-bug-73869-BUNDLE_53.tar.gz.
With Shane's test case it is repeatable on 5.6.23 debug build.

(gdb) bt
#0  __pthread_kill (threadid=<value optimized out>, signo=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:63
#1  0x0000000000affdab in my_write_core (sig=6) at /export/home/pb2/build/sb_0-13622626-1415294505.52/mysqlcom-pro-5.6.23/mysys/stacktrace.c:422
#2  0x000000000077ebbc in handle_fatal_signal (sig=6) at /export/home/pb2/build/sb_0-13622626-1415294505.52/mysqlcom-pro-5.6.23/sql/signal_handler.cc:230
#3  <signal handler called>
#4  0x0000003deac32625 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#5  0x0000003deac33e05 in abort () at abort.c:92
#6  0x0000003deac2b74e in __assert_fail_base (fmt=<value optimized out>, assertion=0x10a81d8 "!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))",
    file=0x10a8120 "/export/home/pb2/build/sb_0-13622626-1415294505.52/mysqlcom-pro-5.6.23/sql/field.cc", line=<value optimized out>, function=<value optimized out>) at assert.c:96
#7  0x0000003deac2b810 in __assert_fail (assertion=0x10a81d8 "!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))",
    file=0x10a8120 "/export/home/pb2/build/sb_0-13622626-1415294505.52/mysqlcom-pro-5.6.23/sql/field.cc", line=3156, function=0x10ad000 "virtual longlong Field_tiny::val_int()") at assert.c:105
#8  0x000000000095b71c in Field_tiny::val_int (this=0x7ff290017110) at /export/home/pb2/build/sb_0-13622626-1415294505.52/mysqlcom-pro-5.6.23/sql/field.cc:3156
#9  0x0000000000e8f0e3 in ha_partition::set_auto_increment_if_higher (this=0x7ff29001e530, field=0x7ff290017110)
    at /export/home/pb2/build/sb_0-13622626-1415294505.52/mysqlcom-pro-5.6.23/sql/ha_partition.h:1079
#10 0x0000000000e84a0d in ha_partition::update_row (this=0x7ff29001e530, old_data=0x7ff2900170f0 "\377\001\001", new_data=0x7ff2900170e8 "\377\002\001")
    at /export/home/pb2/build/sb_0-13622626-1415294505.52/mysqlcom-pro-5.6.23/sql/ha_partition.cc:4157
#11 0x0000000000699cdc in handler::ha_update_row (this=0x7ff29001e530, old_data=0x7ff2900170f0 "\377\001\001", new_data=0x7ff2900170e8 "\377\002\001")
    at /export/home/pb2/build/sb_0-13622626-1415294505.52/mysqlcom-pro-5.6.23/sql/handler.cc:7305
#12 0x00000000008c0a06 in mysql_update (thd=0x23bbb50, table_list=0x7ff2900050e0, fields=..., values=..., conds=0x7ff2900059e8, order_num=0, order=0x0, limit=18446744073709551615,
    handle_duplicates=DUP_ERROR, ignore=false, found_return=0x7ff2b9fdfd08, updated_return=0x7ff2b9fdfd00)
    at /export/home/pb2/build/sb_0-13622626-1415294505.52/mysqlcom-pro-5.6.23/sql/sql_update.cc:818
#13 0x000000000082f736 in mysql_execute_command (thd=0x23bbb50) at /export/home/pb2/build/sb_0-13622626-1415294505.52/mysqlcom-pro-5.6.23/sql/sql_parse.cc:3307
#14 0x0000000000837fa9 in mysql_parse (thd=0x23bbb50, rawbuf=0x7ff290004ff0 "update t1 set a=2 where b > 0", length=29, parser_state=0x7ff2b9fe0680)
    at /export/home/pb2/build/sb_0-13622626-1415294505.52/mysqlcom-pro-5.6.23/sql/sql_parse.cc:6357
#15 0x000000000082a92b in dispatch_command (command=COM_QUERY, thd=0x23bbb50, packet=0x24ea3e1 "update t1 set a=2 where b > 0", packet_length=29)
    at /export/home/pb2/build/sb_0-13622626-1415294505.52/mysqlcom-pro-5.6.23/sql/sql_parse.cc:1332
#16 0x0000000000829990 in do_command (thd=0x23bbb50) at /export/home/pb2/build/sb_0-13622626-1415294505.52/mysqlcom-pro-5.6.23/sql/sql_parse.cc:1034
#17 0x00000000007f0d8f in do_handle_one_connection (thd_arg=0x23bbb50) at /export/home/pb2/build/sb_0-13622626-1415294505.52/mysqlcom-pro-5.6.23/sql/sql_connect.cc:982
#18 0x00000000007f0860 in handle_one_connection (arg=0x23bbb50) at /export/home/pb2/build/sb_0-13622626-1415294505.52/mysqlcom-pro-5.6.23/sql/sql_connect.cc:898
#19 0x0000000000e5f509 in pfs_spawn_thread (arg=0x24adb10) at /export/home/pb2/build/sb_0-13622626-1415294505.52/mysqlcom-pro-5.6.23/storage/perfschema/pfs.cc:1860
#20 0x0000003deb0079d1 in start_thread (arg=0x7ff2b9fe1700) at pthread_create.c:301
#21 0x0000003deace89dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115
[13 Nov 2014 13:48] MySQL Verification Team
// 5.7.6 debug build

(gdb) bt
#0  __pthread_kill (threadid=<value optimized out>, signo=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/pthread_kill.c:63
#1  0x0000000000f990a1 in my_write_core (sig=6) at /pb2/build/sb_0-13559856-1414670154.69/mysqlcom-pro-5.7.6-m16/mysys/stacktrace.c:247
#2  0x000000000092d7cc in handle_fatal_signal (sig=6) at /pb2/build/sb_0-13559856-1414670154.69/mysqlcom-pro-5.7.6-m16/sql/signal_handler.cc:219
#3  <signal handler called>
#4  0x0000003deac32625 in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#5  0x0000003deac33e05 in abort () at abort.c:92
#6  0x0000003deac2b74e in __assert_fail_base (fmt=<value optimized out>, assertion=0x155f660 "!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))",
    file=0x155f5b0 "/pb2/build/sb_0-13559856-1414670154.69/mysqlcom-pro-5.7.6-m16/sql/field.cc", line=<value optimized out>, function=<value optimized out>) at assert.c:96
#7  0x0000003deac2b810 in __assert_fail (assertion=0x155f660 "!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))",
    file=0x155f5b0 "/pb2/build/sb_0-13559856-1414670154.69/mysqlcom-pro-5.7.6-m16/sql/field.cc", line=3262, function=0x1564780 "virtual longlong Field_tiny::val_int()") at assert.c:105
#8  0x000000000095fb12 in Field_tiny::val_int (this=0x7f709001e238) at /pb2/build/sb_0-13559856-1414670154.69/mysqlcom-pro-5.7.6-m16/sql/field.cc:3262
#9  0x00000000013fa704 in ha_partition::set_auto_increment_if_higher (this=0x7f709001da40, field=0x7f709001e238)
    at /pb2/build/sb_0-13559856-1414670154.69/mysqlcom-pro-5.7.6-m16/sql/ha_partition.h:1090
#10 0x00000000013eeee3 in ha_partition::update_row (this=0x7f709001da40, old_data=0x7f709001e218 "\377\001\001\217\217\217\217\217\070\342\001\220p\177",
    new_data=0x7f709001e210 "\377\002\001\217\217\217\217\217\377\001\001\217\217\217\217\217\070\342\001\220p\177")
    at /pb2/build/sb_0-13559856-1414670154.69/mysqlcom-pro-5.7.6-m16/sql/ha_partition.cc:4202
#11 0x000000000099f5e0 in handler::ha_update_row (this=0x7f709001da40, old_data=0x7f709001e218 "\377\001\001\217\217\217\217\217\070\342\001\220p\177",
    new_data=0x7f709001e210 "\377\002\001\217\217\217\217\217\377\001\001\217\217\217\217\217\070\342\001\220p\177")
    at /pb2/build/sb_0-13559856-1414670154.69/mysqlcom-pro-5.7.6-m16/sql/handler.cc:7475
#12 0x0000000000d53dcc in mysql_update (thd=0x7f7090000cf0, fields=..., values=..., limit=18446744073709551615, handle_duplicates=DUP_ERROR, found_return=0x7f70c9f26c88,
    updated_return=0x7f70c9f26c80) at /pb2/build/sb_0-13559856-1414670154.69/mysqlcom-pro-5.7.6-m16/sql/sql_update.cc:873
#13 0x0000000000cb5f1e in mysql_execute_command (thd=0x7f7090000cf0) at /pb2/build/sb_0-13559856-1414670154.69/mysqlcom-pro-5.7.6-m16/sql/sql_parse.cc:3165
#14 0x0000000000cbce6a in mysql_parse (thd=0x7f7090000cf0, parser_state=0x7f70c9f27660) at /pb2/build/sb_0-13559856-1414670154.69/mysqlcom-pro-5.7.6-m16/sql/sql_parse.cc:5397
#15 0x0000000000cb0f2c in dispatch_command (command=COM_QUERY, thd=0x7f7090000cf0, packet=0x7f7090009a21 "update t1 set a=2 where b > 0", packet_length=29)
    at /pb2/build/sb_0-13559856-1414670154.69/mysqlcom-pro-5.7.6-m16/sql/sql_parse.cc:1249
#16 0x0000000000cafbd4 in do_command (thd=0x7f7090000cf0) at /pb2/build/sb_0-13559856-1414670154.69/mysqlcom-pro-5.7.6-m16/sql/sql_parse.cc:833
#17 0x0000000000dbe89c in handle_connection (arg=0x3da6550) at /pb2/build/sb_0-13559856-1414670154.69/mysqlcom-pro-5.7.6-m16/sql/conn_handler/connection_handler_per_thread.cc:298
#18 0x000000000138347f in pfs_spawn_thread (arg=0x3bfcb50) at /pb2/build/sb_0-13559856-1414670154.69/mysqlcom-pro-5.7.6-m16/storage/perfschema/pfs.cc:2137
#19 0x0000003deb0079d1 in start_thread (arg=0x7f70c9f28700) at pthread_create.c:301
#20 0x0000003deace89dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115
[13 Nov 2014 18:16] Roel Van de Paar
Shane, you rock.
[13 Nov 2014 20:17] Roel Van de Paar
Hi Umesh,

> I was using the 'cmd' provided in the mysql-bug-73869-BUNDLE_53.tar.gz.

Ah! The 'cmd' files are just a startup command. If you see them again, they are there just to show how the server was started. If I uploaded a bundle, it means no testcase could be created. Thanks