Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-26334

Assertion map->bitmap, Assertion prebuilt->magic_n == ROW_PREBUILT_ALLOCATED, Assertion !table->file || table->file->inited == handler::NONE, SIGSEGV in bitmap_clear_bit, and SIGSEGV in handler::ha_close

    XMLWordPrintable

    Details

      Description

      CREATE VIEW v AS SELECT 1;
      PREPARE p FROM "SHOW CREATE VIEW v";
      DROP VIEW v;
      CREATE TABLE v ENGINE=InnoDB AS SELECT 1;
      EXECUTE p;
      

      Leads to:

      10.7.0 71ed8c136fa203b9b3a678a6d5cc72235ef73ef7 (Debug)

      mysqld: /test/10.7_dbg/mysys/my_bitmap.c:751: bitmap_lock_clear_bit: Assertion `map->bitmap' failed.
      

      10.7.0 71ed8c136fa203b9b3a678a6d5cc72235ef73ef7 (Debug)

      Core was generated by `/test/MD200721-mariadb-10.7.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      [Current thread is 1 (Thread 0x154a3c16a700 (LWP 1655699))]
      (gdb) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x0000154a52218859 in __GI_abort () at abort.c:79
      #2  0x0000154a52218729 in __assert_fail_base (fmt=0x154a523ae588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55b6c8d20334 "map->bitmap", file=0x55b6c8d20278 "/test/10.7_dbg/mysys/my_bitmap.c", line=751, function=<optimized out>) at assert.c:92
      #3  0x0000154a52229f36 in __GI___assert_fail (assertion=assertion@entry=0x55b6c8d20334 "map->bitmap", file=file@entry=0x55b6c8d20278 "/test/10.7_dbg/mysys/my_bitmap.c", line=line@entry=751, function=function@entry=0x55b6c8d20450 <__PRETTY_FUNCTION__.16877> "bitmap_lock_clear_bit") at assert.c:101
      #4  0x000055b6c88a7c73 in bitmap_lock_clear_bit (map=0x55b6c9384440 <temp_pool>, bitmap_bit=0) at /test/10.7_dbg/mysys/my_bitmap.c:751
      #5  0x000055b6c7e26133 in free_tmp_table (thd=thd@entry=0x154a0c000db8, entry=0x154a0c032978) at /test/10.7_dbg/sql/sql_select.cc:20319
      #6  0x000055b6c7d204ea in close_thread_tables (thd=thd@entry=0x154a0c000db8) at /test/10.7_dbg/sql/sql_base.cc:840
      #7  0x000055b6c7e6b9ef in mysqld_show_create (thd=thd@entry=0x154a0c000db8, table_list=table_list@entry=0x154a0c01eea8) at /test/10.7_dbg/sql/sql_show.cc:1364
      #8  0x000055b6c7dbe981 in mysql_execute_command (thd=0x154a0c000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=true) at /test/10.7_dbg/sql/sql_parse.cc:4371
      #9  0x000055b6c7de8dda in Prepared_statement::execute (this=this@entry=0x154a0c01cdb8, expanded_query=expanded_query@entry=0x154a3c168da0, open_cursor=open_cursor@entry=false) at /test/10.7_dbg/sql/sql_prepare.cc:5184
      #10 0x000055b6c7de914f in Prepared_statement::execute_loop (this=this@entry=0x154a0c01cdb8, expanded_query=expanded_query@entry=0x154a3c168da0, open_cursor=open_cursor@entry=false, packet=packet@entry=0x0, packet_end=packet_end@entry=0x0) at /test/10.7_dbg/sql/sql_prepare.cc:4612
      #11 0x000055b6c7de967f in mysql_sql_stmt_execute (thd=thd@entry=0x154a0c000db8) at /test/10.7_dbg/sql/sql_prepare.cc:3672
      #12 0x000055b6c7dbd94a in mysql_execute_command (thd=thd@entry=0x154a0c000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.7_dbg/sql/sql_parse.cc:3963
      #13 0x000055b6c7da9ead in mysql_parse (thd=thd@entry=0x154a0c000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x154a3c169400) at /test/10.7_dbg/sql/sql_parse.cc:8026
      #14 0x000055b6c7db89f8 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x154a0c000db8, packet=packet@entry=0x154a0c00b749 "", packet_length=packet_length@entry=9, blocking=blocking@entry=true) at /test/10.7_dbg/sql/sql_class.h:1340
      #15 0x000055b6c7dbbe05 in do_command (thd=0x154a0c000db8, blocking=blocking@entry=true) at /test/10.7_dbg/sql/sql_parse.cc:1404
      #16 0x000055b6c7f31f48 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55b6cadadf08, put_in_cache=put_in_cache@entry=true) at /test/10.7_dbg/sql/sql_connect.cc:1410
      #17 0x000055b6c7f3254d in handle_one_connection (arg=arg@entry=0x55b6cadadf08) at /test/10.7_dbg/sql/sql_connect.cc:1312
      #18 0x000055b6c839a5b2 in pfs_spawn_thread (arg=0x55b6cacd6b08) at /test/10.7_dbg/storage/perfschema/pfs.cc:2201
      #19 0x0000154a52727609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #20 0x0000154a52315293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      10.7.0 71ed8c136fa203b9b3a678a6d5cc72235ef73ef7 (Optimized)

      Core was generated by `/test/MD200721-mariadb-10.7.0-linux-x86_64-opt/bin/mysqld --no-defaults --core-'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  0x000055575c91d371 in bitmap_clear_bit (map=0x55575d2bd540 <temp_pool>, 
          bit=<optimized out>) at /test/10.7_opt/include/my_bitmap.h:112
      [Current thread is 1 (Thread 0x14dff4136700 (LWP 1682176))]
      (gdb) bt
      #0  0x000055575c91d371 in bitmap_clear_bit (map=0x55575d2bd540 <temp_pool>, bit=<optimized out>) at /test/10.7_opt/include/my_bitmap.h:112
      #1  bitmap_lock_clear_bit (map=0x55575d2bd540 <temp_pool>, bitmap_bit=<optimized out>) at /test/10.7_opt/mysys/my_bitmap.c:753
      #2  0x000055575c207a9e in free_tmp_table (thd=thd@entry=0x14df88000c58, entry=0x14df880214f8) at /test/10.7_opt/sql/sql_select.cc:20319
      #3  0x000055575c141400 in close_thread_tables (thd=thd@entry=0x14df88000c58) at /test/10.7_opt/sql/sql_base.cc:840
      #4  0x000055575c23685e in mysqld_show_create (thd=thd@entry=0x14df88000c58, table_list=table_list@entry=0x14df8801a988) at /test/10.7_opt/sql/sql_show.cc:1364
      #5  0x000055575c1b86ef in mysql_execute_command (thd=0x14df88000c58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=true) at /test/10.7_opt/sql/sql_parse.cc:4371
      #6  0x000055575c1d75ba in Prepared_statement::execute (this=0x14df88016878, expanded_query=<optimized out>, open_cursor=false) at /test/10.7_opt/sql/sql_prepare.cc:5184
      #7  0x000055575c1d77c9 in Prepared_statement::execute_loop (packet=<optimized out>, packet_end=<optimized out>, open_cursor=<optimized out>, expanded_query=0x14dff4134e90, this=0x14df88016878) at /test/10.7_opt/sql/sql_prepare.cc:4612
      #8  Prepared_statement::execute_loop (this=0x14df88016878, expanded_query=0x14dff4134e90, open_cursor=<optimized out>, packet=<optimized out>, packet_end=<optimized out>) at /test/10.7_opt/sql/sql_prepare.cc:4567
      #9  0x000055575c1d7ac3 in mysql_sql_stmt_execute (thd=thd@entry=0x14df88000c58) at /test/10.7_opt/sql/sql_prepare.cc:3672
      #10 0x000055575c1b917c in mysql_execute_command (thd=0x14df88000c58, is_called_from_prepared_stmt=<optimized out>) at /test/10.7_opt/sql/sql_parse.cc:3963
      #11 0x000055575c1a6d46 in mysql_parse (thd=0x14df88000c58, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /test/10.7_opt/sql/sql_parse.cc:8026
      #12 0x000055575c1b2c35 in dispatch_command (command=COM_QUERY, thd=0x14df88000c58, packet=<optimized out>, packet_length=<optimized out>, blocking=<optimized out>) at /test/10.7_opt/sql/sql_class.h:1340
      #13 0x000055575c1b4b57 in do_command (thd=0x14df88000c58, blocking=blocking@entry=true) at /test/10.7_opt/sql/sql_parse.cc:1404
      #14 0x000055575c2cffe7 in do_handle_one_connection (connect=<optimized out>, put_in_cache=true) at /test/10.7_opt/sql/sql_connect.cc:1410
      #15 0x000055575c2d034d in handle_one_connection (arg=arg@entry=0x55575ec5d958) at /test/10.7_opt/sql/sql_connect.cc:1312
      #16 0x000055575c6222d8 in pfs_spawn_thread (arg=0x55575e899c88) at /test/10.7_opt/storage/perfschema/pfs.cc:2201
      #17 0x000014dff6bc7609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #18 0x000014dff67b5293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      10.4.20 8a2b4d531dc661ee605eeecdfc901bc833f86564 (Debug)

      mysqld: /test/10.4_dbg/sql/sql_base.cc:1035: void close_thread_table(THD*, TABLE**): Assertion `!table->file || table->file->inited == handler::NONE' failed.
      

      10.4.20 8a2b4d531dc661ee605eeecdfc901bc833f86564 (Debug)

      Core was generated by `/test/MD140621-mariadb-10.4.20-linux-x86_64-dbg/bin/mysqld --no-defaults --core'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      [Current thread is 1 (Thread 0x1469900d7700 (LWP 1686921))]
      (gdb) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x00001469a8179859 in __GI_abort () at abort.c:79
      #2  0x00001469a8179729 in __assert_fail_base (fmt=0x1469a830f588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55728c583f60 "!table->file || table->file->inited == handler::NONE", file=0x55728c5838d0 "/test/10.4_dbg/sql/sql_base.cc", line=1035, function=<optimized out>) at assert.c:92
      #3  0x00001469a818af36 in __GI___assert_fail (assertion=assertion@entry=0x55728c583f60 "!table->file || table->file->inited == handler::NONE", file=file@entry=0x55728c5838d0 "/test/10.4_dbg/sql/sql_base.cc", line=line@entry=1035, function=function@entry=0x55728c583f38 "void close_thread_table(THD*, TABLE**)") at assert.c:101
      #4  0x000055728b84fe7c in close_thread_table (thd=thd@entry=0x146948000d90, table_ptr=table_ptr@entry=0x146948000e70) at /test/10.4_dbg/sql/sql_base.cc:1035
      #5  0x000055728b85026b in close_thread_tables (thd=thd@entry=0x146948000d90) at /test/10.4_dbg/sql/sql_base.cc:1020
      #6  0x000055728b974d5b in mysqld_show_create (thd=thd@entry=0x146948000d90, table_list=table_list@entry=0x146948020060) at /test/10.4_dbg/sql/sql_show.cc:1452
      #7  0x000055728b8deee9 in mysql_execute_command (thd=0x146948000d90) at /test/10.4_dbg/sql/sql_parse.cc:4398
      #8  0x000055728b90143f in Prepared_statement::execute (this=this@entry=0x14694800d240, expanded_query=expanded_query@entry=0x1469900d4a80, open_cursor=open_cursor@entry=false) at /test/10.4_dbg/sql/sql_prepare.cc:5004
      #9  0x000055728b90179b in Prepared_statement::execute_loop (this=this@entry=0x14694800d240, expanded_query=expanded_query@entry=0x1469900d4a80, open_cursor=open_cursor@entry=false, packet=packet@entry=0x0, packet_end=packet_end@entry=0x0) at /test/10.4_dbg/sql/sql_prepare.cc:4473
      #10 0x000055728b901ec4 in mysql_sql_stmt_execute (thd=thd@entry=0x146948000d90) at /test/10.4_dbg/sql/sql_prepare.cc:3563
      #11 0x000055728b8dc618 in mysql_execute_command (thd=thd@entry=0x146948000d90) at /test/10.4_dbg/sql/sql_parse.cc:3981
      #12 0x000055728b8e719e in mysql_parse (thd=thd@entry=0x146948000d90, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1469900d6490, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.4_dbg/sql/sql_parse.cc:7992
      #13 0x000055728b8e9b10 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x146948000d90, packet=packet@entry=0x14694801a371 "", packet_length=packet_length@entry=9, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.4_dbg/sql/sql_class.h:1184
      #14 0x000055728b8ed3a6 in do_command (thd=0x146948000d90) at /test/10.4_dbg/sql/sql_parse.cc:1373
      #15 0x000055728ba2ab7a in do_handle_one_connection (connect=connect@entry=0x55728e8ef150) at /test/10.4_dbg/sql/sql_connect.cc:1412
      #16 0x000055728ba2ac99 in handle_one_connection (arg=0x55728e8ef150) at /test/10.4_dbg/sql/sql_connect.cc:1316
      #17 0x00001469a8688609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #18 0x00001469a8276293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      10.4.20 8a2b4d531dc661ee605eeecdfc901bc833f86564 (Optimized)

      Core was generated by `/test/MD140621-mariadb-10.4.20-linux-x86_64-opt/bin/mysqld --no-defaults --core'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  0x0000561ffdc8aa65 in handler::ha_close (this=0x153444023820)
          at /test/10.4_opt/sql/handler.cc:2842
      [Current thread is 1 (Thread 0x1534a71177c0 (LWP 1685597))]
      (gdb) bt
      #0  0x0000561ffdc8aa65 in handler::ha_close (this=0x153444023820) at /test/10.4_opt/sql/handler.cc:2842
      #1  0x0000561ffdb21db9 in closefrm (table=table@entry=0x153444022a28) at /test/10.4_opt/sql/table.cc:4082
      #2  0x0000561ffdc086a5 in intern_close_table (table=0x153444022a28) at /test/10.4_opt/sql/table_cache.cc:221
      #3  tc_purge (mark_flushed=mark_flushed@entry=true) at /test/10.4_opt/sql/table_cache.cc:334
      #4  0x0000561ffd9f230c in purge_tables (purge_flag=purge_flag@entry=true) at /test/10.4_opt/sql/sql_base.cc:335
      #5  0x0000561ffdc06396 in tdc_start_shutdown () at /test/10.4_opt/sql/table_cache.cc:657
      #6  0x0000561ffd98e24d in clean_up (print_message=print_message@entry=true) at /test/10.4_opt/sql/mysqld.cc:1959
      #7  0x0000561ffd99968d in clean_up (print_message=true) at /test/10.4_opt/sql/mysqld.cc:5921
      #8  mysqld_main (argc=<optimized out>, argv=<optimized out>) at /test/10.4_opt/sql/mysqld.cc:5921
      #9  0x00001534a72d50b3 in __libc_start_main (main=0x561ffd974130 <main(int, char**)>, argc=10, argv=0x7ffcaaea68b8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffcaaea68a8) at ../csu/libc-start.c:308
      #10 0x0000561ffd98c8ae in _start () at /test/10.4_opt/sql/mysqld.cc:4651
      

      10.3.30 75a65d3201a4486af96cf3277b6c5a4ba460eef7 (Optimized)

      InnoDB: Failing assertion: prebuilt->magic_n == ROW_PREBUILT_ALLOCATED
      

      10.3.30 75a65d3201a4486af96cf3277b6c5a4ba460eef7 (Optimized)

      Core was generated by `/test/MD140621-mariadb-10.3.30-linux-x86_64-opt/bin/mysqld --no-defaults --core'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      [Current thread is 1 (Thread 0x14e2340a9700 (LWP 1698376))]
      (gdb) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x000014e23f6aa859 in __GI_abort () at abort.c:79
      #2  0x00005576d9e11837 in ut_dbg_assertion_failed (expr=expr@entry=0x5576da8591d0 "prebuilt->magic_n == ROW_PREBUILT_ALLOCATED", file=file@entry=0x5576da858d18 "/test/10.3_opt/storage/innobase/row/row0mysql.cc", line=line@entry=980) at /test/10.3_opt/storage/innobase/ut/ut0dbg.cc:60
      #3  0x00005576d9dfda0b in row_prebuilt_free (prebuilt=<optimized out>, dict_locked=dict_locked@entry=0) at /test/10.3_opt/storage/innobase/row/row0mysql.cc:980
      #4  0x00005576da2a3fae in ha_innobase::close (this=0x14e1dc01e160) at /test/10.3_opt/storage/innobase/handler/ha_innodb.cc:6558
      #5  0x00005576d9fcb3b9 in closefrm (table=table@entry=0x14e1dc022a68) at /test/10.3_opt/sql/table.cc:3674
      #6  0x00005576da091225 in intern_close_table (table=0x14e1dc022a68) at /test/10.3_opt/sql/table_cache.cc:222
      #7  tc_purge (mark_flushed=mark_flushed@entry=true) at /test/10.3_opt/sql/table_cache.cc:335
      #8  0x00005576d9eaee07 in close_cached_tables (thd=thd@entry=0x0, tables=tables@entry=0x0, wait_for_refresh=wait_for_refresh@entry=false, timeout=timeout@entry=31536000) at /test/10.3_opt/sql/sql_base.cc:377
      #9  0x00005576da08ec7c in tdc_start_shutdown () at /test/10.3_opt/sql/table_cache.cc:660
      #10 0x00005576d9e4c85b in clean_up (print_message=print_message@entry=true) at /test/10.3_opt/sql/mysqld.cc:2239
      #11 0x00005576d9e4d105 in clean_up (print_message=true) at /test/10.3_opt/sql/mysqld.cc:2209
      #12 unireg_end () at /test/10.3_opt/sql/mysqld.cc:2114
      #13 0x00005576d9e4fc73 in kill_server (sig_ptr=0x0) at /test/10.3_opt/sql/mysqld.cc:2041
      #14 0x00005576d9e502b2 in kill_server_thread (arg=<optimized out>) at /test/10.3_opt/sql/mysqld.cc:2064
      #15 0x000014e23f880609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #16 0x000014e23f7a7293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.2.39 (dbg), 10.2.39 (opt), 10.3.30 (dbg), 10.3.30 (opt), 10.4.20 (dbg), 10.4.20 (opt), 10.5.11 (dbg), 10.5.11 (opt), 10.6.4 (dbg), 10.6.4 (opt), 10.7.0 (dbg), 10.7.0 (opt)

      Bug (or feature/syntax) confirmed not present in:
      MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.34 (dbg), 5.7.34 (opt), 8.0.24 (dbg), 8.0.24 (opt)

      Looking at the stacks, something changed in 10.4 in this area, and again in 10.5.

        Attachments

          Activity

            People

            Assignee:
            sanja Oleksandr Byelkin
            Reporter:
            Roel Roel Van de Paar
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:

                Git Integration