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

SIGSEGV in dict_col_t::name on INSERT

    XMLWordPrintable

Details

    Description

      I am seeing the following (possibly a new regression) bug in preview-11.6-preview:

      11.6.0 42294b8cd2cbb72c1d5da6058dd6f0c55669def7 (Optimized)

      Core was generated by `/test/preview-11.6-preview_MD200624-mariadb-11.6.0-linux-x86_64-opt/bin/mariadb'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  0x0000560ecd87a464 in dict_col_t::name (this=0x64000005d0000014, table=...)at /test/preview-11.6-preview_opt/storage/innobase/dict/dict0dict.cc:341
      [Current thread is 1 (LWP 1527438)]
      (gdb) bt
      #0  0x0000560ecd87a464 in dict_col_t::name (this=0x64000005d0000014, table=@0x146400000595: {id = 7205759427415113748, id_hash = 0x6400000590000014, name = {m_name = 0x6400000590000014 <error: Cannot access memory at address 0x6400000590000014>}, name_hash = 0x64000005a0000014, heap = 0x64000005a0000014, data_dir_path = 0x64000005b0000014 <error: Cannot access memory at address 0x64000005b0000014>, space = 0x64000005b0000014, space_id = 3221225492, flags = 5, flags2 = 0, skip_alter_undo = 0, file_unreadable = 0, cached = 0, n_def = 20, n_cols = 0, n_t_cols = 0, n_t_def = 5, n_v_def = 0, n_v_cols = 576, persistent_autoinc = 20, can_be_evicted = 0, corrupted = 0, drop_aborted = 0, cols = 0x64000005d0000014, v_cols = 0x64000005e0000014, s_cols = 0x64000005e0000014, instant = 0x64000005f0000014, col_names = 0x64000005f0000014 <error: Cannot access memory at address 0x64000005f0000014>, v_col_names = 0x6400000600000014 <error: Cannot access memory at address 0x6400000600000014>, vers_start = 20, vers_end = 0, is_system_db = false, dict_frm_mismatch = 1677721606, fts_doc_id_index = 0x6400000610000014, indexes = {count = 7205759429831032852, start = 0x6400000620000014, end = 0x6400000620000014, node = 7205759430367903764}, freed_indexes = {count = 7205759430367903764, start = 0x6400000640000014, end = 0x6400000640000014, node = 7205759430904774676}, foreign_list = {count = 7205759430904774676, start = 0x6400000660000014, end = 0x6400000660000014, node = 7205759431441645588}, referenced_list = {count = 7205759431441645588, start = 0x6400000680000014, end = 0x6400000680000014, node = 7205759431978516500}, table_LRU = {prev = 0x6400000690000014, next = 0x64000006a0000014}, fk_max_recusive_level = 20 '\024', def_trx_id = 7205759432515387412, bulk_trx_id = {m = std::atomic<unsigned long> = { 7205759432515387412 }}, mdl_name = {m_name = 0x64000006c0000014 <error: Cannot access memory at address 0x64000006c0000014>}, foreign_set = std::set with 7205759433589129236 elements<error reading variable: Cannot access memory at address 0x64000006e000002c>, referenced_set = std::set with 7205759434394435604 elements<error reading variable: Cannot access memory at address 0x640000071000002c>, stat_initialized = 0, stats_last_recalc = 7205759434662871060, stat_persistent = 805306388, stats_auto_recalc = 1677721607, stats_sample_pages = 7205759434931306516, stat_n_rows = 7205759434931306516, stat_clustered_index_size = 7205759435199741972, stat_sum_of_other_index_sizes = 7205759435199741972, stat_modified_counter = 7205759435468177428, stats_error_printed = 20, autoinc_lock = 0x6400000770000014, autoinc_mutex = {lock = std::atomic<unsigned int> = { 1879048212 }, static HOLDER = 2147483648}, lock_mutex = {lock = std::atomic<unsigned int> = { 1677721607 }, static HOLDER = 2147483648}, row_id = {m_counter = std::atomic<unsigned long> = { 7205759436005048340 }}, autoinc = 7205759436005048340, autoinc_trx = {m = std::atomic<const trx_t *> = { 0x6400000790000014 }}, n_waiting_or_granted_auto_inc_locks = 2415919124, n_lock_x_or_s = 1677721607, fts = 0x64000007a0000014, quiesce = (unknown: 0xa0000014), n_rec_locks = {m_counter = std::atomic<unsigned int> = { 1677721607 }}, n_ref_count = {m_counter = std::atomic<unsigned int> = { 2952790036 }}, locks = {count = 7205759436810354708, start = 0x64000007c0000014, end = 0x64000007c0000014, node = 7205759437347225620}, update_time = {m = std::atomic<long> = { 7205759437347225620 }}, query_cache_inv_trx_id = {m = std::atomic<unsigned long> = { 7205759437615661076 }}, vc_templ = 0x64000007e0000014})at /test/preview-11.6-preview_opt/storage/innobase/dict/dict0dict.cc:341
      #1  0x0000560ecd723ec9 in dict_table_get_col_name (col_nr=<optimized out>, table=<optimized out>)at /test/preview-11.6-preview_opt/storage/innobase/include/dict0dict.h:786
      #2  build_template_field (prebuilt=0x146440241620, clust_index=clust_index@entry=0x146440228970, index=index@entry=0x146440228970, table=<optimized out>, field=0x14644008ce20, i=i@entry=0, v_no=<optimized out>)at /test/preview-11.6-preview_opt/storage/innobase/handler/ha_innodb.cc:7057
      #3  0x0000560ecd72514d in ha_innobase::build_template (this=this@entry=0x1464405716d0, whole_row=<optimized out>, whole_row@entry=true)at /test/preview-11.6-preview_opt/storage/innobase/handler/ha_innodb.cc:7568
      #4  0x0000560ecd726211 in ha_innobase::write_row (this=0x1464405716d0, record=0x14644008cd18 "\002")at /test/preview-11.6-preview_opt/storage/innobase/handler/ha_innodb.cc:7760
      #5  0x0000560ecd40cae8 in handler::ha_write_row (this=0x1464405716d0, buf=0x14644008cd18 "\002")at /test/preview-11.6-preview_opt/sql/handler.cc:8029
      #6  0x0000560ecd12f172 in write_record (thd=thd@entry=0x146440000c68, table=table@entry=0x1464402b8128, info=info@entry=0x1464880622e0, sink=sink@entry=0x0)at /test/preview-11.6-preview_opt/sql/sql_insert.cc:2286
      #7  0x0000560ecd13912d in mysql_insert (thd=thd@entry=0x146440000c68, table_list=0x146440015330, fields=@0x146440005ed0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x560ece56fbd0 <end_of_list>, last = 0x146440005ed0, elements = 0}, <No data fields>}, values_list=@0x146440005f18: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x146440016050, last = 0x146440016300, elements = 3}, <No data fields>}, update_fields=@0x146440005f00: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x560ece56fbd0 <end_of_list>, last = 0x146440005f00, elements = 0}, <No data fields>}, update_values=@0x146440005ee8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x560ece56fbd0 <end_of_list>, last = 0x146440005ee8, elements = 0}, <No data fields>}, duplic=DUP_ERROR, ignore=false, result=0x0)at /test/preview-11.6-preview_opt/sql/sql_insert.cc:1165
      #8  0x0000560ecd16ee13 in mysql_execute_command (thd=thd@entry=0x146440000c68, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/preview-11.6-preview_opt/sql/sql_parse.cc:4458
      #9  0x0000560ecd173276 in mysql_parse (thd=0x146440000c68, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>)at /test/preview-11.6-preview_opt/sql/sql_parse.cc:7868
      #10 0x0000560ecd175455 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x146440000c68, packet=packet@entry=0x146440504d19 "INSERT INTO t1 VALUES (2,22),(1,11),(2,22);#ERROR: 1399 - XAER_RMFAIL: The command cannot be executed when global transaction is in the  IDLE state", packet_length=packet_length@entry=147, blocking=blocking@entry=true)at /test/preview-11.6-preview_opt/sql/sql_parse.cc:1991
      #11 0x0000560ecd177a40 in do_command (thd=0x146440000c68, blocking=blocking@entry=true)at /test/preview-11.6-preview_opt/sql/sql_parse.cc:1405
      #12 0x0000560ecd2a765f in do_handle_one_connection (connect=<optimized out>, connect@entry=0x560ed0521528, put_in_cache=put_in_cache@entry=true)at /test/preview-11.6-preview_opt/sql/sql_connect.cc:1448
      #13 0x0000560ecd2a79bd in handle_one_connection (arg=arg@entry=0x560ed0521528)at /test/preview-11.6-preview_opt/sql/sql_connect.cc:1350
      #14 0x0000560ecd660f11 in pfs_spawn_thread (arg=0x560ed054eb68)at /test/preview-11.6-preview_opt/storage/perfschema/pfs.cc:2201
      #15 0x00001464a0497ada in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
      #16 0x00001464a052847c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Frequency is very low, and sporadicity is very high. Reducing the testcase with 7 threads took 2.5 days to get a single re-occurrence with minimal reduction. SQL input was single-threaded. Work on this continues.

      Attachments

        Activity

          People

            Roel Roel Van de Paar
            Roel Roel Van de Paar
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.