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

ha_innobase::change_active_index(uint): Assertion `m_user_thd == ha_thd()' failed

    XMLWordPrintable

Details

    • Can result in hang or crash

    Description

        --source include/have_innodb.inc
        --source include/have_partition.inc
       
        CREATE TABLE t (a INT AUTO_INCREMENT PRIMARY KEY, b INT, UNIQUE(b) USING HASH)
        ENGINE=InnoDB PARTITION BY HASH(a) PARTITIONS 2;
       
        --connect (con1,localhost,root,,test)
        SELECT * FROM t;
       
        --connection default
        INSERT INTO t PARTITION (p1) VALUES (1,1);
       
        --disconnect con1
        DROP TABLE t;
      
      

      Leads to:

      CS 13.0.2 be111d2cd60d035d555b71da019765cfb42ea0d3 (Debug, Clang 22.1.8-20260621) Build 21/08/2026

       
      mariadbd: /test/13.0_dbg/storage/innobase/handler/ha_innodb.cc:9145: int ha_innobase::change_active_index(uint): Assertion `m_user_thd == ha_thd()' failed.
      

      Core was generated by `/test/MD210826-mariadb-13.0.2-linux-x86_64-dbg/bin/mariadbd --defaults-group-su'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
       
      [Current thread is 1 (LWP 674357)]
      (gdb) bt
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
      #1  __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
      #2  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
      #3  0x00007ac804c4527e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x00007ac804c288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x00007ac804c2881b in __assert_fail_base (fmt=0x7ac804dd01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x61fca4f773d4 "m_user_thd == ha_thd()", file=file@entry=0x61fca4f7604e "/test/13.0_dbg/storage/innobase/handler/ha_innodb.cc", line=line@entry=9145, function=function@entry=0x61fca4f773eb "int ha_innobase::change_active_index(uint)") at ./assert/assert.c:96
      #6  0x00007ac804c3b517 in __assert_fail (assertion=0x61fca4f773d4 "m_user_thd == ha_thd()", file=0x61fca4f7604e "/test/13.0_dbg/storage/innobase/handler/ha_innodb.cc", line=9145, function=0x61fca4f773eb "int ha_innobase::change_active_index(uint)")at ./assert/assert.c:105
      #7  0x000061fca461409f in ha_innobase::change_active_index (this=0x72c70c027950, keynr=1)at /test/13.0_dbg/storage/innobase/handler/ha_innodb.cc:9145
      #8  0x000061fca4613fc2 in ha_innobase::index_init (this=0x72c70c027950, keynr=1) at /test/13.0_dbg/storage/innobase/handler/ha_innodb.cc:8818
      #9  0x000061fca423dcc8 in handler::ha_index_init (this=0x72c70c027950, idx=1, sorted=false) at /test/13.0_dbg/sql/handler.cc:4110
      #10 0x000061fca459f7c2 in ha_partition::index_init (this=0x72c70c027030, inx=1, sorted=false) at /test/13.0_dbg/sql/ha_partition.cc:5768
      #11 0x000061fca423dcc8 in handler::ha_index_init (this=0x72c70c027030, idx=1, sorted=false) at /test/13.0_dbg/sql/handler.cc:4110
      #12 0x000061fca42486d0 in handler::check_duplicate_long_entry_key (this=0x72c70c027030, new_rec=0x72c70c028a30 "\371\001", key_no=1)at /test/13.0_dbg/sql/handler.cc:8200
      #13 0x000061fca4249673 in handler::ha_check_long_uniques (this=0x72c70c027030, old_rec=0x0, new_rec=0x72c70c028a30 "\371\001")at /test/13.0_dbg/sql/handler.cc:8291
      #14 0x000061fca4248ca5 in handler::ha_check_inserver_constraints (this=0x72c70c027030, old_data=0x0, new_data=0x72c70c028a30 "\371\001")at /test/13.0_dbg/sql/handler.cc:8265
      #15 0x000061fca4249c6f in handler::ha_write_row (this=0x72c70c027030, buf=0x72c70c028a30 "\371\001") at /test/13.0_dbg/sql/handler.cc:8530
      #16 0x000061fca3dd06c2 in Write_record::single_insert (this=0x7ac8027ddf30, inserted=0x7ac8027dda30) at /test/13.0_dbg/sql/sql_insert.cc:2397
      #17 0x000061fca3dce713 in Write_record::write_record (this=0x7ac8027ddf30)at /test/13.0_dbg/sql/sql_insert.cc:2439
      #18 0x000061fca3dcbedb in mysql_insert (thd=0x72c718000d60, table_list=0x72c7180170d0, fields=@0x72c718006248: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x61fca5af0700 <end_of_list>, last = 0x72c718006248, elements = 0}, <No data fields>}, values_list=@0x72c718006290: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x72c718017ea0, last = 0x72c718017ea0, elements = 1}, <No data fields>}, update_fields=@0x72c718006278: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x61fca5af0700 <end_of_list>, last = 0x72c718006278, elements = 0}, <No data fields>}, update_values=@0x72c718006260: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x61fca5af0700 <end_of_list>, last = 0x72c718006260, elements = 0}, <No data fields>}, duplic=DUP_ERROR, ignore=false, result=0x0)at /test/13.0_dbg/sql/sql_insert.cc:1233
      #19 0x000061fca3e32f63 in mysql_execute_command (thd=0x72c718000d60, is_called_from_prepared_stmt=false) at /test/13.0_dbg/sql/sql_parse.cc:4502
      #20 0x000061fca3e29d18 in mysql_parse (thd=0x72c718000d60, rawbuf=0x72c718016f50 "INSERT INTO t PARTITION (p1) VALUES (1,1)", length=41, parser_state=0x7ac8027df9f0)at /test/13.0_dbg/sql/sql_parse.cc:7943
      #21 0x000061fca3e2746e in dispatch_command (command=COM_QUERY, thd=0x72c718000d60, packet=0x72c7181cc501 "INSERT INTO t PARTITION (p1) VALUES (1,1)", packet_length=41, blocking=true) at /test/13.0_dbg/sql/sql_parse.cc:1903
      #22 0x000061fca3e2a79a in do_command (thd=0x72c718000d60, blocking=true)at /test/13.0_dbg/sql/sql_parse.cc:1437
      #23 0x000061fca3ffc75e in do_handle_one_connection (connect=0x61fca9db0810, put_in_cache=true) at /test/13.0_dbg/sql/sql_connect.cc:1514
      #24 0x000061fca3ffc541 in handle_one_connection (arg=0x61fca9e99730)at /test/13.0_dbg/sql/sql_connect.cc:1426
      #25 0x00007ac804c9cb84 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #26 0x00007ac804d29d6c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Bug Detection Matrix

          Rel    o/d  Build   Commit                                    UniqueID observed
      CS  10.11  dbg  210826  6415902490b1b0a9a500cee9bc0a41c342190605  m_user_thd == ha_thd()|SIGABRT|ha_innobase::change_active_index|ha_innobase::index_init|handler::ha_index_init|ha_partition::index_init
      CS  10.11  opt  210826  6415902490b1b0a9a500cee9bc0a41c342190605  No bug found
      CS  11.4   dbg  210826  1a052f27e374fc9b4cb5b1fd098cf10f0e1381cc  m_user_thd == ha_thd()|SIGABRT|ha_innobase::change_active_index|ha_innobase::index_init|handler::ha_index_init|ha_partition::index_init
      CS  11.4   opt  210826  1a052f27e374fc9b4cb5b1fd098cf10f0e1381cc  No bug found
      CS  11.8   dbg  210826  d26f9ab217a7fcf9d4eccc62c01020ff275ff42e  m_user_thd == ha_thd()|SIGABRT|ha_innobase::change_active_index|ha_innobase::index_init|handler::ha_index_init|ha_partition::index_init
      CS  11.8   opt  210826  d26f9ab217a7fcf9d4eccc62c01020ff275ff42e  No bug found
      CS  12.3   dbg  210826  add63991988734383c5e942de2a19c6c45f511f7  m_user_thd == ha_thd()|SIGABRT|ha_innobase::change_active_index|ha_innobase::index_init|handler::ha_index_init|ha_partition::index_init
      CS  12.3   opt  210826  add63991988734383c5e942de2a19c6c45f511f7  No bug found
      CS  13.0   dbg  210826  be111d2cd60d035d555b71da019765cfb42ea0d3  m_user_thd == ha_thd()|SIGABRT|ha_innobase::change_active_index|ha_innobase::index_init|handler::ha_index_init|ha_partition::index_init
      CS  13.0   opt  210826  be111d2cd60d035d555b71da019765cfb42ea0d3  No bug found
      CS  13.1   dbg  210826  ff09eefbe4e8b57846435ee4a928f17e49f0fdfc  table_share->tmp_table != NO_TMP_TABLE || m_lock_type != 2|SIGABRT|handler::ha_index_read_map|ha_partition::handle_unordered_scan_next_partition|ha_partition::common_index_read|ha_partition::index_read_map
      CS  13.1   opt  210826  ff09eefbe4e8b57846435ee4a928f17e49f0fdfc  No bug found
      ES  10.6   dbg  210826  fcecb2620f25965723d640decede7c018bcb1dcc  m_user_thd == ha_thd()|SIGABRT|ha_innobase::change_active_index|ha_innobase::index_init|handler::ha_index_init|ha_partition::index_init
      ES  10.6   opt  210826  fcecb2620f25965723d640decede7c018bcb1dcc  No bug found
      ES  11.4   dbg  210826  3b34189bfe675c18c4ced3ef531d016ea74c76f4  m_user_thd == ha_thd()|SIGABRT|ha_innobase::change_active_index|ha_innobase::index_init|handler::ha_index_init|ha_partition::index_init
      ES  11.4   opt  210826  3b34189bfe675c18c4ced3ef531d016ea74c76f4  No bug found
      ES  11.8   dbg  210826  4694e931d10fecf733c34f83ea2146d31b708eb3  m_user_thd == ha_thd()|SIGABRT|ha_innobase::change_active_index|ha_innobase::index_init|handler::ha_index_init|ha_partition::index_init
      ES  11.8   opt  210826  4694e931d10fecf733c34f83ea2146d31b708eb3  No bug found
      ES  12.3   dbg  210826  f513f503feacabfb219d4a6f965b5f72b86d4db0  m_user_thd == ha_thd()|SIGABRT|ha_innobase::change_active_index|ha_innobase::index_init|handler::ha_index_init|ha_partition::index_init
      ES  12.3   opt  210826  f513f503feacabfb219d4a6f965b5f72b86d4db0  No bug found
      

      Attachments

        Activity

          People

            holyfoot Alexey Botchkov
            saahil Saahil Alam
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0d
                0d
                Logged:
                Time Spent - 1.5h
                1.5h

                Git Integration

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