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

Segfault or assertion upon MyISAM repair

    XMLWordPrintable

Details

    Description

      Assertion `!table || table->in_use == _current_thd()' failed with long unique key & UBSAN: runtime error: member access within null pointer in Item_func_concat::append_value

      CREATE TABLE t1 (b VARCHAR(1024), c CHAR(3), UNIQUE(b,c)) ENGINE=MyISAM;
      INSERT INTO t1 VALUES ('foo','baz');
      ALTER TABLE t1 DISABLE KEYS;
      SET SESSION myisam_repair_threads= 2;
      --error ER_WRONG_VALUE_COUNT_ON_ROW
      INSERT INTO t1 SELECT 'qux';
       
      # Cleanup
      DROP TABLE t1;
      

      10.4 05d62518

      mysqld: /data/src/10.4/sql/field.cc:7281: virtual String* Field_string::val_str(String*, String*): Assertion `!table || table->in_use == _current_thd()' failed.
      200726  1:38:58 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007fc5675fcf12 in __GI___assert_fail (assertion=0x55957eaf4b68 "!table || table->in_use == _current_thd()", file=0x55957eaf458b "/data/src/10.4/sql/field.cc", line=7281, function=0x55957eaf92c0 <Field_string::val_str(String*, String*)::__PRETTY_FUNCTION__> "virtual String* Field_string::val_str(String*, String*)") at assert.c:101
      #8  0x000055957df8ddda in Field_string::val_str (this=0x7fc550133d38, val_buffer=0x7fc55000bda0, val_ptr=0x7fc55000bda0) at /data/src/10.4/sql/field.cc:7281
      #9  0x000055957dfda0f2 in Item_field::val_str (this=0x7fc55000bd70, str=0x7fc55000bda0) at /data/src/10.4/sql/item.cc:3191
      #10 0x000055957dcf40d4 in Item::val_str (this=0x7fc55000bd70) at /data/src/10.4/sql/item.h:904
      #11 0x000055957e042ba3 in Item_func_hash::val_int (this=0x7fc55012c748) at /data/src/10.4/sql/item_func.cc:1745
      #12 0x000055957dfe4458 in Item::save_int_in_field (this=0x7fc55012c748, field=0x7fc550133e20, no_conversions=false) at /data/src/10.4/sql/item.cc:6582
      #13 0x000055957de794da in Type_handler_int_result::Item_save_in_field (this=0x55957f42aba8 <type_handler_long>, item=0x7fc55012c748, field=0x7fc550133e20, no_conversions=false) at /data/src/10.4/sql/sql_type.cc:3672
      #14 0x000055957dfe4503 in Item::save_in_field (this=0x7fc55012c748, field=0x7fc550133e20, no_conversions=false) at /data/src/10.4/sql/item.cc:6592
      #15 0x000055957dd96ce4 in TABLE::update_virtual_field (this=0x7fc5501822c0, vf=0x7fc550133e20) at /data/src/10.4/sql/table.cc:8393
      #16 0x000055957e7330d6 in compute_vcols (info=0x7fc55012d830, record=0x7fc550071350 "\370\003", keynum=0) at /data/src/10.4/storage/myisam/ha_myisam.cc:707
      #17 0x000055957e74754b in sort_get_next_record (sort_param=0x7fc550070b80) at /data/src/10.4/storage/myisam/mi_check.c:3666
      #18 0x000055957e745754 in sort_key_read (sort_param=0x7fc550070b80, key=0x7fc544000b08) at /data/src/10.4/storage/myisam/mi_check.c:3130
      #19 0x000055957e78fb9d in thr_find_all_keys_exec (sort_param=0x7fc550070b80) at /data/src/10.4/storage/myisam/sort.c:448
      #20 0x000055957e78fd3a in thr_find_all_keys (arg=0x7fc550070b80) at /data/src/10.4/storage/myisam/sort.c:507
      #21 0x000055957e7dd879 in pfs_spawn_thread (arg=0x7fc550072f30) at /data/src/10.4/storage/perfschema/pfs.cc:1869
      #22 0x00007fc5695854a4 in start_thread (arg=0x7fc56175c700) at pthread_create.c:456
      #23 0x00007fc5676b9d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      Reproducible on 10.4, 10.5.
      The test case is not applicable to earlier versions as the key is too long.
      No obvious problem on a non-debug build.

      Attachments

        Issue Links

          Activity

            People

              midenok Aleksey Midenkov
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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