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

Assertion `m_root_level + 1 == m_page_bulks.size()' failed

    XMLWordPrintable

Details

    • Can result in hang or crash

    Description

      SET sql_mode='STRICT_TRANS_TABLES';
      SET GLOBAL event_scheduler=ON;
      CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
      INSERT INTO t1 SELECT seq, 1 FROM seq_1_to_600;
      INSERT INTO t1 VALUES (601, NULL);
      CREATE EVENT e1 ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 2 SECOND DO ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY (a,b), ADD COLUMN c VARCHAR(6000) DEFAULT (REPEAT('x',6000)), ADD KEY (c(700));
      CREATE EVENT e2 ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 4 SECOND DO DELETE FROM t1 WHERE a=601;
      BEGIN;
      SELECT a FROM t1 LIMIT 1;
      DO SLEEP(6);
      COMMIT;
      DO SLEEP(2);
      

      Leads to:

      CS 13.2.0 c894d97781b54fbf074677c9d67f81cd60a162ac (Debug, Clang 22.1.8-20260621) Build 26/10/2026

      mariadbd: /test/13.1_dbg/storage/innobase/btr/btr0bulk.cc:968: void BtrBulk::release(): Assertion `m_root_level + 1 == m_page_bulks.size()' failed.
      

      CS 13.2.0 c894d97781b54fbf074677c9d67f81cd60a162ac (Debug, Clang 22.1.8-20260621) Build 26/10/2026

      Core was generated by `/test/MD261026-mariadb-13.2.0-linux-x86_64-dbg/bin/mariadbd --no-defaults --loo'.
      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 2649736)]
      (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  0x000070bb4d44527e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x000070bb4d4288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x000070bb4d42881b in __assert_fail_base (fmt=0x70bb4d5d1208 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x5ec30981ce1e "m_root_level + 1 == m_page_bulks.size()", file=file@entry=0x5ec30981cb00 "/test/13.1_dbg/storage/innobase/btr/btr0bulk.cc", line=line@entry=968, function=function@entry=0x5ec30981ce46 "void BtrBulk::release()")at ./assert/assert.c:96
      #6  0x000070bb4d43b517 in __assert_fail (assertion=0x5ec30981ce1e "m_root_level + 1 == m_page_bulks.size()", file=0x5ec30981cb00 "/test/13.1_dbg/storage/innobase/btr/btr0bulk.cc", line=968, function=0x5ec30981ce46 "void BtrBulk::release()")at ./assert/assert.c:105
      #7  0x00005ec309128208 in BtrBulk::release (this=0x68ba2c03ab60)at /test/13.1_dbg/storage/innobase/btr/btr0bulk.cc:968
      #8  0x00005ec30902045e in row_merge_read_clustered_index (trx=0x70bb44311680, table=0x70bb24b89dc0, old_table=0x68ba3403ac58, new_table=0x68ba2c032158, online=true, index=0x68ba2c031b08, fts_sort_idx=0x0, psort_info=0x0, files=0x68ba2c03a940, key_numbers=0x68ba2c031b18, n_index=2, defaults=0x68ba2c031b90, add_v=0x0, col_map=0x68ba2c031c40, add_autoinc=18446744073709551615, sequence=@0x68ba2c00d7b0: {m_max_value = 0, m_increment = 0, m_offset = 0, m_next_value = 0, m_eof = true}, block=0x70bb247fb000 "", skip_pk_sort=true, tmpfd=0x70bb24b884c8, stage=0x5ec325c262d0, pct_cost=33.333333333333336, crypt_block=0x0, eval_table=0x70bb24b89dc0, allow_not_null=false, col_collate=0x0) at /test/13.1_dbg/storage/innobase/row/row0merge.cc:2728
      #9  0x00005ec30901b3d8 in row_merge_build_indexes (trx=0x70bb44311680, old_table=0x68ba3403ac58, new_table=0x68ba2c032158, online=true, indexes=0x68ba2c031b08, key_numbers=0x68ba2c031b18, n_indexes=2, table=0x70bb24b89dc0, defaults=0x68ba2c031b90, col_map=0x68ba2c031c40, add_autoinc=18446744073709551615, sequence=@0x68ba2c00d7b0: {m_max_value = 0, m_increment = 0, m_offset = 0, m_next_value = 0, m_eof = true}, skip_pk_sort=true, stage=0x5ec325c262d0, add_v=0x0, eval_table=0x70bb24b89dc0, allow_not_null=false, col_collate=0x0) at /test/13.1_dbg/storage/innobase/row/row0merge.cc:4854
      #10 0x00005ec308e87d28 in ha_innobase::inplace_alter_table (this=0x68ba3403fd60, altered_table=0x70bb24b89dc0, ha_alter_info=0x70bb24b89a98)at /test/13.1_dbg/storage/innobase/handler/handler0alter.cc:8937
      #11 0x00005ec30876d919 in handler::ha_inplace_alter_table (this=0x68ba3403fd60, altered_table=0x70bb24b89dc0, ha_alter_info=0x70bb24b89a98) at /test/13.1_dbg/sql/handler.h:5202
      #12 0x00005ec30875dd72 in mysql_inplace_alter_table (thd=0x68ba28004f60, table_list=0x68ba2c004310, table=0x68ba34039f40, altered_table=0x70bb24b89dc0, ha_alter_info=0x70bb24b89a98, target_mdl_request=0x70bb24b8bbb0, ddl_log_state=0x70bb24b89d30, trigger_param=0x70bb24b8b7a0, alter_ctx=0x70bb24b8aa28, partial_alter=@0x70bb24b89cfd: false, start_alter_id=@0x70bb24b89cf0: 0, if_exists=false) at /test/13.1_dbg/sql/sql_table.cc:8701
      #13 0x00005ec308756add in mysql_alter_table (thd=0x68ba28004f60, new_db=0x68ba2c005f60, new_name=0x68ba2c0063f8, create_info=0x70bb24b8cca0, table_list=0x68ba2c004310, recreate_info=0x70bb24b8c3a8, alter_info=0x70bb24b8cb28, order_num=0, order=0x0, ignore=false, if_exists=false)at /test/13.1_dbg/sql/sql_table.cc:12206
      #14 0x00005ec308813ddb in Sql_cmd_alter_table::execute (this=0x68ba2c007630, thd=0x68ba28004f60) at /test/13.1_dbg/sql/sql_alter.cc:705
      #15 0x00005ec30863c6c9 in mysql_execute_command (thd=0x68ba28004f60, is_called_from_prepared_stmt=false) at /test/13.1_dbg/sql/sql_parse.cc:5947
      #16 0x00005ec3088d4e17 in sp_instr_stmt::exec_core (this=0x68ba2c0076e0, thd=0x68ba28004f60, nextp=0x70bb24b8eb78)at /test/13.1_dbg/sql/sp_instr.cc:1306
      #17 0x00005ec3088d25dd in sp_lex_keeper::reset_lex_and_exec_core (this=0x68ba2c007720, thd=0x68ba28004f60, nextp=0x70bb24b8eb78, open_tables=false, instr=0x68ba2c0076e0, rerun_the_same_instr=false)at /test/13.1_dbg/sql/sp_instr.cc:420
      #18 0x00005ec3088d2cd0 in sp_lex_keeper::validate_lex_and_exec_core (this=0x68ba2c007720, thd=0x68ba28004f60, nextp=0x70bb24b8eb78, open_tables=false, instr=0x68ba2c0076e0)at /test/13.1_dbg/sql/sp_instr.cc:624
      #19 0x00005ec3088d4149 in sp_instr_stmt::execute (this=0x68ba2c0076e0, thd=0x68ba28004f60, nextp=0x70bb24b8eb78)at /test/13.1_dbg/sql/sp_instr.cc:1208
      #20 0x00005ec3085127c4 in sp_head::execute (this=0x68ba2c002fa0, thd=0x68ba28004f60, merge_da_on_success=true)at /test/13.1_dbg/sql/sp_head.cc:1347
      #21 0x00005ec308514da4 in sp_head::execute_procedure (this=0x68ba2c002fa0, thd=0x68ba28004f60, args=0x70bb24b8f3e8)at /test/13.1_dbg/sql/sp_head.cc:2422
      #22 0x00005ec3087da156 in Event_job_data::execute (this=0x70bb24b8fb38, thd=0x68ba28004f60, drop=true)at /test/13.1_dbg/sql/event_data_objects.cc:1463
      #23 0x00005ec308c84b1d in Event_worker_thread::run (this=0x70bb24b8fc27, thd=0x68ba28004f60, event=0x68ba34018a00)at /test/13.1_dbg/sql/event_scheduler.cc:320
      #24 0x00005ec308c8491f in event_worker_thread (arg=0x68ba34018a00)at /test/13.1_dbg/sql/event_scheduler.cc:268
      #25 0x000070bb4d49cb84 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #26 0x000070bb4d529ecc 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  261026  6a063120d4d3d451bff3ea84b3ffbee288b33be8  m_root_level + 1 == m_page_bulks.size()|SIGABRT|BtrBulk::release|row_merge_read_clustered_index|row_merge_build_indexes|ha_innobase::inplace_alter_table
      CS  10.11  opt  261026  6a063120d4d3d451bff3ea84b3ffbee288b33be8  SIGABRT|__cxa_throw|std::__throw_out_of_range_fmt|std::vector<PageBulk*, ut_allocator<PageBulk*, true> >::_M_range_check|std::vector<PageBulk*, ut_allocator<PageBulk*, true> >::at
      CS  11.4   dbg  261026  b6406d42c8e26be3d86a4a743180f6b415a4559b  m_root_level + 1 == m_page_bulks.size()|SIGABRT|BtrBulk::release|row_merge_read_clustered_index|row_merge_build_indexes|ha_innobase::inplace_alter_table
      CS  11.4   opt  261026  b6406d42c8e26be3d86a4a743180f6b415a4559b  SIGABRT|__cxa_throw|std::__throw_out_of_range_fmt|std::vector<PageBulk*, ut_allocator<PageBulk*, true> >::_M_range_check|std::vector<PageBulk*, ut_allocator<PageBulk*, true> >::at
      CS  11.8   dbg  261026  274dd0d8d90bc773090d13303b8d5e36d2390241  m_root_level + 1 == m_page_bulks.size()|SIGABRT|BtrBulk::release|row_merge_read_clustered_index|row_merge_build_indexes|ha_innobase::inplace_alter_table
      CS  11.8   opt  261026  274dd0d8d90bc773090d13303b8d5e36d2390241  SIGABRT|__cxa_throw|std::__throw_out_of_range_fmt|std::vector<PageBulk*, ut_allocator<PageBulk*, true> >::_M_range_check|std::vector<PageBulk*, ut_allocator<PageBulk*, true> >::at
      CS  12.3   dbg  261026  788a07c52132d9f42b6991e599510c62d1625c0f  m_root_level + 1 == m_page_bulks.size()|SIGABRT|BtrBulk::release|row_merge_read_clustered_index|row_merge_build_indexes|ha_innobase::inplace_alter_table
      CS  12.3   opt  261026  788a07c52132d9f42b6991e599510c62d1625c0f  SIGABRT|__cxa_throw|std::__throw_out_of_range_fmt|std::vector<PageBulk*, ut_allocator<PageBulk*, true> >::_M_range_check|std::vector<PageBulk*, ut_allocator<PageBulk*, true> >::at
      CS  13.0   dbg  261026  620a4b5624222048fece7fe1789978ae0675cae2  m_root_level + 1 == m_page_bulks.size()|SIGABRT|BtrBulk::release|row_merge_read_clustered_index|row_merge_build_indexes|ha_innobase::inplace_alter_table
      CS  13.0   opt  261026  620a4b5624222048fece7fe1789978ae0675cae2  SIGABRT|__cxa_throw|std::__throw_out_of_range_fmt|std::vector<PageBulk*, ut_allocator<PageBulk*, true> >::_M_range_check|std::vector<PageBulk*, ut_allocator<PageBulk*, true> >::at
      CS  13.2   dbg  261026  c894d97781b54fbf074677c9d67f81cd60a162ac  m_root_level + 1 == m_page_bulks.size()|SIGABRT|BtrBulk::release|row_merge_read_clustered_index|row_merge_build_indexes|ha_innobase::inplace_alter_table
      CS  13.2   opt  261026  c894d97781b54fbf074677c9d67f81cd60a162ac  No bug found
      ES  10.6   dbg  261026  45fbb1583d8cdcc7da5a123a844b3bf512f31c9d  m_root_level + 1 == m_page_bulks.size()|SIGABRT|BtrBulk::release|row_merge_read_clustered_index|row_merge_build_indexes|ha_innobase::inplace_alter_table
      ES  10.6   opt  261026  45fbb1583d8cdcc7da5a123a844b3bf512f31c9d  SIGABRT|__cxa_throw|std::__throw_out_of_range_fmt|std::vector<PageBulk*, ut_allocator<PageBulk*, true> >::_M_range_check|std::vector<PageBulk*, ut_allocator<PageBulk*, true> >::at
      ES  11.4   dbg  261026  6b2ae48e6e2488060adfdd02a7114bb60d4d150c  m_root_level + 1 == m_page_bulks.size()|SIGABRT|BtrBulk::release|row_merge_read_clustered_index|row_merge_build_indexes|ha_innobase::inplace_alter_table
      ES  11.4   opt  261026  6b2ae48e6e2488060adfdd02a7114bb60d4d150c  SIGABRT|__cxa_throw|std::__throw_out_of_range_fmt|std::vector<PageBulk*, ut_allocator<PageBulk*, true> >::_M_range_check|std::vector<PageBulk*, ut_allocator<PageBulk*, true> >::at
      ES  11.8   dbg  261026  6e6ba60bdc2b3f478513c5afa3faa062d8e73736  m_root_level + 1 == m_page_bulks.size()|SIGABRT|BtrBulk::release|row_merge_read_clustered_index|row_merge_build_indexes|ha_innobase::inplace_alter_table
      ES  11.8   opt  261026  6e6ba60bdc2b3f478513c5afa3faa062d8e73736  SIGABRT|__cxa_throw|std::__throw_out_of_range_fmt|std::vector<PageBulk*, ut_allocator<PageBulk*, true> >::_M_range_check|std::vector<PageBulk*, ut_allocator<PageBulk*, true> >::at
      ES  12.3   dbg  261026  781803ca9943d806ecb4b3b3fb39264dfafe1cf0  m_root_level + 1 == m_page_bulks.size()|SIGABRT|BtrBulk::release|row_merge_read_clustered_index|row_merge_build_indexes|ha_innobase::inplace_alter_table
      ES  12.3   opt  261026  781803ca9943d806ecb4b3b3fb39264dfafe1cf0  SIGABRT|__cxa_throw|std::__throw_out_of_range_fmt|std::vector<PageBulk*, ut_allocator<PageBulk*, true> >::_M_range_check|std::vector<PageBulk*, ut_allocator<PageBulk*, true> >::at
      

      Attachments

        Activity

          People

            thiru Thirunarayanan Balathandayuthapani
            saahil Saahil Alam
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

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

                Git Integration

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