Bug #74777 Assertion :bitmap_is_subset(&m_part_info->lock_partitions, &m_locked_partitions)
Submitted: 11 Nov 2014 6:14 Modified: 20 Nov 2019 21:58
Reporter: Ramesh Sivaraman Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: DML Severity:S3 (Non-critical)
Version:5.6.21-debug, 5.6.23, 5.7.6 OS:Any
Assigned to: CPU Architecture:Any

[11 Nov 2014 6:14] Ramesh Sivaraman
Description:
mysqld: /ssd/ramesh/mysql-server/mysql-5.6/sql/ha_partition.cc:3731: virtual int ha_partition::start_stmt(THD*, thr_lock_type): Assertion `bitmap_is_subset(&m_part_info->lock_partitions, &m_locked_partitions)' failed.
06:07:35 UTC - mysqld got signal 6 ;

** GDB
#0  0x00007f0af8851771 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  0x00007f0af765d5c9 in raise () from /lib64/libc.so.6
#5  0x00007f0af765ecd8 in abort () from /lib64/libc.so.6
#6  0x00007f0af7656536 in __assert_fail_base () from /lib64/libc.so.6
#7  0x00007f0af76565e2 in __assert_fail () from /lib64/libc.so.6
#8  0x0000000000e0fa8f in ha_partition::start_stmt (this=0x7f0a53ca7010, thd=0x7f0a6535d000, lock_type=TL_READ) at /ssd/ramesh/mysql-server/mysql-5.6/sql/ha_partition.cc:3730
#9  0x000000000076a8d8 in check_lock_and_start_stmt (thd=0x7f0a6535d000, prelocking_ctx=0x7f0a6535f178, table_list=0x7f0a53c1f208) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_base.cc:5494
#10 0x000000000076baf6 in lock_tables (thd=0x7f0a6535d000, tables=0x7f0a53c1f208, count=1, flags=0) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_base.cc:6030
#11 0x00000000008011fa in mysql_select (thd=0x7f0a6535d000, tables=0x7f0a53c1f208, wild_num=0, fields=..., conds=0x0, order=0x7f0a6535fa40, group=0x7f0a6535f978, having=0x0, select_options=2149845760, result=0x7f0a53c1f820, unit=0x7f0a6535f230, select_lex=0x7f0a6535f878) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_select.cc:1201
#12 0x00000000007ff32b in handle_select (thd=0x7f0a6535d000, result=0x7f0a53c1f820, setup_tables_done_option=0) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_select.cc:110
#13 0x00000000007d9633 in execute_sqlcom_select (thd=0x7f0a6535d000, all_tables=0x7f0a53c1f208) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_parse.cc:5103
#14 0x00000000007d23e3 in mysql_execute_command (thd=0x7f0a6535d000) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_parse.cc:2649
#15 0x00000000007dbdbc in mysql_parse (thd=0x7f0a6535d000, rawbuf=0x7f0a53c1f010 "SELECT b FROM t1", length=16, parser_state=0x7f0af8e06e70) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_parse.cc:6245
#16 0x00000000007cf36f in dispatch_command (command=COM_QUERY, thd=0x7f0a6535d000, packet=0x7f0a59e66001 "SELECT b FROM t1", packet_length=16) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_parse.cc:1332
#17 0x00000000007ce45e in do_command (thd=0x7f0a6535d000) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_parse.cc:1034
#18 0x0000000000796879 in do_handle_one_connection (thd_arg=0x7f0a6535d000) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_connect.cc:982
#19 0x0000000000796362 in handle_one_connection (arg=0x7f0a6535d000) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_connect.cc:898
#20 0x0000000000d71288 in pfs_spawn_thread (arg=0x7f0af4bfea60) at /ssd/ramesh/mysql-server/mysql-5.6/storage/perfschema/pfs.cc:1860
#21 0x00007f0af884cdf3 in start_thread () from /lib64/libpthread.so.0
#22 0x00007f0af771e01d in clone () from /lib64/libc.so.6

How to repeat:
DROP DATABASE test;CREATE DATABASE test;USE test;
CREATE TABLE t1(a int,b CHAR (1),KEY (b)) ENGINE=InnoDB PARTITION BY HASH (a) PARTITIONS 3;
CREATE VIEW v1 AS SELECT a FROM t1 PARTITION(p0);
lock tables v1 read;
SELECT b FROM t1;
[11 Nov 2014 7:59] MySQL Verification Team
Hello Ramesh Sivaraman,

Thank you for the bug report and test case.
Observed that 5.6.23/5.6.7 debug builds affected.

Thanks,
Umesh
[11 Nov 2014 8:00] MySQL Verification Team
// 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=0x11c3070 "bitmap_is_subset(&m_part_info->lock_partitions, &m_locked_partitions)",
    file=0x11c22d0 "/export/home/pb2/build/sb_0-13622626-1415294505.52/mysqlcom-pro-5.6.23/sql/ha_partition.cc", line=<value optimized out>, function=<value optimized out>) at assert.c:96
#7  0x0000003deac2b810 in __assert_fail (assertion=0x11c3070 "bitmap_is_subset(&m_part_info->lock_partitions, &m_locked_partitions)",
    file=0x11c22d0 "/export/home/pb2/build/sb_0-13622626-1415294505.52/mysqlcom-pro-5.6.23/sql/ha_partition.cc", line=3766,
    function=0x11c5d40 "virtual int ha_partition::start_stmt(THD*, thr_lock_type)") at assert.c:105
#8  0x0000000000e83d24 in ha_partition::start_stmt (this=0x7f5f2004e170, thd=0x2b3a620, lock_type=TL_READ)
    at /export/home/pb2/build/sb_0-13622626-1415294505.52/mysqlcom-pro-5.6.23/sql/ha_partition.cc:3766
#9  0x00000000007c4797 in check_lock_and_start_stmt (thd=0x2b3a620, prelocking_ctx=0x2b3c798, table_list=0x7f5f20006f78)
    at /export/home/pb2/build/sb_0-13622626-1415294505.52/mysqlcom-pro-5.6.23/sql/sql_base.cc:5514
#10 0x00000000007c5a90 in lock_tables (thd=0x2b3a620, tables=0x7f5f20006f78, count=1, flags=0) at /export/home/pb2/build/sb_0-13622626-1415294505.52/mysqlcom-pro-5.6.23/sql/sql_base.cc:6050
#11 0x000000000085d99f in mysql_select (thd=0x2b3a620, tables=0x7f5f20006f78, wild_num=0, fields=..., conds=0x0, order=0x2b3d060, group=0x2b3cf98, having=0x0, select_options=2149845760,
    result=0x7f5f20007590, unit=0x2b3c850, select_lex=0x2b3ce98) at /export/home/pb2/build/sb_0-13622626-1415294505.52/mysqlcom-pro-5.6.23/sql/sql_select.cc:1201
#12 0x000000000085ba57 in handle_select (thd=0x2b3a620, result=0x7f5f20007590, setup_tables_done_option=0)
    at /export/home/pb2/build/sb_0-13622626-1415294505.52/mysqlcom-pro-5.6.23/sql/sql_select.cc:110
#13 0x0000000000835384 in execute_sqlcom_select (thd=0x2b3a620, all_tables=0x7f5f20006f78) at /export/home/pb2/build/sb_0-13622626-1415294505.52/mysqlcom-pro-5.6.23/sql/sql_parse.cc:5103
#14 0x000000000082dadc in mysql_execute_command (thd=0x2b3a620) at /export/home/pb2/build/sb_0-13622626-1415294505.52/mysqlcom-pro-5.6.23/sql/sql_parse.cc:2649
#15 0x0000000000837fa9 in mysql_parse (thd=0x2b3a620, rawbuf=0x7f5f20006d80 "SELECT b FROM t1", length=16, parser_state=0x7f5f50295680)
    at /export/home/pb2/build/sb_0-13622626-1415294505.52/mysqlcom-pro-5.6.23/sql/sql_parse.cc:6357
#16 0x000000000082a92b in dispatch_command (command=COM_QUERY, thd=0x2b3a620, packet=0x2c68e51 "SELECT b FROM t1", packet_length=16)
    at /export/home/pb2/build/sb_0-13622626-1415294505.52/mysqlcom-pro-5.6.23/sql/sql_parse.cc:1332
#17 0x0000000000829990 in do_command (thd=0x2b3a620) at /export/home/pb2/build/sb_0-13622626-1415294505.52/mysqlcom-pro-5.6.23/sql/sql_parse.cc:1034
#18 0x00000000007f0d8f in do_handle_one_connection (thd_arg=0x2b3a620) at /export/home/pb2/build/sb_0-13622626-1415294505.52/mysqlcom-pro-5.6.23/sql/sql_connect.cc:982
#19 0x00000000007f0860 in handle_one_connection (arg=0x2b3a620) at /export/home/pb2/build/sb_0-13622626-1415294505.52/mysqlcom-pro-5.6.23/sql/sql_connect.cc:898
#20 0x0000000000e5f509 in pfs_spawn_thread (arg=0x2c2c580) at /export/home/pb2/build/sb_0-13622626-1415294505.52/mysqlcom-pro-5.6.23/storage/perfschema/pfs.cc:1860
#21 0x0000003deb0079d1 in start_thread (arg=0x7f5f50296700) at pthread_create.c:301
#22 0x0000003deace89dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115
[11 Nov 2014 8:00] 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=0x17c76d8 "bitmap_is_subset(&m_part_info->lock_partitions, &m_locked_partitions)",
    file=0x17c6940 "/pb2/build/sb_0-13559856-1414670154.69/mysqlcom-pro-5.7.6-m16/sql/ha_partition.cc", line=<value optimized out>, function=<value optimized out>) at assert.c:96
#7  0x0000003deac2b810 in __assert_fail (assertion=0x17c76d8 "bitmap_is_subset(&m_part_info->lock_partitions, &m_locked_partitions)",
    file=0x17c6940 "/pb2/build/sb_0-13559856-1414670154.69/mysqlcom-pro-5.7.6-m16/sql/ha_partition.cc", line=3814,
    function=0x17ca900 "virtual int ha_partition::start_stmt(THD*, thr_lock_type)") at assert.c:105
#8  0x00000000013ee1ee in ha_partition::start_stmt (this=0x7fc8e80319d0, thd=0x7fc8e8000d30, lock_type=TL_READ)
    at /pb2/build/sb_0-13559856-1414670154.69/mysqlcom-pro-5.7.6-m16/sql/ha_partition.cc:3814
#9  0x0000000000c397db in check_lock_and_start_stmt (thd=0x7fc8e8000d30, prelocking_ctx=0x7fc8e80030a8, table_list=0x7fc8e80061f8)
    at /pb2/build/sb_0-13559856-1414670154.69/mysqlcom-pro-5.7.6-m16/sql/sql_base.cc:5826
#10 0x0000000000c3ab77 in lock_tables (thd=0x7fc8e8000d30, tables=0x7fc8e80061f8, count=1, flags=0) at /pb2/build/sb_0-13559856-1414670154.69/mysqlcom-pro-5.7.6-m16/sql/sql_base.cc:6375
#11 0x0000000000cf496b in mysql_prepare_and_optimize_select (thd=0x7fc8e8000d30, fields=..., select_options=2149845760, result=0x7fc8e8006830, select_lex=0x7fc8e80054c0,
    free_join=0x7fc92c652d7e) at /pb2/build/sb_0-13559856-1414670154.69/mysqlcom-pro-5.7.6-m16/sql/sql_select.cc:1001
#12 0x0000000000cf4a84 in mysql_select (thd=0x7fc8e8000d30, fields=..., select_options=2149845760, result=0x7fc8e8006830, select_lex=0x7fc8e80054c0)
    at /pb2/build/sb_0-13559856-1414670154.69/mysqlcom-pro-5.7.6-m16/sql/sql_select.cc:1051
#13 0x0000000000cf2f6f in handle_select (thd=0x7fc8e8000d30, result=0x7fc8e8006830, setup_tables_done_option=0)
    at /pb2/build/sb_0-13559856-1414670154.69/mysqlcom-pro-5.7.6-m16/sql/sql_select.cc:97
#14 0x0000000000cbbfbc in execute_sqlcom_select (thd=0x7fc8e8000d30, all_tables=0x7fc8e80061f8) at /pb2/build/sb_0-13559856-1414670154.69/mysqlcom-pro-5.7.6-m16/sql/sql_parse.cc:4998
#15 0x0000000000cb4078 in mysql_execute_command (thd=0x7fc8e8000d30) at /pb2/build/sb_0-13559856-1414670154.69/mysqlcom-pro-5.7.6-m16/sql/sql_parse.cc:2487
#16 0x0000000000cbce6a in mysql_parse (thd=0x7fc8e8000d30, parser_state=0x7fc92c654660) at /pb2/build/sb_0-13559856-1414670154.69/mysqlcom-pro-5.7.6-m16/sql/sql_parse.cc:5397
#17 0x0000000000cb0f2c in dispatch_command (command=COM_QUERY, thd=0x7fc8e8000d30, packet=0x7fc8e8009a61 "SELECT b FROM t1", packet_length=16)
    at /pb2/build/sb_0-13559856-1414670154.69/mysqlcom-pro-5.7.6-m16/sql/sql_parse.cc:1249
#18 0x0000000000cafbd4 in do_command (thd=0x7fc8e8000d30) at /pb2/build/sb_0-13559856-1414670154.69/mysqlcom-pro-5.7.6-m16/sql/sql_parse.cc:833
#19 0x0000000000dbe89c in handle_connection (arg=0x4028870) at /pb2/build/sb_0-13559856-1414670154.69/mysqlcom-pro-5.7.6-m16/sql/conn_handler/connection_handler_per_thread.cc:298
#20 0x000000000138347f in pfs_spawn_thread (arg=0x3e7ee90) at /pb2/build/sb_0-13559856-1414670154.69/mysqlcom-pro-5.7.6-m16/storage/perfschema/pfs.cc:2137
#21 0x0000003deb0079d1 in start_thread (arg=0x7fc92c655700) at pthread_create.c:301
#22 0x0000003deace89dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115
[20 Nov 2019 21:58] Roy Lyseng
Posted by developer:
 
Not reproducible in 5.7.