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

Assertion `old_flags == ((my_flags & 0x10000U) ? 1 : 0)' failed in my_realloc

    XMLWordPrintable

Details

    Description

      CREATE TABLE t1 (pk int, c text, primary key (pk), key(c(32))) ENGINE=Aria ROW_FORMAT=DYNAMIC;
      ALTER TABLE t1 DISABLE KEYS;
      INSERT INTO t1 VALUES (1, 'Nine chars or more');
      ALTER TABLE t1 ENABLE KEYS;
       
      # Cleanup
      DROP TABLE t1;
      

      bb-10.6-monty 6c9cf818d

      mariadbd: /data/src/bb-10.6-monty/mysys/my_malloc.c:148: my_realloc: Assertion `old_flags == ((my_flags & 0x10000U) ? 1 : 0)' failed.
      210424 18:00:27 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f4fea2d0f36 in __GI___assert_fail (assertion=0x556dbd9a9300 "old_flags == ((my_flags & 0x10000U) ? 1 : 0)", file=0x556dbd9a8f20 "/data/src/bb-10.6-monty/mysys/my_malloc.c", line=148, function=0x556dbd9a94e0 <__PRETTY_FUNCTION__.15625> "my_realloc") at assert.c:101
      #8  0x0000556dbc79ead3 in my_realloc (key=0, old_point=0x61100003f688, size=122, my_flags=64) at /data/src/bb-10.6-monty/mysys/my_malloc.c:148
      #9  0x0000556dbb999e4a in _ma_alloc_buffer (old_addr=0x7f4fe0e85760, old_size=0x7f4fe0e85a28, new_size=122, flag=0) at /data/src/bb-10.6-monty/storage/maria/ma_open.c:1256
      #10 0x0000556dbba9ab75 in sort_get_next_record (sort_param=0x7f4fe0e85290) at /data/src/bb-10.6-monty/storage/maria/ma_check.c:5233
      #11 0x0000556dbba97039 in sort_key_read (sort_param=0x7f4fe0e85290, key=0x615000021818 '\276' <repeats 200 times>...) at /data/src/bb-10.6-monty/storage/maria/ma_check.c:4796
      #12 0x0000556dbbab2078 in find_all_keys (info=0x7f4fe0e85290, keys=2, sort_keys=0x615000021808, buffpek=0x7f4fe0e849e0, maxbuffer=0x7f4fe0e84950, tempfile=0x7f4fe0e84a30, tempfile_for_exceptions=0x7f4fe0e84be0) at /data/src/bb-10.6-monty/storage/maria/ma_sort.c:324
      #13 0x0000556dbbab10d5 in _ma_create_index_by_sort (info=0x7f4fe0e85290, no_messages=1 '\001', sortbuff_size=65536) at /data/src/bb-10.6-monty/storage/maria/ma_sort.c:231
      #14 0x0000556dbba903bd in maria_repair_by_sort (param=0x7f4fe018e8a8, info=0x7f4fe0e84000, name=0x7f4fe0e86b40 "./test/t1", rep_quick=1 '\001') at /data/src/bb-10.6-monty/storage/maria/ma_check.c:3988
      #15 0x0000556dbb8df899 in ha_maria::repair (this=0x61d0001de328, thd=0x62b00007e288, param=0x7f4fe018e8a8, do_optimize=false) at /data/src/bb-10.6-monty/storage/maria/ha_maria.cc:1699
      #16 0x0000556dbb8e1d9b in ha_maria::enable_indexes (this=0x61d0001de328, mode=2) at /data/src/bb-10.6-monty/storage/maria/ha_maria.cc:2057
      #17 0x0000556dbb2727ca in handler::ha_enable_indexes (this=0x61d0001de328, mode=2) at /data/src/bb-10.6-monty/sql/handler.cc:4870
      #18 0x0000556dbacb4cdf in alter_table_manage_keys (table=0x619000097508, indexes_were_disabled=1, keys_onoff=Alter_info::ENABLE) at /data/src/bb-10.6-monty/sql/sql_table.cc:6973
      #19 0x0000556dbacc45ee in simple_rename_or_index_change (thd=0x62b00007e288, table_list=0x62b0000853b8, keys_onoff=Alter_info::ENABLE, trigger_param=0x7f4fe0e883b0, alter_ctx=0x7f4fe0e88e30) at /data/src/bb-10.6-monty/sql/sql_table.cc:9014
      #20 0x0000556dbacc9706 in mysql_alter_table (thd=0x62b00007e288, new_db=0x62b000082e80, new_name=0x62b000083298, create_info=0x7f4fe0e8a320, table_list=0x62b0000853b8, alter_info=0x7f4fe0e8a1f0, order_num=0, order=0x0, ignore=false, if_exists=false) at /data/src/bb-10.6-monty/sql/sql_table.cc:9751
      #21 0x0000556dbae8934e in Sql_cmd_alter_table::execute (this=0x62b000085aa8, thd=0x62b00007e288) at /data/src/bb-10.6-monty/sql/sql_alter.cc:550
      #22 0x0000556dbaa2bf45 in mysql_execute_command (thd=0x62b00007e288) at /data/src/bb-10.6-monty/sql/sql_parse.cc:5987
      #23 0x0000556dbaa397f5 in mysql_parse (thd=0x62b00007e288, rawbuf=0x62b0000852a8 "ALTER TABLE t1 ENABLE KEYS", length=26, parser_state=0x7f4fe0e8b9a0) at /data/src/bb-10.6-monty/sql/sql_parse.cc:8019
      #24 0x0000556dbaa0f7fd in dispatch_command (command=COM_QUERY, thd=0x62b00007e288, packet=0x629000258289 "ALTER TABLE t1 ENABLE KEYS", packet_length=26, blocking=true) at /data/src/bb-10.6-monty/sql/sql_parse.cc:1897
      #25 0x0000556dbaa0c51e in do_command (thd=0x62b00007e288, blocking=true) at /data/src/bb-10.6-monty/sql/sql_parse.cc:1406
      #26 0x0000556dbae6bcb6 in do_handle_one_connection (connect=0x61100000ae88, put_in_cache=true) at /data/src/bb-10.6-monty/sql/sql_connect.cc:1410
      #27 0x0000556dbae6b613 in handle_one_connection (arg=0x61100000ad48) at /data/src/bb-10.6-monty/sql/sql_connect.cc:1312
      #28 0x0000556dbbb7b9ff in pfs_spawn_thread (arg=0x618000005508) at /data/src/bb-10.6-monty/storage/perfschema/pfs.cc:2201
      #29 0x00007f4fea7e8609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #30 0x00007f4fea3bc293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      The failure was introduced in bb-10.6-monty by this commit:

      commit b6a599ddd06c932f58977ff384d09fb5d4a57e97
      Author: Monty
      Date:   Wed Apr 14 13:40:36 2021 +0300
       
          Fix all warnings given by UBSAN
      

      Attachments

        Activity

          People

            monty Michael Widenius
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            4 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.