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

dict_field_t* dict_index_get_nth_field(const dict_index_t*, ulint): Assertion `pos < index->n_def' failed

    XMLWordPrintable

Details

    • Can result in hang or crash

    Description

      Assertion found while testing 10.11-MDEV-36845
      Leads to:-

      origin/10.11-MDEV-36845 a6e72663c4643af5673b7124e703e5a6c7994468

      # 2025-11-17T16:06:08 [2083413] | mariadbd: /data/Server/10.11-MDEV-36845/storage/innobase/include/dict0dict.inl:765: dict_field_t* dict_index_get_nth_field(const dict_index_t*, ulint): Assertion `pos < index->n_def' failed.
      

      StackTrace

      # 2025-11-17T16:13:50 [2083413] | #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=140417513289280) at ./nptl/pthread_kill.c:44
      # 2025-11-17T16:13:50 [2083413] | #1  __pthread_kill_internal (signo=6, threadid=140417513289280) at ./nptl/pthread_kill.c:78
      # 2025-11-17T16:13:50 [2083413] | #2  __GI___pthread_kill (threadid=140417513289280, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
      # 2025-11-17T16:13:50 [2083413] | #3  0x00007fb5ba906476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
      # 2025-11-17T16:13:50 [2083413] | #4  0x00007fb5ba8ec7f3 in __GI_abort () at ./stdlib/abort.c:79
      # 2025-11-17T16:13:50 [2083413] | #5  0x00007fb5ba8ec71b in __assert_fail_base (fmt=0x7fb5baaa1130 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x5618c5597362 "pos < index->n_def", file=0x5618c559aa20 "/data/Server/10.11-MDEV-36845/storage/innobase/include/dict0dict.inl", line=765, function=<optimized out>) at ./assert/assert.c:92
      # 2025-11-17T16:13:50 [2083413] | #6  0x00007fb5ba8fde96 in __GI___assert_fail (assertion=0x5618c5597362 "pos < index->n_def", file=0x5618c559aa20 "/data/Server/10.11-MDEV-36845/storage/innobase/include/dict0dict.inl", line=765, function=0x5618c559aaa8 "dict_field_t* dict_index_get_nth_field(const dict_index_t*, ulint)") at ./assert/assert.c:101
      # 2025-11-17T16:13:50 [2083413] | #7  0x00005618c4ff291c in dict_index_get_nth_field (pos=0, index=0x7fb58476fb90) at /data/Server/10.11-MDEV-36845/storage/innobase/include/dict0dict.inl:765
      # 2025-11-17T16:13:50 [2083413] | #8  dict_index_get_nth_col (pos=0, index=0x7fb58476fb90) at /data/Server/10.11-MDEV-36845/storage/innobase/include/dict0dict.inl:794
      # 2025-11-17T16:13:50 [2083413] | #9  dict_foreign_qualify_index (table=table@entry=0x7fb588246490, col_names=col_names@entry=0x0, columns=columns@entry=0x7fb59c0aaf78, n_cols=n_cols@entry=1, index=index@entry=0x7fb59c0fb8e0, types_idx=types_idx@entry=0x7fb58476fb90, check_charsets=true, check_null=0, error=0x0, err_col_no=0x0, err_index=0x0) at /data/Server/10.11-MDEV-36845/storage/innobase/dict/dict0dict.cc:4578
      # 2025-11-17T16:13:50 [2083413] | #10 0x00005618c4ff2c47 in dict_foreign_find_index (table=0x7fb588246490, col_names=0x0, columns=0x7fb59c0aaf78, n_cols=1, types_idx=0x7fb58476fb90, check_charsets=check_charsets@entry=true, check_null=0, error=0x0, err_col_no=0x0, err_index=0x0) at /data/Server/10.11-MDEV-36845/storage/innobase/dict/dict0dict.cc:2834
      # 2025-11-17T16:13:50 [2083413] | #11 0x00005618c4cb1a88 in innobase_update_foreign_try (ctx=ctx@entry=0x7fb59c029f90, trx=trx@entry=0x7fb5b8963c80, table_name=table_name@entry=0x7fb5b405121d "table300_innodb_int_autoinc") at /data/Server/10.11-MDEV-36845/storage/innobase/handler/handler0alter.cc:10105
      # 2025-11-17T16:13:50 [2083413] | #12 0x00005618c4ce20df in commit_try_norebuild (ha_alter_info=ha_alter_info@entry=0x7fb57fffb030, ctx=ctx@entry=0x7fb59c029f90, altered_table=altered_table@entry=0x7fb57fffb0f0, old_table=0x5618c73c9c38, statistics_exist=true, trx=trx@entry=0x7fb5b8963c80, table_name=0x7fb5b405121d "table300_innodb_int_autoinc") at /data/Server/10.11-MDEV-36845/storage/innobase/handler/handler0alter.cc:10732
      # 2025-11-17T16:13:50 [2083413] | #13 0x00005618c4cc6d9a in ha_innobase::commit_inplace_alter_table (this=<optimized out>, altered_table=0x7fb57fffb0f0, ha_alter_info=0x7fb57fffb030, commit=true) at /data/Server/10.11-MDEV-36845/storage/innobase/handler/handler0alter.cc:11653
      # 2025-11-17T16:13:50 [2083413] | #14 0x00005618c49237d8 in handler::ha_commit_inplace_alter_table (this=0x5618c770ace0, altered_table=altered_table@entry=0x7fb57fffb0f0, ha_alter_info=ha_alter_info@entry=0x7fb57fffb030, commit=commit@entry=true) at /data/Server/10.11-MDEV-36845/sql/handler.cc:5433
      # 2025-11-17T16:13:50 [2083413] | #15 0x00005618c46ea072 in mysql_inplace_alter_table (thd=thd@entry=0x7fb59c017db8, table_list=0x7fb59c026da0, table=table@entry=0x5618c73c9c38, altered_table=altered_table@entry=0x7fb57fffb0f0, ha_alter_info=ha_alter_info@entry=0x7fb57fffb030, target_mdl_request=target_mdl_request@entry=0x7fb57fffb910, ddl_log_state=0x7fb57fffaff0, trigger_param=0x7fb57fffb4d0, alter_ctx=0x7fb57fffc4e0, partial_alter=@0x7fb57fffaf8f: false, start_alter_id=@0x7fb57fffaf98: 0, if_exists=false) at /data/Server/10.11-MDEV-36845/sql/sql_table.cc:8194
      # 2025-11-17T16:13:50 [2083413] | #16 0x00005618c46fd386 in mysql_alter_table (thd=thd@entry=0x7fb59c017db8, new_db=new_db@entry=0x7fb59c01c968, new_name=<optimized out>, create_info=create_info@entry=0x7fb57fffd380, table_list=<optimized out>, table_list@entry=0x7fb59c026da0, recreate_info=recreate_info@entry=0x7fb57fffd1d0, alter_info=<optimized out>, order_num=<optimized out>, order=<optimized out>, ignore=<optimized out>, if_exists=<optimized out>) at /data/Server/10.11-MDEV-36845/sql/sql_table.cc:11408
      # 2025-11-17T16:13:50 [2083413] | #17 0x00005618c4782e85 in Sql_cmd_alter_table::execute (this=<optimized out>, thd=0x7fb59c017db8) at /data/Server/10.11-MDEV-36845/sql/sql_alter.cc:688
      # 2025-11-17T16:13:50 [2083413] | #18 0x00005618c46082b3 in mysql_execute_command (thd=thd@entry=0x7fb59c017db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /data/Server/10.11-MDEV-36845/sql/sql_parse.cc:6202
      # 2025-11-17T16:13:50 [2083413] | #19 0x00005618c460978f in mysql_parse (thd=thd@entry=0x7fb59c017db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x7fb57fffe370) at /data/Server/10.11-MDEV-36845/sql/sql_parse.cc:8219
      # 2025-11-17T16:13:50 [2083413] | #20 0x00005618c460bd2a in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7fb59c017db8, packet=packet@entry=0x7fb59c01eaa9 "ALTER TABLE `table300_innodb_int_autoinc` ADD FOREIGN KEY w ( `c13` ) REFERENCES `table100_innodb_int_autoinc` (c13), LOCK=DEFAULT /* E_R Thread3 QNO 6462 CON_ID 18 */ ", packet_length=packet_length@entry=168, blocking=blocking@entry=true) at /data/Server/10.11-MDEV-36845/sql/sql_parse.cc:1921
      # 2025-11-17T16:13:50 [2083413] | #21 0x00005618c460dbf2 in do_command (thd=thd@entry=0x7fb59c017db8, blocking=blocking@entry=true) at /data/Server/10.11-MDEV-36845/sql/sql_parse.cc:1434
      # 2025-11-17T16:13:50 [2083413] | #22 0x00005618c477a128 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5618c735b178, put_in_cache=put_in_cache@entry=true) at /data/Server/10.11-MDEV-36845/sql/sql_connect.cc:1475
      # 2025-11-17T16:13:50 [2083413] | #23 0x00005618c477a35d in handle_one_connection (arg=0x5618c735b178) at /data/Server/10.11-MDEV-36845/sql/sql_connect.cc:1387
      # 2025-11-17T16:13:50 [2083413] | #24 0x00007fb5ba958ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      # 2025-11-17T16:13:50 [2083413] | #25 0x00007fb5ba9e9a04 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:100
      

      RR trace is present on pluto:-
      /data/results/1763373181/TBR-2345

      Attachments

        Issue Links

          Activity

            People

              svoj Sergey Vojtovich
              saahil Saahil Alam
              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.