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

Server crash in MDL_ticket::has_stronger_or_equal_type or Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db.str, table->table_name.str, MDL_SHARED)' failed in mysql_rm_table_no_locks

Details

    Description

      CREATE TABLE t1 (a INT);
      CREATE TEMPORARY TABLE tmp (b INT);
      LOCK TABLE t1 READ;
      --error ER_UNKNOWN_SEQUENCES
      DROP SEQUENCE tmp;
       
      # Cleanup
      UNLOCK TABLES;
      DROP TABLE t1;
      

      10.3 a2335b79

      mysqld: /data/src/10.3/sql/sql_table.cc:2395: int mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool, bool): Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db.str, table->table_name.str, MDL_SHARED)' failed.
      190417 19:02:21 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f1437b17ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      #8  0x0000562c267cde8c in mysql_rm_table_no_locks (thd=0x7f1420000b00, tables=0x7f1420014db8, if_exists=false, drop_temporary=false, drop_view=false, drop_sequence=true, dont_log_query=false, dont_free_locks=false) at /data/src/10.3/sql/sql_table.cc:2393
      #9  0x0000562c267cd494 in mysql_rm_table (thd=0x7f1420000b00, tables=0x7f1420014db8, if_exists=false, drop_temporary=false, drop_sequence=true) at /data/src/10.3/sql/sql_table.cc:2124
      #10 0x0000562c26706f53 in mysql_execute_command (thd=0x7f1420000b00) at /data/src/10.3/sql/sql_parse.cc:5055
      #11 0x0000562c26710781 in mysql_parse (thd=0x7f1420000b00, rawbuf=0x7f1420014ce8 "DROP SEQUENCE tmp", length=17, parser_state=0x7f1431cbe5f0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:8091
      #12 0x0000562c266fda50 in dispatch_command (command=COM_QUERY, thd=0x7f1420000b00, packet=0x7f142000b1f1 "DROP SEQUENCE tmp", packet_length=17, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1857
      #13 0x0000562c266fc43a in do_command (thd=0x7f1420000b00) at /data/src/10.3/sql/sql_parse.cc:1403
      #14 0x0000562c2686503d in do_handle_one_connection (connect=0x562c2909f0b0) at /data/src/10.3/sql/sql_connect.cc:1402
      #15 0x0000562c26864dc1 in handle_one_connection (arg=0x562c2909f0b0) at /data/src/10.3/sql/sql_connect.cc:1308
      #16 0x0000562c26d016a3 in pfs_spawn_thread (arg=0x562c28fe3f50) at /data/src/10.3/storage/perfschema/pfs.cc:1862
      #17 0x00007f1439c0c494 in start_thread (arg=0x7f1431cbf700) at pthread_create.c:333
      #18 0x00007f1437bd493f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      No obvious problems on a non-debug build with the test case above, but here is another one which does cause a crash on a non-debug build (and the same assertion failure on a debug build):

      CREATE TABLE t (a INT);
      CREATE TEMPORARY TABLE s (f INT);
      CREATE SEQUENCE s;
      LOCK TABLE t WRITE;
      DROP SEQUENCE s;
       
      # Cleanup
      UNLOCK TABLES;
      DROP TABLE t;
      

      10.3 a2335b79 non-debug

      #2  <signal handler called>
      #3  0x000055ca45f79e0c in MDL_ticket::has_stronger_or_equal_type (this=this@entry=0x0, type=type@entry=MDL_EXCLUSIVE) at /data/src/10.3/sql/mdl.cc:1720
      #4  0x000055ca45f7bd60 in MDL_context::upgrade_shared_lock (this=this@entry=0x7f3670000ac8, mdl_ticket=0x0, new_type=new_type@entry=MDL_EXCLUSIVE, lock_wait_timeout=86400) at /data/src/10.3/sql/mdl.cc:2330
      #5  0x000055ca45e3ede5 in wait_while_table_is_used (thd=thd@entry=0x7f36700009a8, table=0x7f367006bf78, function=function@entry=HA_EXTRA_NOT_USED) at /data/src/10.3/sql/sql_base.cc:1246
      #6  0x000055ca45f1aeb7 in mysql_rm_table_no_locks (thd=0x7f36700009a8, tables=<optimized out>, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_view=<optimized out>, drop_sequence=<optimized out>, dont_log_query=false, dont_free_locks=false) at /data/src/10.3/sql/sql_table.cc:2487
      #7  0x000055ca45f1c055 in mysql_rm_table (thd=0x7f36700009a8, tables=0x7f3670011758, if_exists=false, drop_temporary=3, drop_sequence=false) at /data/src/10.3/sql/sql_table.cc:2124
      #8  0x000055ca45e992fb in mysql_execute_command (thd=0x7f36700009a8) at /data/src/10.3/sql/sql_parse.cc:5055
      #9  0x000055ca45e9d8e1 in mysql_parse (thd=0x7f36700009a8, rawbuf=<optimized out>, length=15, parser_state=0x7f368139f630, is_com_multi=<optimized out>, is_next_command=<optimized out>) at /data/src/10.3/sql/sql_parse.cc:8091
      #10 0x000055ca45ea0028 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7f36700009a8, packet=packet@entry=0x7f3670009329 "DROP SEQUENCE s", packet_length=packet_length@entry=15, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/src/10.3/sql/sql_parse.cc:1857
      #11 0x000055ca45ea09e0 in do_command (thd=0x7f36700009a8) at /data/src/10.3/sql/sql_parse.cc:1403
      #12 0x000055ca45f73994 in do_handle_one_connection (connect=connect@entry=0x55ca49089f08) at /data/src/10.3/sql/sql_connect.cc:1402
      #13 0x000055ca45f73b34 in handle_one_connection (arg=arg@entry=0x55ca49089f08) at /data/src/10.3/sql/sql_connect.cc:1308
      #14 0x000055ca46258614 in pfs_spawn_thread (arg=0x55ca4908a168) at /data/src/10.3/storage/perfschema/pfs.cc:1862
      #15 0x00007f36892ef494 in start_thread (arg=0x7f36813a0700) at pthread_create.c:333
      #16 0x00007f36872b793f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      Attachments

        Issue Links

          Activity

            elenst Elena Stepanova created issue -
            elenst Elena Stepanova made changes -
            Field Original Value New Value
            Description {code:sql}
            CREATE TABLE t1 (a INT);
            CREATE TEMPORARY TABLE tmp (b INT);
            LOCK TABLE t1 READ;
            --error ER_UNKNOWN_SEQUENCES
            DROP SEQUENCE tmp;

            # Cleanup
            UNLOCK TABLES;
            DROP TABLE t1;
            {code}

            {noformat:title=10.3 a2335b79}
            mysqld: /data/src/10.3/sql/sql_table.cc:2395: int mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool, bool): Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db.str, table->table_name.str, MDL_SHARED)' failed.
            190417 19:02:21 [ERROR] mysqld got signal 6 ;

            #7 0x00007f1437b17ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
            #8 0x0000562c267cde8c in mysql_rm_table_no_locks (thd=0x7f1420000b00, tables=0x7f1420014db8, if_exists=false, drop_temporary=false, drop_view=false, drop_sequence=true, dont_log_query=false, dont_free_locks=false) at /data/src/10.3/sql/sql_table.cc:2393
            #9 0x0000562c267cd494 in mysql_rm_table (thd=0x7f1420000b00, tables=0x7f1420014db8, if_exists=false, drop_temporary=false, drop_sequence=true) at /data/src/10.3/sql/sql_table.cc:2124
            #10 0x0000562c26706f53 in mysql_execute_command (thd=0x7f1420000b00) at /data/src/10.3/sql/sql_parse.cc:5055
            #11 0x0000562c26710781 in mysql_parse (thd=0x7f1420000b00, rawbuf=0x7f1420014ce8 "DROP SEQUENCE tmp", length=17, parser_state=0x7f1431cbe5f0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:8091
            #12 0x0000562c266fda50 in dispatch_command (command=COM_QUERY, thd=0x7f1420000b00, packet=0x7f142000b1f1 "DROP SEQUENCE tmp", packet_length=17, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1857
            #13 0x0000562c266fc43a in do_command (thd=0x7f1420000b00) at /data/src/10.3/sql/sql_parse.cc:1403
            #14 0x0000562c2686503d in do_handle_one_connection (connect=0x562c2909f0b0) at /data/src/10.3/sql/sql_connect.cc:1402
            #15 0x0000562c26864dc1 in handle_one_connection (arg=0x562c2909f0b0) at /data/src/10.3/sql/sql_connect.cc:1308
            #16 0x0000562c26d016a3 in pfs_spawn_thread (arg=0x562c28fe3f50) at /data/src/10.3/storage/perfschema/pfs.cc:1862
            #17 0x00007f1439c0c494 in start_thread (arg=0x7f1431cbf700) at pthread_create.c:333
            #18 0x00007f1437bd493f in clone () from /lib/x86_64-linux-gnu/libc.so.6
            {noformat}

            No obvious problems on a non-debug build.
            {code:sql}
            CREATE TABLE t1 (a INT);
            CREATE TEMPORARY TABLE tmp (b INT);
            LOCK TABLE t1 READ;
            --error ER_UNKNOWN_SEQUENCES
            DROP SEQUENCE tmp;

            # Cleanup
            UNLOCK TABLES;
            DROP TABLE t1;
            {code}

            {noformat:title=10.3 a2335b79}
            mysqld: /data/src/10.3/sql/sql_table.cc:2395: int mysql_rm_table_no_locks(THD*, TABLE_LIST*, bool, bool, bool, bool, bool, bool): Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db.str, table->table_name.str, MDL_SHARED)' failed.
            190417 19:02:21 [ERROR] mysqld got signal 6 ;

            #7 0x00007f1437b17ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
            #8 0x0000562c267cde8c in mysql_rm_table_no_locks (thd=0x7f1420000b00, tables=0x7f1420014db8, if_exists=false, drop_temporary=false, drop_view=false, drop_sequence=true, dont_log_query=false, dont_free_locks=false) at /data/src/10.3/sql/sql_table.cc:2393
            #9 0x0000562c267cd494 in mysql_rm_table (thd=0x7f1420000b00, tables=0x7f1420014db8, if_exists=false, drop_temporary=false, drop_sequence=true) at /data/src/10.3/sql/sql_table.cc:2124
            #10 0x0000562c26706f53 in mysql_execute_command (thd=0x7f1420000b00) at /data/src/10.3/sql/sql_parse.cc:5055
            #11 0x0000562c26710781 in mysql_parse (thd=0x7f1420000b00, rawbuf=0x7f1420014ce8 "DROP SEQUENCE tmp", length=17, parser_state=0x7f1431cbe5f0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:8091
            #12 0x0000562c266fda50 in dispatch_command (command=COM_QUERY, thd=0x7f1420000b00, packet=0x7f142000b1f1 "DROP SEQUENCE tmp", packet_length=17, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1857
            #13 0x0000562c266fc43a in do_command (thd=0x7f1420000b00) at /data/src/10.3/sql/sql_parse.cc:1403
            #14 0x0000562c2686503d in do_handle_one_connection (connect=0x562c2909f0b0) at /data/src/10.3/sql/sql_connect.cc:1402
            #15 0x0000562c26864dc1 in handle_one_connection (arg=0x562c2909f0b0) at /data/src/10.3/sql/sql_connect.cc:1308
            #16 0x0000562c26d016a3 in pfs_spawn_thread (arg=0x562c28fe3f50) at /data/src/10.3/storage/perfschema/pfs.cc:1862
            #17 0x00007f1439c0c494 in start_thread (arg=0x7f1431cbf700) at pthread_create.c:333
            #18 0x00007f1437bd493f in clone () from /lib/x86_64-linux-gnu/libc.so.6
            {noformat}

            No obvious problems on a non-debug build with the test case above, but here is another one which does cause a crash on a non-debug build (and the same assertion failure on a debug build):

            {code:sql}
            CREATE TABLE t (a INT);
            CREATE TEMPORARY TABLE s (f INT);
            CREATE SEQUENCE s;
            LOCK TABLE t WRITE;
            DROP SEQUENCE s;

            # Cleanup
            UNLOCK TABLES;
            DROP TABLE t;
            {code}

            {noformat:title=10.3 a2335b79 non-debug}
            #2 <signal handler called>
            #3 0x000055ca45f79e0c in MDL_ticket::has_stronger_or_equal_type (this=this@entry=0x0, type=type@entry=MDL_EXCLUSIVE) at /data/src/10.3/sql/mdl.cc:1720
            #4 0x000055ca45f7bd60 in MDL_context::upgrade_shared_lock (this=this@entry=0x7f3670000ac8, mdl_ticket=0x0, new_type=new_type@entry=MDL_EXCLUSIVE, lock_wait_timeout=86400) at /data/src/10.3/sql/mdl.cc:2330
            #5 0x000055ca45e3ede5 in wait_while_table_is_used (thd=thd@entry=0x7f36700009a8, table=0x7f367006bf78, function=function@entry=HA_EXTRA_NOT_USED) at /data/src/10.3/sql/sql_base.cc:1246
            #6 0x000055ca45f1aeb7 in mysql_rm_table_no_locks (thd=0x7f36700009a8, tables=<optimized out>, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_view=<optimized out>, drop_sequence=<optimized out>, dont_log_query=false, dont_free_locks=false) at /data/src/10.3/sql/sql_table.cc:2487
            #7 0x000055ca45f1c055 in mysql_rm_table (thd=0x7f36700009a8, tables=0x7f3670011758, if_exists=false, drop_temporary=3, drop_sequence=false) at /data/src/10.3/sql/sql_table.cc:2124
            #8 0x000055ca45e992fb in mysql_execute_command (thd=0x7f36700009a8) at /data/src/10.3/sql/sql_parse.cc:5055
            #9 0x000055ca45e9d8e1 in mysql_parse (thd=0x7f36700009a8, rawbuf=<optimized out>, length=15, parser_state=0x7f368139f630, is_com_multi=<optimized out>, is_next_command=<optimized out>) at /data/src/10.3/sql/sql_parse.cc:8091
            #10 0x000055ca45ea0028 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7f36700009a8, packet=packet@entry=0x7f3670009329 "DROP SEQUENCE s", packet_length=packet_length@entry=15, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/src/10.3/sql/sql_parse.cc:1857
            #11 0x000055ca45ea09e0 in do_command (thd=0x7f36700009a8) at /data/src/10.3/sql/sql_parse.cc:1403
            #12 0x000055ca45f73994 in do_handle_one_connection (connect=connect@entry=0x55ca49089f08) at /data/src/10.3/sql/sql_connect.cc:1402
            #13 0x000055ca45f73b34 in handle_one_connection (arg=arg@entry=0x55ca49089f08) at /data/src/10.3/sql/sql_connect.cc:1308
            #14 0x000055ca46258614 in pfs_spawn_thread (arg=0x55ca4908a168) at /data/src/10.3/storage/perfschema/pfs.cc:1862
            #15 0x00007f36892ef494 in start_thread (arg=0x7f36813a0700) at pthread_create.c:333
            #16 0x00007f36872b793f in clone () from /lib/x86_64-linux-gnu/libc.so.6
            {noformat}
            Summary Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db.str, table->table_name.str, MDL_SHARED)' failed in mysql_rm_table_no_locks Server crash in MDL_ticket::has_stronger_or_equal_type or Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db.str, table->table_name.str, MDL_SHARED)' failed in mysql_rm_table_no_locks
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            Labels affects-tests

            I suppose this failure has the same root cause – at least whenever I try to reproduce it, I get one of those in the description instead.

            #5  <signal handler called>
            #6  0x000055bb000bb065 in I_P_List<MDL_ticket, I_P_List_adapter<MDL_ticket, &MDL_ticket::next_in_lock, &MDL_ticket::prev_in_lock>, I_P_List_null_counter, I_P_List_fast_push_back<MDL_ticket> >::remove (this=0x55bb02a03de8, a=0
            x7fa84c228c50) at /home/elenst/src/10.3-enterprise/sql/sql_plist.h:126
            #7  0x000055bb000b68b7 in MDL_lock::Ticket_list::remove_ticket (this=0x55bb02a03de8, ticket=0x7fa84c228c50) at /home/elenst/src/10.3-enterprise/sql/mdl.cc:1278
            #8  0x000055bb000b6e68 in MDL_lock::remove_ticket (this=0x55bb02a03be0, pins=0x55bb02a25450, list=&MDL_lock::m_granted, ticket=0x7fa84c228c50) at /home/elenst/src/10.3-enterprise/sql/mdl.cc:1826
            #9  0x000055bb000b8eda in MDL_context::release_lock (this=0x7fa84c000c20, duration=MDL_STATEMENT, ticket=0x7fa84c228c50) at /home/elenst/src/10.3-enterprise/sql/mdl.cc:2832
            #10 0x000055bb000b90b3 in MDL_context::release_locks_stored_before (this=0x7fa84c000c20, duration=MDL_STATEMENT, sentinel=0x0) at /home/elenst/src/10.3-enterprise/sql/mdl.cc:2882
            #11 0x000055bb000b97bc in MDL_context::release_transactional_locks (this=0x7fa84c000c20) at /home/elenst/src/10.3-enterprise/sql/mdl.cc:3063
            #12 0x000055bafff3eaad in mysql_execute_command (thd=0x7fa84c000b00) at /home/elenst/src/10.3-enterprise/sql/sql_parse.cc:6192
            #13 0x000055bafff63388 in Prepared_statement::execute (this=0x7fa84c4b9550, expanded_query=0x7fa8b82f0240, open_cursor=false) at /home/elenst/src/10.3-enterprise/sql/sql_prepare.cc:4900
            #14 0x000055bafff61572 in Prepared_statement::execute_loop (this=0x7fa84c4b9550, expanded_query=0x7fa8b82f0240, open_cursor=false, packet=0x7fa84c008d3a "", packet_end=0x7fa84c008d3a "") at /home/elenst/src/10.3-enterprise/sq
            l/sql_prepare.cc:4312
            #15 0x000055bafff5ebee in mysql_stmt_execute_common (thd=0x7fa84c000b00, stmt_id=4148, packet=0x7fa84c008d3a "", packet_end=0x7fa84c008d3a "", cursor_flags=0, bulk_op=false, read_types=false) at /home/elenst/src/10.3-enterpri
            se/sql/sql_prepare.cc:3283
            #16 0x000055bafff5e710 in mysqld_stmt_execute (thd=0x7fa84c000b00, packet_arg=0x7fa84c008d31 "4\020", packet_length=9) at /home/elenst/src/10.3-enterprise/sql/sql_prepare.cc:3174
            #17 0x000055bafff2fe9c in dispatch_command (command=COM_STMT_EXECUTE, thd=0x7fa84c000b00, packet=0x7fa84c008d31 "4\020", packet_length=9, is_com_multi=false, is_next_command=false) at /home/elenst/src/10.3-enterprise/sql/sql_parse.cc:1799
            #18 0x000055bafff2eb6d in do_command (thd=0x7fa84c000b00) at /home/elenst/src/10.3-enterprise/sql/sql_parse.cc:1403
            #19 0x000055bb000ac733 in do_handle_one_connection (connect=0x55bb0381a500) at /home/elenst/src/10.3-enterprise/sql/sql_connect.cc:1403
            #20 0x000055bb000ac475 in handle_one_connection (arg=0x55bb0381a500) at /home/elenst/src/10.3-enterprise/sql/sql_connect.cc:1308
            #21 0x00007fa8d6c4cdd5 in start_thread () from /lib64/libpthread.so.0
            #22 0x00007fa8d4830ead in clone () from /lib64/libc.so.6
            

            elenst Elena Stepanova added a comment - I suppose this failure has the same root cause – at least whenever I try to reproduce it, I get one of those in the description instead. #5 <signal handler called> #6 0x000055bb000bb065 in I_P_List<MDL_ticket, I_P_List_adapter<MDL_ticket, &MDL_ticket::next_in_lock, &MDL_ticket::prev_in_lock>, I_P_List_null_counter, I_P_List_fast_push_back<MDL_ticket> >::remove (this=0x55bb02a03de8, a=0 x7fa84c228c50) at /home/elenst/src/10.3-enterprise/sql/sql_plist.h:126 #7 0x000055bb000b68b7 in MDL_lock::Ticket_list::remove_ticket (this=0x55bb02a03de8, ticket=0x7fa84c228c50) at /home/elenst/src/10.3-enterprise/sql/mdl.cc:1278 #8 0x000055bb000b6e68 in MDL_lock::remove_ticket (this=0x55bb02a03be0, pins=0x55bb02a25450, list=&MDL_lock::m_granted, ticket=0x7fa84c228c50) at /home/elenst/src/10.3-enterprise/sql/mdl.cc:1826 #9 0x000055bb000b8eda in MDL_context::release_lock (this=0x7fa84c000c20, duration=MDL_STATEMENT, ticket=0x7fa84c228c50) at /home/elenst/src/10.3-enterprise/sql/mdl.cc:2832 #10 0x000055bb000b90b3 in MDL_context::release_locks_stored_before (this=0x7fa84c000c20, duration=MDL_STATEMENT, sentinel=0x0) at /home/elenst/src/10.3-enterprise/sql/mdl.cc:2882 #11 0x000055bb000b97bc in MDL_context::release_transactional_locks (this=0x7fa84c000c20) at /home/elenst/src/10.3-enterprise/sql/mdl.cc:3063 #12 0x000055bafff3eaad in mysql_execute_command (thd=0x7fa84c000b00) at /home/elenst/src/10.3-enterprise/sql/sql_parse.cc:6192 #13 0x000055bafff63388 in Prepared_statement::execute (this=0x7fa84c4b9550, expanded_query=0x7fa8b82f0240, open_cursor=false) at /home/elenst/src/10.3-enterprise/sql/sql_prepare.cc:4900 #14 0x000055bafff61572 in Prepared_statement::execute_loop (this=0x7fa84c4b9550, expanded_query=0x7fa8b82f0240, open_cursor=false, packet=0x7fa84c008d3a "", packet_end=0x7fa84c008d3a "") at /home/elenst/src/10.3-enterprise/sq l/sql_prepare.cc:4312 #15 0x000055bafff5ebee in mysql_stmt_execute_common (thd=0x7fa84c000b00, stmt_id=4148, packet=0x7fa84c008d3a "", packet_end=0x7fa84c008d3a "", cursor_flags=0, bulk_op=false, read_types=false) at /home/elenst/src/10.3-enterpri se/sql/sql_prepare.cc:3283 #16 0x000055bafff5e710 in mysqld_stmt_execute (thd=0x7fa84c000b00, packet_arg=0x7fa84c008d31 "4\020", packet_length=9) at /home/elenst/src/10.3-enterprise/sql/sql_prepare.cc:3174 #17 0x000055bafff2fe9c in dispatch_command (command=COM_STMT_EXECUTE, thd=0x7fa84c000b00, packet=0x7fa84c008d31 "4\020", packet_length=9, is_com_multi=false, is_next_command=false) at /home/elenst/src/10.3-enterprise/sql/sql_parse.cc:1799 #18 0x000055bafff2eb6d in do_command (thd=0x7fa84c000b00) at /home/elenst/src/10.3-enterprise/sql/sql_parse.cc:1403 #19 0x000055bb000ac733 in do_handle_one_connection (connect=0x55bb0381a500) at /home/elenst/src/10.3-enterprise/sql/sql_connect.cc:1403 #20 0x000055bb000ac475 in handle_one_connection (arg=0x55bb0381a500) at /home/elenst/src/10.3-enterprise/sql/sql_connect.cc:1308 #21 0x00007fa8d6c4cdd5 in start_thread () from /lib64/libpthread.so.0 #22 0x00007fa8d4830ead in clone () from /lib64/libc.so.6
            elenst Elena Stepanova made changes -
            Priority Major [ 3 ] Critical [ 2 ]
            sanja Oleksandr Byelkin made changes -
            Status Open [ 1 ] In Progress [ 3 ]

            commit 1ee4055c07ebf4212d8e49d44ea724645e3eaa7a (HEAD > bb-10.3MDEV-19273, origin/bb-10.3-MDEV-19273)
            Author: Oleksandr Byelkin <sanja@mariadb.com>
            Date: Sun Mar 22 11:33:53 2020 +0100

            MDEV-19273: Server crash in MDL_ticket::has_stronger_or_equal_type or Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db.str, table->table_name.str, MDL_SHARED)' failed in mysql_rm_table_no_locks

            Do not check lock status if we already detected error.

            sanja Oleksandr Byelkin added a comment - commit 1ee4055c07ebf4212d8e49d44ea724645e3eaa7a (HEAD > bb-10.3 MDEV-19273 , origin/bb-10.3- MDEV-19273 ) Author: Oleksandr Byelkin <sanja@mariadb.com> Date: Sun Mar 22 11:33:53 2020 +0100 MDEV-19273 : Server crash in MDL_ticket::has_stronger_or_equal_type or Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db.str, table->table_name.str, MDL_SHARED)' failed in mysql_rm_table_no_locks Do not check lock status if we already detected error.
            svoj Sergey Vojtovich added a comment - Review in https://github.com/MariaDB/server/commit/1ee4055c07ebf4212d8e49d44ea724645e3eaa7a

            svoj sorry for wasting your time but I did not asked you to review (it was not the patch I will push)

            sanja Oleksandr Byelkin added a comment - svoj sorry for wasting your time but I did not asked you to review (it was not the patch I will push)

            commit b47524123dfd494b0d6a453064267f067cca634d (HEAD > bb-10.3MDEV-19273, origin/bb-10.3-MDEV-19273)
            Author: Oleksandr Byelkin <sanja@mariadb.com>
            Date: Sun Mar 22 11:33:53 2020 +0100

            MDEV-19273: Server crash in MDL_ticket::has_stronger_or_equal_type or Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db.str, table->table_name.str, MDL_SHARED)' failed in mysql_rm_table_no_locks

            Early report error in case of DROP SEQUENCE <non-sequence>

            Do not use error variable for other purposes except error.

            sanja Oleksandr Byelkin added a comment - commit b47524123dfd494b0d6a453064267f067cca634d (HEAD > bb-10.3 MDEV-19273 , origin/bb-10.3- MDEV-19273 ) Author: Oleksandr Byelkin <sanja@mariadb.com> Date: Sun Mar 22 11:33:53 2020 +0100 MDEV-19273 : Server crash in MDL_ticket::has_stronger_or_equal_type or Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db.str, table->table_name.str, MDL_SHARED)' failed in mysql_rm_table_no_locks Early report error in case of DROP SEQUENCE <non-sequence> Do not use error variable for other purposes except error.
            sanja Oleksandr Byelkin made changes -
            Assignee Oleksandr Byelkin [ sanja ] Michael Widenius [ monty ]
            Status In Progress [ 3 ] In Review [ 10002 ]

            commit e9fc2400f3cc98a3fae743c42c0e8b9c1631c280 (HEAD > bb-10.3MDEV-19273, origin/bb-10.3-MDEV-19273)
            Author: Oleksandr Byelkin <sanja@mariadb.com>
            Date: Sun Mar 22 11:33:53 2020 +0100

            MDEV-19273: Server crash in MDL_ticket::has_stronger_or_equal_type or Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db.str, table->table_name.str, MDL_SHARED)' failed in mysql_rm_table_no_locks

            Early report error in case of DROP SEQUENCE <non-sequence>

            Do not use error variable for other purposes except error.

            sanja Oleksandr Byelkin added a comment - commit e9fc2400f3cc98a3fae743c42c0e8b9c1631c280 (HEAD > bb-10.3 MDEV-19273 , origin/bb-10.3- MDEV-19273 ) Author: Oleksandr Byelkin <sanja@mariadb.com> Date: Sun Mar 22 11:33:53 2020 +0100 MDEV-19273 : Server crash in MDL_ticket::has_stronger_or_equal_type or Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db.str, table->table_name.str, MDL_SHARED)' failed in mysql_rm_table_no_locks Early report error in case of DROP SEQUENCE <non-sequence> Do not use error variable for other purposes except error.
            elenst Elena Stepanova made changes -

            MDEV-23205 Marked as duplicate of this one, slightly different testcase, please check against fix.

            Roel Roel Van de Paar added a comment - MDEV-23205 Marked as duplicate of this one, slightly different testcase, please check against fix.
            Roel Roel Van de Paar made changes -
            julien.fritsch Julien Fritsch made changes -
            Assignee Michael Widenius [ monty ] Oleksandr Byelkin [ sanja ]
            sanja Oleksandr Byelkin made changes -
            Status In Review [ 10002 ] Stalled [ 10000 ]
            sanja Oleksandr Byelkin made changes -
            Status Stalled [ 10000 ] In Progress [ 3 ]
            sanja Oleksandr Byelkin made changes -
            Status In Progress [ 3 ] Stalled [ 10000 ]
            sanja Oleksandr Byelkin made changes -
            Status Stalled [ 10000 ] In Progress [ 3 ]

            commit 174f1be545ee9381ddac9e774ebb091ac02104e7 (HEAD > bb-10.3MDEV-19273, origin/bb-10.3-MDEV-19273)
            Author: Oleksandr Byelkin <sanja@mariadb.com>
            Date: Sun Mar 22 11:33:53 2020 +0100

            MDEV-19273: Server crash in MDL_ticket::has_stronger_or_equal_type or Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db.str, table->table_name.str, MDL_SHARED)' failed in mysql_rm_table_no_locks

            Early report error in case of DROP SEQUENCE <non-sequence>

            Do not use error variable for other purposes except error.

            sanja Oleksandr Byelkin added a comment - commit 174f1be545ee9381ddac9e774ebb091ac02104e7 (HEAD > bb-10.3 MDEV-19273 , origin/bb-10.3- MDEV-19273 ) Author: Oleksandr Byelkin <sanja@mariadb.com> Date: Sun Mar 22 11:33:53 2020 +0100 MDEV-19273 : Server crash in MDL_ticket::has_stronger_or_equal_type or Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db.str, table->table_name.str, MDL_SHARED)' failed in mysql_rm_table_no_locks Early report error in case of DROP SEQUENCE <non-sequence> Do not use error variable for other purposes except error.
            sanja Oleksandr Byelkin made changes -
            Assignee Oleksandr Byelkin [ sanja ] Michael Widenius [ monty ]
            Status In Progress [ 3 ] In Review [ 10002 ]

            commit 026d5fff89d2e690bfd5b4cdc0650eff5e5ffc42 (HEAD > bb-10.3MDEV-19273, origin/bb-10.3-MDEV-19273)
            Author: Oleksandr Byelkin <sanja@mariadb.com>
            Date: Sun Mar 22 11:33:53 2020 +0100

            MDEV-19273: Server crash in MDL_ticket::has_stronger_or_equal_type or Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db.str, table->table_name.str, MDL_SHARED)' failed in mysql_rm_table_no_locks

            Early report error in case of DROP SEQUENCE <non-sequence>

            Do not use error variable for other purposes except error.

            sanja Oleksandr Byelkin added a comment - commit 026d5fff89d2e690bfd5b4cdc0650eff5e5ffc42 (HEAD > bb-10.3 MDEV-19273 , origin/bb-10.3- MDEV-19273 ) Author: Oleksandr Byelkin <sanja@mariadb.com> Date: Sun Mar 22 11:33:53 2020 +0100 MDEV-19273 : Server crash in MDL_ticket::has_stronger_or_equal_type or Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db.str, table->table_name.str, MDL_SHARED)' failed in mysql_rm_table_no_locks Early report error in case of DROP SEQUENCE <non-sequence> Do not use error variable for other purposes except error.
            sanja Oleksandr Byelkin made changes -
            Assignee Michael Widenius [ monty ] Oleksandr Byelkin [ sanja ]
            sanja Oleksandr Byelkin made changes -
            Comment [ I fixed small issues, answered big one, but what to do with big ones I have no idea (partially because thay was requirements of first reviews)

            commit ac01c636c5527462ec7d358504f818bdc4870d04
            Author: Oleksandr Byelkin <sanja@mariadb.com>
            Date: Fri Jul 10 15:17:07 2020 +0200

                MDEV-15703 Crash in EXECUTE IMMEDIATE 'CREATE OR REPLACE TABLE t1 (a INT DEFAULT ?)' USING DEFAULT
                
                part 2:
                
                - check that expressions are evaluable for
                  making empty row and assigning PS variable
                
                - correctly handling writing to a temporary tabe during multi-update
                  by setting associated field
                
                - Item::raise_error_not_evaluable() bakported from 10.4 and made vitrual
                
                - Item::is_evaluable_expression() bakported from 10.4
                
                - Item::check_is_evaluable_expression_or_error() bakported from 10.4
                
                - Item::Print bakported from 10.4

            commit f584d567dbb499485b1d1122e4370db43cb27c4c
            Author: Oleksandr Byelkin <sanja@mariadb.com>
            Date: Thu Jul 9 14:36:41 2020 +0200

                MDEV-15703 Crash in EXECUTE IMMEDIATE 'CREATE OR REPLACE TABLE t1 (a INT DEFAULT ?)' USING DEFAULT
                
                Part 1: make better asserts.

            ]
            Roel Roel Van de Paar made changes -
            Affects Version/s 10.5 [ 23123 ]
            Affects Version/s 10.6 [ 24028 ]
            Roel Roel Van de Paar made changes -
            Fix Version/s 10.5 [ 23123 ]
            Fix Version/s 10.6 [ 24028 ]
            Roel Roel Van de Paar made changes -
            Labels affects-tests affects-tests regression
            Roel Roel Van de Paar made changes -
            Labels affects-tests regression affects-tests not-10.1 not-10.2 regression
            serg Sergei Golubchik made changes -
            Affects Version/s 10.6 [ 24028 ]
            serg Sergei Golubchik made changes -
            Fix Version/s 10.6 [ 24028 ]
            Roel Roel Van de Paar made changes -
            Affects Version/s 10.6 [ 24028 ]

            if it is a new issue why it is in the old bug report?

            sanja Oleksandr Byelkin added a comment - if it is a new issue why it is in the old bug report?
            sanja Oleksandr Byelkin made changes -
            Status In Review [ 10002 ] Stalled [ 10000 ]
            sanja Oleksandr Byelkin made changes -
            Status Stalled [ 10000 ] In Progress [ 3 ]
            Roel Roel Van de Paar made changes -
            Labels affects-tests not-10.1 not-10.2 regression affects-tests not-10.1 not-10.2
            Roel Roel Van de Paar made changes -
            Roel Roel Van de Paar made changes -
            Comment [ Repeating the last testcase in this bug in the CLI will make both 10.5 and 10.6 optimized builds hang (!). Re-entry with secondary CLI connection is possible and processlist output below. mysqladmin shutdown will also hang when attempted at this point.

            {noformat}
            CREATE TABLE t (c INT);
            LOCK TABLES t READ LOCAL;
            CREATE TEMPORARY TABLE t (a INT) SELECT 1 AS a;
            DROP SEQUENCE t;
            {noformat}

            Will lead to:

            {noformat:title=10.6.0 5d4599f9750140f92cfdbbe4d292ae1b8dd456f8 (Optimized)}
            10.6.0>show processlist;
            +----+------+-----------+------+---------+------+----------------------+------------------+----------+
            | Id | User | Host | db | Command | Time | State | Info | Progress |
            +----+------+-----------+------+---------+------+----------------------+------------------+----------+
            | 4 | root | localhost | test | Query | 239 | checking permissions | DROP SEQUENCE t | 0.000 |
            | 5 | root | localhost | test | Query | 0 | starting | show processlist | 0.000 |
            +----+------+-----------+------+---------+------+----------------------+------------------+----------+
            2 rows in set (0.000 sec)
            {noformat}

            Also seen (note killed):
            {noformat:title=10.5.7 e3fc9c1db04bdc5566bcdafcc3d5159199089c00 (Optimized)}
            10.5.7>show processlist;
            +----+------+-----------+------+---------+------+----------------------+------------------+----------+
            | Id | User | Host | db | Command | Time | State | Info | Progress |
            +----+------+-----------+------+---------+------+----------------------+------------------+----------+
            | 4 | root | localhost | test | Killed | 224 | checking permissions | DROP SEQUENCE t | 0.000 |
            | 8 | root | localhost | test | Query | 0 | starting | show processlist | 0.000 |
            +----+------+-----------+------+---------+------+----------------------+------------------+----------+
            2 rows in set (0.000 sec)
            {noformat}

            Also confirmed 10.3 + 10.4 optimized are not affected by this hang. ]
            Roel Roel Van de Paar made changes -
            Comment [ A new issue (slightly different stack), same problem (DROP SEQUENCE <non-sequence>), present seemingly in 10.5 and 10.6 only. Added regression tag for this one.

            {noformat}
            CREATE TABLE t (c INT);
            LOCK TABLES t READ LOCAL;
            CREATE TEMPORARY TABLE t (a INT) SELECT 1 AS a;
            DROP SEQUENCE t;
            {noformat}

            Leads to:

            {noformat:title=10.6.0 5d4599f9750140f92cfdbbe4d292ae1b8dd456f8 (Debug)}
            mysqld: /test/10.6_dbg/sql/table_cache.cc:1030: void tdc_remove_table(THD*, const char*, const char*): Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, db, table_name, MDL_EXCLUSIVE)' failed.
            {noformat}

            {noformat:title=10.6.0 5d4599f9750140f92cfdbbe4d292ae1b8dd456f8 (Debug)}
            Core was generated by `/test/MD211020-mariadb-10.6.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
            Program terminated with signal SIGABRT, Aborted.
            #0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
                at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
            [Current thread is 1 (Thread 0x14d6a815d700 (LWP 2018263))]
            (gdb) bt
            #0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
            #1 0x000055b1cfcb6021 in my_write_core (sig=sig@entry=6) at /test/10.6_dbg/mysys/stacktrace.c:424
            #2 0x000055b1cf3fd321 in handle_fatal_signal (sig=6) at /test/10.6_dbg/sql/signal_handler.cc:330
            #3 <signal handler called>
            #4 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
            #5 0x000014d6b27c7859 in __GI_abort () at abort.c:79
            #6 0x000014d6b27c7729 in __assert_fail_base (fmt=0x14d6b295d588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55b1cfe64080 "thd->mdl_context.is_lock_owner(MDL_key::TABLE, db, table_name, MDL_EXCLUSIVE)", file=0x55b1cfe76538 "/test/10.6_dbg/sql/table_cache.cc", line=1030, function=<optimized out>) at assert.c:92
            #7 0x000014d6b27d8f36 in __GI___assert_fail (assertion=assertion@entry=0x55b1cfe64080 "thd->mdl_context.is_lock_owner(MDL_key::TABLE, db, table_name, MDL_EXCLUSIVE)", file=file@entry=0x55b1cfe76538 "/test/10.6_dbg/sql/table_cache.cc", line=line@entry=1030, function=function@entry=0x55b1cfe76a90 "void tdc_remove_table(THD*, const char*, const char*)") at assert.c:101
            #8 0x000055b1cf35e55b in tdc_remove_table (thd=thd@entry=0x14d658000db8, db=0x14d658012df8 "test", table_name=0x14d6580126f0 "t") at /test/10.6_dbg/sql/table_cache.cc:1030
            #9 0x000055b1cf1fdf41 in mysql_rm_table_no_locks (thd=thd@entry=0x14d658000db8, tables=tables@entry=0x14d658012728, if_exists=if_exists@entry=false, drop_temporary=drop_temporary@entry=false, drop_view=drop_view@entry=false, drop_sequence=drop_sequence@entry=true, dont_log_query=false, dont_free_locks=false) at /test/10.6_dbg/sql/sql_table.cc:2446
            #10 0x000055b1cf1ffe2e in mysql_rm_table (thd=thd@entry=0x14d658000db8, tables=tables@entry=0x14d658012728, if_exists=<optimized out>, drop_temporary=<optimized out>, drop_sequence=<optimized out>, dont_log_query=dont_log_query@entry=false) at /test/10.6_dbg/sql/sql_table.cc:2143
            #11 0x000055b1cf13d646 in mysql_execute_command (thd=thd@entry=0x14d658000db8) at /test/10.6_dbg/sql/structs.h:559
            #12 0x000055b1cf126fd2 in mysql_parse (thd=thd@entry=0x14d658000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d6a815c3d0) at /test/10.6_dbg/sql/sql_parse.cc:7833
            #13 0x000055b1cf1350c7 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14d658000db8, packet=packet@entry=0x14d658008ce9 "DROP SEQUENCE t", packet_length=packet_length@entry=15) at /test/10.6_dbg/sql/sql_class.h:1253
            #14 0x000055b1cf1383d2 in do_command (thd=0x14d658000db8) at /test/10.6_dbg/sql/sql_parse.cc:1343
            #15 0x000055b1cf292994 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55b1d37d74d8, put_in_cache=put_in_cache@entry=true) at /test/10.6_dbg/sql/sql_connect.cc:1410
            #16 0x000055b1cf29309b in handle_one_connection (arg=arg@entry=0x55b1d37d74d8) at /test/10.6_dbg/sql/sql_connect.cc:1312
            #17 0x000055b1cf746abb in pfs_spawn_thread (arg=0x55b1d3723688) at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #18 0x000014d6b2cd5609 in start_thread (arg=<optimized out>) at pthread_create.c:477
            #19 0x000014d6b28c4293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            {noformat}

            Bug confirmed present in:
            MariaDB: 10.5.7 (dbg), 10.6.0 (dbg)

            Bug confirmed not present in:
            MariaDB: 10.1.48 (dbg), 10.1.48 (opt), 10.2.35 (dbg), 10.2.35 (opt), 10.3.26 (dbg), 10.3.26 (opt), 10.4.16 (dbg), 10.4.16 (opt), 10.5.7 (opt), 10.6.0 (opt)
            MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.50 (dbg), 5.6.50 (opt), 5.7.32 (dbg), 5.7.32 (opt), 8.0.22 (dbg), 8.0.22 (opt)
            ]

            Related bug report moved to MDEV-24382. Thank you

            Roel Roel Van de Paar added a comment - Related bug report moved to MDEV-24382 . Thank you
            sanja Oleksandr Byelkin made changes -
            Component/s Data Definition - Temporary [ 10123 ]
            Component/s Locking [ 10900 ]
            Fix Version/s 10.3.28 [ 25111 ]
            Fix Version/s 10.4.18 [ 25110 ]
            Fix Version/s 10.5.9 [ 25109 ]
            Fix Version/s 10.3 [ 22126 ]
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.5 [ 23123 ]
            Resolution Fixed [ 1 ]
            Status In Progress [ 3 ] Closed [ 6 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 95454 ] MariaDB v4 [ 156084 ]
            Roel Roel Van de Paar made changes -

            People

              sanja Oleksandr Byelkin
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.