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

Assertion `thd == _current_thd() || ((&(&thd->LOCK_thd_data)->m_mutex)->count > 0 && pthread_equal(pthread_self(), (&(&thd->LOCK_thd_data)->m_mutex)->thread))' failed.

    XMLWordPrintable

Details

    Description

      SET @@storage_engine='MyISAM';
      CREATE TABLE t0 (a INT,b CHAR(0),UNIQUE (a),KEY(b));
      INSERT DELAYED INTO t0 VALUES ('0','');
      ALTER TABLE t0 MODIFY a CHAR(0);
      

      Leads to:

      10.11.0 9206c1ea9746ab022f531e40eec7d930be137f21 (Debug)

      mysqld: /test/10.11_dbg/sql/sql_class.cc:455: void* thd_get_ha_data(const THD*, const handlerton*): Assertion `thd == _current_thd() || ((&(&thd->LOCK_thd_data)->m_mutex)->count > 0 && pthread_equal(pthread_self(), (&(&thd->LOCK_thd_data)->m_mutex)->thread))' failed.
      

      10.11.0 9206c1ea9746ab022f531e40eec7d930be137f21 (Debug)

      Core was generated by `/test/GAL_MD121022-mariadb-10.11.0-linux-x86_64-dbg/bin/mysqld --defaults-file='.
      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 0x14cf80363700 (LWP 946690))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
      #1  0x0000563cadad590b in my_write_core (sig=sig@entry=6) at /test/10.11_dbg/mysys/stacktrace.c:424
      #2  0x0000563cad3b3064 in handle_fatal_signal (sig=6) at /test/10.11_dbg/sql/signal_handler.cc:355
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #5  0x000014cfb61a0859 in __GI_abort () at abort.c:79
      #6  0x000014cfb61a0729 in __assert_fail_base (fmt=0x14cfb6336588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x563cadc882e0 "thd == _current_thd() || ((&(&thd->LOCK_thd_data)->m_mutex)->count > 0 && pthread_equal(pthread_self(), (&(&thd->LOCK_thd_data)->m_mutex)->thread))", file=0x563cadc881b0 "/test/10.11_dbg/sql/sql_class.cc", line=455, function=<optimized out>) at assert.c:92
      #7  0x000014cfb61b1fd6 in __GI___assert_fail (assertion=assertion@entry=0x563cadc882e0 "thd == _current_thd() || ((&(&thd->LOCK_thd_data)->m_mutex)->count > 0 && pthread_equal(pthread_self(), (&(&thd->LOCK_thd_data)->m_mutex)->thread))", file=file@entry=0x563cadc881b0 "/test/10.11_dbg/sql/sql_class.cc", line=line@entry=455, function=function@entry=0x563cadc882a8 "void* thd_get_ha_data(const THD*, const handlerton*)") at assert.c:101
      #8  0x0000563cad06554c in thd_get_ha_data (thd=thd@entry=0x14cf4c029678, hton=0x563cb07f74a8) at /usr/include/pthread.h:1167
      #9  0x0000563cad69b7aa in thd_to_trx (thd=thd@entry=0x14cf4c029678) at /test/10.11_dbg/storage/innobase/handler/ha_innodb.cc:1860
      #10 0x0000563cad69dc98 in wsrep_abort_transaction (bf_thd=0x14cf4c000d48, victim_thd=0x14cf4c029678, signal=<optimized out>) at /test/10.11_dbg/storage/innobase/handler/ha_innodb.cc:18742
      #11 0x0000563cad3c4639 in ha_abort_transaction (bf_thd=bf_thd@entry=0x14cf4c000d48, victim_thd=victim_thd@entry=0x14cf4c029678, signal=signal@entry=1 '\001') at /test/10.11_dbg/sql/handler.cc:7948
      #12 0x0000563cad66efd6 in wsrep_handle_mdl_conflict (requestor_ctx=requestor_ctx@entry=0x14cf4c000ea0, ticket=ticket@entry=0x14cf400040a0, key=key@entry=0x563cb0bf3de8) at /test/10.11_dbg/sql/wsrep_mysqld.cc:3167
      #13 0x0000563cad23fa3c in MDL_lock::can_grant_lock (this=this@entry=0x563cb0bf3de8, type_arg=MDL_SHARED_NO_WRITE, requestor_ctx=requestor_ctx@entry=0x14cf4c000ea0, ignore_lock_priority=ignore_lock_priority@entry=false) at /test/10.11_dbg/sql/mdl.cc:1793
      #14 0x0000563cad23fd77 in MDL_context::try_acquire_lock_impl (this=this@entry=0x14cf4c000ea0, mdl_request=mdl_request@entry=0x14cf8035e760, out_ticket=out_ticket@entry=0x14cf8035e6d8) at /test/10.11_dbg/sql/mdl.cc:2131
      #15 0x0000563cad240221 in MDL_context::acquire_lock (this=this@entry=0x14cf4c000ea0, mdl_request=mdl_request@entry=0x14cf8035e760, lock_wait_timeout=lock_wait_timeout@entry=31536000) at /test/10.11_dbg/sql/mdl.cc:2294
      #16 0x0000563cad241239 in MDL_context::upgrade_shared_lock (this=this@entry=0x14cf4c000ea0, mdl_ticket=mdl_ticket@entry=0x14cf4c024d00, new_type=new_type@entry=MDL_SHARED_NO_WRITE, lock_wait_timeout=31536000) at /test/10.11_dbg/sql/mdl.cc:2613
      #17 0x0000563cad1b80f7 in mysql_alter_table (thd=thd@entry=0x14cf4c000d48, new_db=new_db@entry=0x14cf4c005850, new_name=new_name@entry=0x14cf4c005c60, create_info=create_info@entry=0x14cf803610d0, table_list=<optimized out>, table_list@entry=0x14cf4c013310, alter_info=alter_info@entry=0x14cf80360fe0, order_num=0, order=0x0, ignore=false, if_exists=false) at /test/10.11_dbg/sql/sql_table.cc:11235
      #18 0x0000563cad23a741 in Sql_cmd_alter_table::execute (this=<optimized out>, thd=0x14cf4c000d48) at /test/10.11_dbg/sql/structs.h:569
      #19 0x0000563cad0ddfc7 in mysql_execute_command (thd=thd@entry=0x14cf4c000d48, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.11_dbg/sql/sql_parse.cc:5997
      #20 0x0000563cad0c6a44 in mysql_parse (thd=thd@entry=0x14cf4c000d48, rawbuf=rawbuf@entry=0x14cf4c013230 "ALTER TABLE t0 MODIFY a CHAR(0)", length=length@entry=31, parser_state=parser_state@entry=0x14cf80362300) at /test/10.11_dbg/sql/sql_parse.cc:8023
      #21 0x0000563cad0c642c in wsrep_mysql_parse (thd=thd@entry=0x14cf4c000d48, rawbuf=0x14cf4c013230 "ALTER TABLE t0 MODIFY a CHAR(0)", length=31, parser_state=parser_state@entry=0x14cf80362300) at /test/10.11_dbg/sql/sql_parse.cc:7834
      #22 0x0000563cad0d3b45 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14cf4c000d48, packet=packet@entry=0x14cf4c00af09 "ALTER TABLE t0 MODIFY a CHAR(0)", packet_length=packet_length@entry=31, blocking=blocking@entry=true) at /test/10.11_dbg/sql/sql_class.h:1346
      #23 0x0000563cad0d611e in do_command (thd=0x14cf4c000d48, blocking=blocking@entry=true) at /test/10.11_dbg/sql/sql_parse.cc:1407
      #24 0x0000563cad233774 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x563cb0c04048, put_in_cache=put_in_cache@entry=true) at /test/10.11_dbg/sql/sql_connect.cc:1416
      #25 0x0000563cad233c46 in handle_one_connection (arg=0x563cb0c04048) at /test/10.11_dbg/sql/sql_connect.cc:1318
      #26 0x000014cfb66b1609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #27 0x000014cfb629d133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      10.7.7 b6ebadaa66ee68b1880c0e10669543d1ba058c18 (Debug)

      mysqld: /test/10.7_dbg/sql/sql_class.cc:454: void* thd_get_ha_data(const THD*, const handlerton*): Assertion `thd == _current_thd() || ((&(&thd->LOCK_thd_data)->m_mutex)->count > 0 && pthread_equal(pthread_self(), (&(&thd->LOCK_thd_data)->m_mutex)->thread))' failed.
      

      10.7.7 b6ebadaa66ee68b1880c0e10669543d1ba058c18 (Debug)

      Core was generated by `/test/GAL_MD121022-mariadb-10.7.7-linux-x86_64-dbg/bin/mysqld --defaults-file=/'.
      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 0x151bec0e2700 (LWP 2427805))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
      #1  0x0000565260414c4e in my_write_core (sig=sig@entry=6) at /test/10.7_dbg/mysys/stacktrace.c:424
      #2  0x000056525fcf7be6 in handle_fatal_signal (sig=6) at /test/10.7_dbg/sql/signal_handler.cc:355
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #5  0x0000151c35b3f859 in __GI_abort () at abort.c:79
      #6  0x0000151c35b3f729 in __assert_fail_base (fmt=0x151c35cd5588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x5652605bae10 "thd == _current_thd() || ((&(&thd->LOCK_thd_data)->m_mutex)->count > 0 && pthread_equal(pthread_self(), (&(&thd->LOCK_thd_data)->m_mutex)->thread))", file=0x5652605bace8 "/test/10.7_dbg/sql/sql_class.cc", line=454, function=<optimized out>) at assert.c:92
      #7  0x0000151c35b50fd6 in __GI___assert_fail (assertion=assertion@entry=0x5652605bae10 "thd == _current_thd() || ((&(&thd->LOCK_thd_data)->m_mutex)->count > 0 && pthread_equal(pthread_self(), (&(&thd->LOCK_thd_data)->m_mutex)->thread))", file=file@entry=0x5652605bace8 "/test/10.7_dbg/sql/sql_class.cc", line=line@entry=454, function=function@entry=0x5652605badd8 "void* thd_get_ha_data(const THD*, const handlerton*)") at assert.c:101
      #8  0x000056525f9bfa22 in thd_get_ha_data (thd=thd@entry=0x151bc0029238, hton=0x565262697868) at /usr/include/pthread.h:1167
      #9  0x000056525ffdc18c in thd_to_trx (thd=thd@entry=0x151bc0029238) at /test/10.7_dbg/storage/innobase/handler/ha_innodb.cc:1924
      #10 0x000056525ffde53d in wsrep_abort_transaction (bf_thd=0x151bc0000d48, victim_thd=0x151bc0029238, signal=<optimized out>) at /test/10.7_dbg/storage/innobase/handler/ha_innodb.cc:18725
      #11 0x000056525fd0916d in ha_abort_transaction (bf_thd=bf_thd@entry=0x151bc0000d48, victim_thd=victim_thd@entry=0x151bc0029238, signal=signal@entry=1 '\001') at /test/10.7_dbg/sql/handler.cc:7939
      #12 0x000056525ffb0fdf in wsrep_handle_mdl_conflict (requestor_ctx=requestor_ctx@entry=0x151bc0000ea0, ticket=ticket@entry=0x151bbc0010a0, key=key@entry=0x5652629c6aa8) at /test/10.7_dbg/sql/wsrep_mysqld.cc:3114
      #13 0x000056525fb916ae in MDL_lock::can_grant_lock (this=this@entry=0x5652629c6aa8, type_arg=MDL_SHARED_NO_WRITE, requestor_ctx=requestor_ctx@entry=0x151bc0000ea0, ignore_lock_priority=ignore_lock_priority@entry=false) at /test/10.7_dbg/sql/mdl.cc:1793
      #14 0x000056525fb919e9 in MDL_context::try_acquire_lock_impl (this=this@entry=0x151bc0000ea0, mdl_request=mdl_request@entry=0x151bec0ddd30, out_ticket=out_ticket@entry=0x151bec0ddca8) at /test/10.7_dbg/sql/mdl.cc:2131
      #15 0x000056525fb91e93 in MDL_context::acquire_lock (this=this@entry=0x151bc0000ea0, mdl_request=mdl_request@entry=0x151bec0ddd30, lock_wait_timeout=lock_wait_timeout@entry=31536000) at /test/10.7_dbg/sql/mdl.cc:2292
      #16 0x000056525fb92eab in MDL_context::upgrade_shared_lock (this=this@entry=0x151bc0000ea0, mdl_ticket=mdl_ticket@entry=0x151bc0024b60, new_type=new_type@entry=MDL_SHARED_NO_WRITE, lock_wait_timeout=31536000) at /test/10.7_dbg/sql/mdl.cc:2611
      #17 0x000056525fb0ece3 in mysql_alter_table (thd=thd@entry=0x151bc0000d48, new_db=new_db@entry=0x151bc0005818, new_name=new_name@entry=0x151bc0005c30, create_info=create_info@entry=0x151bec0e0390, table_list=<optimized out>, table_list@entry=0x151bc0013190, alter_info=alter_info@entry=0x151bec0e02a0, order_num=0, order=0x0, ignore=false, if_exists=false) at /test/10.7_dbg/sql/sql_table.cc:10426
      #18 0x000056525fb8c3be in Sql_cmd_alter_table::execute (this=<optimized out>, thd=0x151bc0000d48) at /test/10.7_dbg/sql/structs.h:568
      #19 0x000056525fa36c84 in mysql_execute_command (thd=thd@entry=0x151bc0000d48, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.7_dbg/sql/sql_parse.cc:5989
      #20 0x000056525fa1f89c in mysql_parse (thd=thd@entry=0x151bc0000d48, rawbuf=rawbuf@entry=0x151bc00130b0 "ALTER TABLE t0 MODIFY a CHAR(0)", length=length@entry=31, parser_state=parser_state@entry=0x151bec0e1310) at /test/10.7_dbg/sql/sql_parse.cc:8014
      #21 0x000056525fa1f284 in wsrep_mysql_parse (thd=thd@entry=0x151bc0000d48, rawbuf=0x151bc00130b0 "ALTER TABLE t0 MODIFY a CHAR(0)", length=31, parser_state=parser_state@entry=0x151bec0e1310) at /test/10.7_dbg/sql/sql_parse.cc:7825
      #22 0x000056525fa2ca54 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x151bc0000d48, packet=packet@entry=0x151bc000ad89 "ALTER TABLE t0 MODIFY a CHAR(0)", packet_length=packet_length@entry=31, blocking=blocking@entry=true) at /test/10.7_dbg/sql/sql_class.h:1367
      #23 0x000056525fa2f023 in do_command (thd=0x151bc0000d48, blocking=blocking@entry=true) at /test/10.7_dbg/sql/sql_parse.cc:1407
      #24 0x000056525fb85466 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x565262a6f578, put_in_cache=put_in_cache@entry=true) at /test/10.7_dbg/sql/sql_connect.cc:1416
      #25 0x000056525fb85938 in handle_one_connection (arg=0x565262a6f578) at /test/10.7_dbg/sql/sql_connect.cc:1318
      #26 0x0000151c36050609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #27 0x0000151c35c3c133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.7.7 (dbg), 10.8.6 (dbg), 10.9.4 (dbg), 10.10.2 (dbg), 10.11.0 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.3.37 (dbg), 10.3.37 (opt), 10.4.27 (dbg), 10.4.27 (opt), 10.5.18 (opt), 10.5.18 (dbg), 10.6.11 (dbg), 10.6.11 (opt), 10.7.7 (opt), 10.8.6 (opt), 10.9.4 (opt), 10.10.2 (opt), 10.11.0 (opt)

      Attachments

        Activity

          People

            janlindstrom Jan Lindström
            ramesh Ramesh Sivaraman
            Votes:
            0 Vote for this issue
            Watchers:
            4 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.