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

Assertion `trx->id || index->table->no_rollback() || index->table->is_temporary()' failed in dberr_t row_ins_index_entry(dict_index_t *, dtuple_t *, que_thr_t *)

    XMLWordPrintable

Details

    • Can result in hang or crash

    Description

      --source include/have_innodb.inc
       
      SET SQL_MODE='';
      CREATE TABLE t1 (a INT) ENGINE=INNODB;
      CREATE TABLE t2 (a INT) ENGINE=INNODB;
      SET transaction_isolation='SERIALIZABLE';
      SET transaction_read_only=1;
      HANDLER t2 OPEN;
      SET transaction_read_only=0;
      INSERT INTO t1 VALUES ('a');
      

      Initial stack of optimized build is similar to MDEV-33597 but in the given test case does not have general_log ALTER statement

      CS 11.8.4 6d0be016faba4179421a5b6b46ba0cfc21d0cf92 (Optimized, Clang 18.1.3-11) Build 31/10/2025

      Core was generated by `/test/MD311025-mariadb-11.8.4-linux-x86_64-opt/bin/mariadbd --no-defaults --max'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  srw_lock_impl<true>::wr_lock (this=0x8, line=1399, file=<optimized out>)at include/srw_lock.h:560
       
      [Current thread is 1 (LWP 397444)]
      (gdb) bt
      #0  srw_lock_impl<true>::wr_lock (this=0x8, line=1399, file=<optimized out>)at include/srw_lock.h:560
      #1  trx_undo_assign_low<false> (mtr=mtr@entry=0x7e52580d1978, err=err@entry=0x7e52580d193c, rseg=0x0, undo=undo@entry=0x7e4e732ff4a8)at /test/11.8_opt/storage/innobase/trx/trx0undo.cc:1399
      #2  0x00005d0c184f5ea6 in trx_undo_report_row_operation (thr=<optimized out>, index=index@entry=0x7e336c0272e8, clust_entry=0x7e336c0266e8, update=update@entry=0x0, cmpl_info=cmpl_info@entry=0, rec=rec@entry=0x0, offsets=0x0, roll_ptr=0x7e52580d2968)at /test/11.8_opt/storage/innobase/trx/trx0rec.cc:1901
      #3  0x00005d0c1851b090 in btr_cur_ins_lock_and_undo (flags=flags@entry=0, cursor=cursor@entry=0x7e52580d2d80, entry=entry@entry=0x7e336c0266e8, thr=<optimized out>, mtr=<optimized out>, inherit=inherit@entry=0x7e52580d2a37)at /test/11.8_opt/storage/innobase/btr/btr0cur.cc:2233
      #4  0x00005d0c1851ac0a in btr_cur_optimistic_insert (flags=flags@entry=0, cursor=cursor@entry=0x7e52580d2d80, offsets=offsets@entry=0x7e52580d2e58, heap=heap@entry=0x7e52580d2e40, entry=entry@entry=0x7e336c0266e8, rec=rec@entry=0x7e52580d2e38, big_rec=0x7e52580d2e28, n_ext=0, thr=0x7e336c030d88, mtr=0x7e52580d2e88)at /test/11.8_opt/storage/innobase/btr/btr0cur.cc:2458
      #5  0x00005d0c184a51d6 in row_ins_clust_index_entry_low (flags=flags@entry=0, mode=mode@entry=BTR_MODIFY_LEAF, index=index@entry=0x7e336c0272e8, n_uniq=n_uniq@entry=0, entry=entry@entry=0x7e336c0266e8, n_ext=n_ext@entry=0, thr=0x7e336c030d88)at /test/11.8_opt/storage/innobase/row/row0ins.cc:2940
      #6  0x00005d0c184a6bf6 in row_ins_clust_index_entry (index=0x7e336c0272e8, entry=0x7e336c0266e8, thr=0x7e336c030d88, n_ext=n_ext@entry=0)at /test/11.8_opt/storage/innobase/row/row0ins.cc:3326
      #7  0x00005d0c184a76a4 in row_ins_index_entry (index=0x8, entry=0x7e52580d193c, thr=0x7e336c030d88)at /test/11.8_opt/storage/innobase/row/row0ins.cc:3466
      #8  row_ins_index_entry_step (node=0x7e336c030b98, thr=0x7e336c030d88)at /test/11.8_opt/storage/innobase/row/row0ins.cc:3632
      #9  row_ins (node=0x7e336c030b98, thr=0x7e336c030d88)at /test/11.8_opt/storage/innobase/row/row0ins.cc:3749
      #10 row_ins_step (thr=thr@entry=0x7e336c030d88)at /test/11.8_opt/storage/innobase/row/row0ins.cc:3878
      #11 0x00005d0c184b7f83 in row_insert_for_mysql (mysql_rec=mysql_rec@entry=0x7e336c02efc0 <incomplete sequence \375>, prebuilt=0x7e336c0307a8, ins_mode=ROW_INS_NORMAL)at /test/11.8_opt/storage/innobase/row/row0mysql.cc:1300
      #12 0x00005d0c184064e8 in ha_innobase::write_row (this=0x7e336c02e768, record=0x7e336c02efc0 <incomplete sequence \375>)at /test/11.8_opt/storage/innobase/handler/ha_innodb.cc:7773
      #13 0x00005d0c181409f4 in handler::ha_write_row (this=0x7e336c02e768, buf=0x7e336c02efc0 <incomplete sequence \375>)at /test/11.8_opt/sql/handler.cc:8229
      #14 0x00005d0c17e91952 in Write_record::single_insert (this=this@entry=0x7e52580d3a08, inserted=inserted@entry=0x7e52580d39d8)at /test/11.8_opt/sql/sql_insert.cc:2370
      #15 0x00005d0c17e904db in Write_record::write_record (this=this@entry=0x7e52580d3a08) at /test/11.8_opt/sql/sql_insert.cc:2412
      #16 0x00005d0c17e8eacf in mysql_insert (thd=thd@entry=0x7e336c000c68, table_list=0x7e336c0175e8, fields=@0x7e336c005f48: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x5d0c19110350 <end_of_list>, last = 0x7e336c005f48, elements = 0}, <No data fields>}, values_list=@0x7e336c005f90: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x7e336c018288, last = 0x7e336c018288, elements = 1}, <No data fields>}, update_fields=@0x7e336c005f78: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x5d0c19110350 <end_of_list>, last = 0x7e336c005f78, elements = 0}, <No data fields>}, update_values=@0x7e336c005f60: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x5d0c19110350 <end_of_list>, last = 0x7e336c005f60, elements = 0}, <No data fields>}, duplic=DUP_ERROR, ignore=<optimized out>, result=0x0)at /test/11.8_opt/sql/sql_insert.cc:1230
      #17 0x00005d0c17ecb343 in mysql_execute_command (thd=thd@entry=0x7e336c000c68, is_called_from_prepared_stmt=false) at /test/11.8_opt/sql/sql_parse.cc:4480
      #18 0x00005d0c17ec43c1 in mysql_parse (thd=thd@entry=0x7e336c000c68, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x7e52580d4430)at /test/11.8_opt/sql/sql_parse.cc:7908
      #19 0x00005d0c17ec2850 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7e336c000c68, packet=packet@entry=0x7e336c008859 "INSERT INTO t1 VALUES ('a')", packet_length=packet_length@entry=27, blocking=true)at /test/11.8_opt/sql/sql_parse.cc:1903
      #20 0x00005d0c17ec47d1 in do_command (thd=thd@entry=0x7e336c000c68, blocking=true) at /test/11.8_opt/sql/sql_parse.cc:1416
      #21 0x00005d0c17fededd in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5d0c583269b8, put_in_cache=true)at /test/11.8_opt/sql/sql_connect.cc:1504
      #22 0x00005d0c17fedc9f in handle_one_connection (arg=arg@entry=0x5d0c583269b8)at /test/11.8_opt/sql/sql_connect.cc:1416
      #23 0x00005d0c18375bc9 in pfs_spawn_thread (arg=0x5d0c582c5238)at /test/11.8_opt/storage/perfschema/pfs.cc:2198
      #24 0x00007e525909caa4 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #25 0x00007e5259129c3c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      CS 11.8.4 e2bf22752147a39e8b24107c19533812de82a5e1 (Debug, Clang 18.1.3-11) Build 13/10/2025

      mariadbd: /test/11.8_dbg/storage/innobase/row/row0ins.cc:3442: dberr_t row_ins_index_entry(dict_index_t *, dtuple_t *, que_thr_t *): Assertion `trx->id || index->table->no_rollback() || index->table->is_temporary()' failed.
      

      CS 11.8.4 e2bf22752147a39e8b24107c19533812de82a5e1 (Debug, Clang 18.1.3-11) Build 13/10/2025

      Core was generated by `/test/MD131025-mariadb-11.8.4-linux-x86_64-dbg/bin/mariadbd --no-defaults --max'.
      Program terminated with signal SIGABRT, Aborted.
      Download failed: Invalid argument.  Continuing without source file ./nptl/./nptl/pthread_kill.c.
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
       
      [Current thread is 1 (LWP 903810)]
      (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  0x000070268184527e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x00007026818288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x000070268182881b in __assert_fail_base (fmt=0x7026819d01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x5f66493a7d9b "trx->id || index->table->no_rollback() || index->table->is_temporary()", file=file@entry=0x5f66493a5fe2 "/test/11.8_dbg/storage/innobase/row/row0ins.cc", line=line@entry=3442, function=function@entry=0x5f66493a7de2 "dberr_t row_ins_index_entry(dict_index_t *, dtuple_t *, que_thr_t *)") at ./assert/assert.c:96
      #6  0x000070268183b517 in __assert_fail (assertion=0x5f66493a7d9b "trx->id || index->table->no_rollback() || index->table->is_temporary()", file=0x5f66493a5fe2 "/test/11.8_dbg/storage/innobase/row/row0ins.cc", line=3442, function=0x5f66493a7de2 "dberr_t row_ins_index_entry(dict_index_t *, dtuple_t *, que_thr_t *)") at ./assert/assert.c:105
      #7  0x00005f6648c3826a in row_ins_index_entry (index=0x700790008a38, entry=0x700790009598, thr=0x700790017d60)at /test/11.8_dbg/storage/innobase/row/row0ins.cc:3441
      #8  0x00005f6648c3767e in row_ins_index_entry_step (node=0x700790017b40, thr=0x700790017d60) at /test/11.8_dbg/storage/innobase/row/row0ins.cc:3632
      #9  0x00005f6648c30aa2 in row_ins (node=0x700790017b40, thr=0x700790017d60)at /test/11.8_dbg/storage/innobase/row/row0ins.cc:3749
      #10 0x00005f6648c306f0 in row_ins_step (thr=0x700790017d60)at /test/11.8_dbg/storage/innobase/row/row0ins.cc:3878
      #11 0x00005f6648c5d66c in row_insert_for_mysql (mysql_rec=0x700790015f20 <incomplete sequence \375>, prebuilt=0x700790017708, ins_mode=ROW_INS_NORMAL)at /test/11.8_dbg/storage/innobase/row/row0mysql.cc:1300
      #12 0x00005f6648a4fb2c in ha_innobase::write_row (this=0x7007900156c8, record=0x700790015f20 <incomplete sequence \375>)at /test/11.8_dbg/storage/innobase/handler/ha_innodb.cc:7773
      #13 0x00005f664867b7bf in handler::ha_write_row (this=0x7007900156c8, buf=0x700790015f20 <incomplete sequence \375>)at /test/11.8_dbg/sql/handler.cc:8227
      #14 0x00005f66481efa5e in Write_record::single_insert (this=0x7022a36aee88, inserted=0x7022a36aeb60) at /test/11.8_dbg/sql/sql_insert.cc:2370
      #15 0x00005f66481ed755 in Write_record::write_record (this=0x7022a36aee88)at /test/11.8_dbg/sql/sql_insert.cc:2412
      #16 0x00005f66481ead9f in mysql_insert (thd=0x70078c001168, table_list=0x70078c01a030, fields=@0x70078c006410: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x5f6649e506b0 <end_of_list>, last = 0x70078c006410, elements = 0}, <No data fields>}, values_list=@0x70078c006458: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x70078c01ad70, last = 0x70078c01ad70, elements = 1}, <No data fields>}, update_fields=@0x70078c006440: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x5f6649e506b0 <end_of_list>, last = 0x70078c006440, elements = 0}, <No data fields>}, update_values=@0x70078c006428: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x5f6649e506b0 <end_of_list>, last = 0x70078c006428, elements = 0}, <No data fields>}, duplic=DUP_ERROR, ignore=false, result=0x0)at /test/11.8_dbg/sql/sql_insert.cc:1230
      #17 0x00005f664824b144 in mysql_execute_command (thd=0x70078c001168, is_called_from_prepared_stmt=false) at /test/11.8_dbg/sql/sql_parse.cc:4480
      #18 0x00005f6648240e24 in mysql_parse (thd=0x70078c001168, rawbuf=0x70078c019f40 "INSERT INTO t VALUES (0,'test3')", length=32, parser_state=0x7022a36b0960) at /test/11.8_dbg/sql/sql_parse.cc:7908
      #19 0x00005f664823e1f4 in dispatch_command (command=COM_QUERY, thd=0x70078c001168, packet=0x70078c00b219 "INSERT INTO t VALUES (0,'test3')", packet_length=32, blocking=false) at /test/11.8_dbg/sql/sql_parse.cc:1903
      #20 0x00005f66482419d3 in do_command (thd=0x70078c001168, blocking=false)at /test/11.8_dbg/sql/sql_parse.cc:1416
      #21 0x00005f6648584817 in threadpool_process_request (thd=0x70078c001168)at /test/11.8_dbg/sql/threadpool_common.cc:438
      #22 0x00005f6648584412 in tp_callback (c=0x5f667a232b90)at /test/11.8_dbg/sql/threadpool_common.cc:252
      #23 0x00005f66488a3789 in worker_main (param=0x5f667a2551f8)at /test/11.8_dbg/sql/threadpool_generic.cc:1567
      #24 0x000070268189caa4 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #25 0x0000702681929c3c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Bug Detection Matrix

          Rel    o/d  Build   Commit                                    UniqueID observed              
      CS  10.6   dbg  311025  e80998281aa1551f12a6b86cb3765796130d822d  No bug found                  
      CS  10.6   opt  311025  e80998281aa1551f12a6b86cb3765796130d822d  No bug found                  
      CS  10.11  dbg  311025  654e8440b51b1b8da09b6f72de80ba50dc0c24f9  No bug found                  
      CS  10.11  opt  311025  654e8440b51b1b8da09b6f72de80ba50dc0c24f9  No bug found                  
      CS  11.4   dbg  051125  aa70eeac2cff766d7ff2dad3e9b84b575dd14194  No bug found                  
      CS  11.4   opt  051125  aa70eeac2cff766d7ff2dad3e9b84b575dd14194  No bug found                  
      CS  11.8   dbg  311025  6d0be016faba4179421a5b6b46ba0cfc21d0cf92  trx->id || index->table->no_rollback() || index->table->is_temporary()|SIGABRT|row_ins_index_entry|row_ins_index_entry_step|row_ins|row_ins_step
      CS  11.8   opt  311025  6d0be016faba4179421a5b6b46ba0cfc21d0cf92  SIGSEGV|srw_lock_impl<true>::wr_lock|trx_undo_assign_low<false>|trx_undo_report_row_operation|btr_cur_ins_lock_and_undo
      CS  12.1   dbg  311025  4af88ced488e78458f0febb55a0ae67783330029  trx->id || index->table->no_rollback() || index->table->is_temporary()|SIGABRT|row_ins_index_entry|row_ins_index_entry_step|row_ins|row_ins_step
      CS  12.1   opt  311025  4af88ced488e78458f0febb55a0ae67783330029  SIGSEGV|srw_lock_impl<true>::wr_lock|trx_undo_assign_low<false>|trx_undo_report_row_operation|btr_cur_ins_lock_and_undo
      CS  12.2   dbg  051125  101346c3dc174177faf5df109611bb4cb03efab5  trx->id || index->table->no_rollback() || index->table->is_temporary()|SIGABRT|row_ins_index_entry|row_ins_index_entry_step|row_ins|row_ins_step
      CS  12.2   opt  051125  101346c3dc174177faf5df109611bb4cb03efab5  SIGSEGV|srw_lock_impl<true>::wr_lock|trx_undo_assign_low<false>|trx_undo_report_row_operation|btr_cur_ins_lock_and_undo
      ES  10.5   dbg  040825  70586522eacf09d04d49962072e14325a75d8155  No bug found                  
      ES  10.5   opt  040825  70586522eacf09d04d49962072e14325a75d8155  No bug found                  
      ES  10.6   dbg  040825  9b794f34b48fb7eee490b6da44edc0f33a947447  No bug found                  
      ES  10.6   opt  040825  9b794f34b48fb7eee490b6da44edc0f33a947447  No bug found                  
      ES  11.4   dbg  040825  a1c03ccd54b582e75506687ee19b273ca897f261  No bug found                  
      ES  11.4   opt  040825  a1c03ccd54b582e75506687ee19b273ca897f261  No bug found                  
      ES  11.8   dbg  151025  780565c207e9ce0ebf7d8e3d59f223801447b619  trx->id || index->table->no_rollback() || index->table->is_temporary()|SIGABRT|row_ins_index_entry|row_ins_index_entry_step|row_ins|row_ins_step
      ES  11.8   opt  151025  780565c207e9ce0ebf7d8e3d59f223801447b619  SIGSEGV|srw_lock_impl<true>::wr_lock|trx_undo_assign_low<false>|trx_undo_report_row_operation|btr_cur_ins_lock_and_undo
      

      UBSAN Unique ID

      UBSAN|null pointer passed as argument 2, which is declared to never be null|storage/innobase/trx/trx0rec.cc|trx_undo_report_row_operation|btr_cur_ins_lock_and_undo|btr_cur_optimistic_insert|row_ins_clust_index_entry_low
      

      The assertion is happening after this merge commit

      commit 6d0be016faba4179421a5b6b46ba0cfc21d0cf92 (HEAD, origin/11.8, 11.8)
      Merge: bd0dc4006e8 83df4a3c9e6
      Author: Oleksandr Byelkin <sanja@mariadb.com>
      Date:   Fri Oct 24 12:25:01 2025 +0200
       
          Merge branch '11.4' into bb-11.8-release
      

      Since this is a merge commit, could not determine which commit caused this issue

      Attachments

        Issue Links

          Activity

            People

              sanja Oleksandr Byelkin
              ramesh Ramesh Sivaraman
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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