[MDEV-7048] MySQL#74504 - Assertion `map->bitmap && map2->bitmap && map->n_bits==map2->n_bits' failed in bitmap_union Created: 2014-11-08  Updated: 2022-09-08

Status: Open
Project: MariaDB Server
Component/s: OTHER
Affects Version/s: 10.0
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: upstream

Attachments: File mysql.err     File mysqld.log    
Issue Links:
Relates
relates to MDEV-7057 Track most important upstream bugs wh... Closed

 Description   

Initially reported by Ramesh Sivaraman as http://bugs.mysql.com/bug.php?id=74504, adding here to make it searchable in Jira and to preserve the test case.

CREATE TABLE t1(a int)PARTITION BY KEY (a) (PARTITION x0,PARTITION x1);
lock tables t1 write,t1 as t0 write,t1 as t2 read;
ALTER TABLE t1 MODIFY a CHAR(1)CHARACTER SET ucs2 COLLATE ucs2_czech_ci;
ALTER TABLE t1 COALESCE PARTITION 1;

10.0/mysys/my_bitmap.c:560: bitmap_union: Assertion `map->bitmap && map2->bitmap && map->n_bits==map2->n_bits' failed.
141108 17:54:58 [ERROR] mysqld got signal 6 ;

#6  0x00007fc1aa22c6f1 in *__GI___assert_fail (assertion=0x113ef10 "map->bitmap && map2->bitmap && map->n_bits==map2->n_bits", file=<optimized out>, line=560, function=0x113f039 "bitmap_union") at assert.c:81
#7  0x0000000000e390a8 in bitmap_union (map=0x7fc196c7eef8, map2=0x7fc196e4b5d0) at 10.0/mysys/my_bitmap.c:559
#8  0x0000000000e11310 in ha_partition::external_lock (this=0x7fc196c7e888, thd=0x7fc1a3f0b070, lock_type=1) at 10.0/sql/ha_partition.cc:3783
#9  0x000000000087467c in handler::ha_external_lock (this=0x7fc196c7e888, thd=0x7fc1a3f0b070, lock_type=1) at 10.0/sql/handler.cc:5890
#10 0x000000000094a78c in lock_external (thd=0x7fc1a3f0b070, tables=0x7fc196ce2d58, count=1) at 10.0/sql/lock.cc:359
#11 0x000000000094a4e0 in mysql_lock_tables (thd=0x7fc1a3f0b070, sql_lock=0x7fc196ce2d30, flags=2155) at 10.0/sql/lock.cc:309
#12 0x000000000094a3f1 in mysql_lock_tables (thd=0x7fc1a3f0b070, tables=0x7fc196f20258, count=1, flags=2155) at 10.0/sql/lock.cc:276
#13 0x000000000061c24f in Locked_tables_list::reopen_tables (this=0x7fc1a3f0ebe8, thd=0x7fc1a3f0b070) at 10.0/sql/sql_base.cc:2964
#14 0x00000000009d9de9 in handle_alter_part_error (lpt=0x7fc1ac1adaa0, action_completed=true, drop_partition=false, frm_install=false, close_table=false) at 10.0/sql/sql_partition.cc:6770
#15 0x00000000009db000 in fast_alter_partition_table (thd=0x7fc1a3f0b070, table=0x7fc196c9fc70, alter_info=0x7fc1ac1af390, create_info=0x7fc1ac1af420, table_list=0x7fc196e1d180, db=0x7fc196e1d758 "test", table_name=0x7fc196e1d148 "t1") at 10.0/sql/sql_partition.cc:7181
#16 0x0000000000730735 in mysql_alter_table (thd=0x7fc1a3f0b070, new_db=0x7fc196e1d758 "test", new_name=0x0, create_info=0x7fc1ac1af420, table_list=0x7fc196e1d180, alter_info=0x7fc1ac1af390, order_num=0, order=0x0, ignore=false) at 10.0/sql/sql_table.cc:8518
#17 0x0000000000798d74 in Sql_cmd_alter_table::execute (this=0x7fc196e1d768, thd=0x7fc1a3f0b070) at 10.0/sql/sql_alter.cc:312
#18 0x00000000006827c8 in mysql_execute_command (thd=0x7fc1a3f0b070) at 10.0/sql/sql_parse.cc:5078
#19 0x000000000068586f in mysql_parse (thd=0x7fc1a3f0b070, rawbuf=0x7fc196e1d088 "ALTER TABLE t1 COALESCE PARTITION 1", length=35, parser_state=0x7fc1ac1b0630) at 10.0/sql/sql_parse.cc:6407
#20 0x0000000000678652 in dispatch_command (command=COM_QUERY, thd=0x7fc1a3f0b070, packet=0x7fc198ff2071 "ALTER TABLE t1 COALESCE PARTITION 1", packet_length=35) at 10.0/sql/sql_parse.cc:1299
#21 0x00000000006779f7 in do_command (thd=0x7fc1a3f0b070) at 10.0/sql/sql_parse.cc:996
#22 0x00000000007944aa in do_handle_one_connection (thd_arg=0x7fc1a3f0b070) at 10.0/sql/sql_connect.cc:1379
#23 0x00000000007941fd in handle_one_connection (arg=0x7fc1a3f0b070) at 10.0/sql/sql_connect.cc:1293
#24 0x0000000000ccb4a6 in pfs_spawn_thread (arg=0x7fc1a3fd9df0) at 10.0/storage/perfschema/pfs.cc:1860
#25 0x00007fc1abde5b50 in start_thread (arg=<optimized out>) at pthread_create.c:304
#26 0x00007fc1aa2dd20d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112

bzr version-info
revision-id: sergii@pisem.net-20141103164737-457hfby1eg82zol9
date: 2014-11-03 17:47:37 +0100
build-date: 2014-11-08 18:03:42 +0400
revno: 4471
branch-nick: 10.0



 Comments   
Comment by Daniel Black [ 2017-12-30 ]

In 10.3.4 this no longer crashes however it does stall indefineately in the setup phase:

MariaDB [test]> show processlist;
+----+-------------+-----------+------+---------+------+--------------------------+-------------------------------------+----------+
| Id | User        | Host      | db   | Command | Time | State                    | Info                                | Progress |
+----+-------------+-----------+------+---------+------+--------------------------+-------------------------------------+----------+
|  1 | system user |           | NULL | Daemon  | NULL | InnoDB purge coordinator | NULL                                |    0.000 |
|  2 | system user |           | NULL | Daemon  | NULL | InnoDB purge worker      | NULL                                |    0.000 |
|  3 | system user |           | NULL | Daemon  | NULL | InnoDB purge worker      | NULL                                |    0.000 |
|  4 | system user |           | NULL | Daemon  | NULL | InnoDB purge worker      | NULL                                |    0.000 |
|  5 | system user |           | NULL | Daemon  | NULL | InnoDB shutdown handler  | NULL                                |    0.000 |
| 23 | root        | localhost | test | Query   |    0 | Init                     | show processlist                    |    0.000 |
| 26 | root        | localhost | test | Query   |  396 | Setup                    | ALTER TABLE t1 COALESCE PARTITION 1 |    0.000 |
+----+-------------+-----------+------+---------+------+--------------------------+-------------------------------------+----------+

mysqld.log attached is a gdb bt all. mysql.err is the mysql log.

Thread 32 (Thread 0x7ff3212f5700 (LWP 17004)):
#0  0x00007ff32883ac8d in nanosleep () at ../sysdeps/unix/syscall-template.S:84
#1  0x000055ae089d6b2c in os_thread_sleep (tm=tm@entry=20000) at /home/dan/software_projects/mariadb-server/storage/innobase/os/os0thread.cc:230
#2  0x000055ae08a23bff in fil_wait_crypt_bg_threads (table=0x7ff2a4037dc0) at /home/dan/software_projects/mariadb-server/storage/innobase/row/row0mysql.cc:3396
#3  row_drop_table_for_mysql (name=name@entry=0x7ff3212eff70 "test/t1#P#x0", trx=trx@entry=0x7ff3213d5908, drop_db=<optimized out>, create_failed=create_failed@entry=0, 
    nonatomic=<optimized out>, nonatomic@entry=true) at /home/dan/software_projects/mariadb-server/storage/innobase/row/row0mysql.cc:3759
#4  0x000055ae08979c56 in ha_innobase::delete_table (this=<optimized out>, name=0x7ff3212f0630 "./test/t1#P#x0")
    at /home/dan/software_projects/mariadb-server/storage/innobase/handler/ha_innodb.cc:13405
#5  0x000055ae08c95073 in ha_partition::rename_partitions (this=<optimized out>, path=0x7ff3212f0b60 "./test/t1") at /home/dan/software_projects/mariadb-server/sql/ha_partition.cc:1061
#6  0x000055ae0892a8a1 in mysql_rename_partitions (lpt=0x7ff3212f08e0) at /home/dan/software_projects/mariadb-server/sql/sql_partition.cc:5537
#7  fast_alter_partition_table (thd=thd@entry=0x7ff2a40009a8, table=table@entry=0x7ff2a4029548, alter_info=alter_info@entry=0x7ff3212f2640, create_info=create_info@entry=0x7ff3212f26f0, 
    table_list=0x7ff2a40114e8, db=<optimized out>, table_name=0x7ff2a40114b0 "t1") at /home/dan/software_projects/mariadb-server/sql/sql_partition.cc:6891
#8  0x000055ae086c7d52 in mysql_alter_table (thd=thd@entry=0x7ff2a40009a8, new_db=<optimized out>, new_name=<optimized out>, create_info=create_info@entry=0x7ff3212f26f0, 
    table_list=<optimized out>, table_list@entry=0x7ff2a40114e8, alter_info=alter_info@entry=0x7ff3212f2640, order_num=0, order=0x0, ignore=false)
    at /home/dan/software_projects/mariadb-server/sql/sql_table.cc:9106
#9  0x000055ae0870f39d in Sql_cmd_alter_table::execute (this=<optimized out>, thd=0x7ff2a40009a8) at /home/dan/software_projects/mariadb-server/sql/sql_alter.cc:325
#10 0x000055ae08647796 in mysql_execute_command (thd=thd@entry=0x7ff2a40009a8) at /home/dan/software_projects/mariadb-server/sql/sql_parse.cc:6251
#11 0x000055ae0864ed1d in mysql_parse (thd=0x7ff2a40009a8, rawbuf=<optimized out>, length=35, parser_state=0x7ff3212f44f0, is_com_multi=<optimized out>, is_next_command=<optimized out>)
    at /home/dan/software_projects/mariadb-server/sql/sql_parse.cc:7966
#12 0x000055ae0865185f in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7ff2a40009a8, packet=packet@entry=0x7ff2a4009119 "ALTER TABLE t1 COALESCE PARTITION 1", 
    packet_length=packet_length@entry=35, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false)
    at /home/dan/software_projects/mariadb-server/sql/sql_parse.cc:1824
#13 0x000055ae08652111 in do_command (thd=0x7ff2a40009a8) at /home/dan/software_projects/mariadb-server/sql/sql_parse.cc:1368
#14 0x000055ae0870c754 in do_handle_one_connection (connect=connect@entry=0x55ae0bd1a438) at /home/dan/software_projects/mariadb-server/sql/sql_connect.cc:1420
#15 0x000055ae0870c8c4 in handle_one_connection (arg=0x55ae0bd1a438) at /home/dan/software_projects/mariadb-server/sql/sql_connect.cc:1326
#16 0x00007ff32883173a in start_thread (arg=0x7ff3212f5700) at pthread_create.c:333
#17 0x00007ff3266f3e7f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97

Generated at Thu Feb 08 07:16:34 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.