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

Server crash in Item_field::register_field_in_read_map upon modifying column into a blob

    XMLWordPrintable

Details

    Description

      Note: The failure became possible after MDEV-371, without it ALTER is rejected due to the missing length in the key definition.

      --source include/have_innodb.inc
       
      CREATE TABLE t1 ( 
        pk INT,
        a INT,
        b INT,
        c CHAR(100),
        vc CHAR(100) AS (c) VIRTUAL,
        PRIMARY KEY(pk),
        KEY(c(64)),
        KEY(pk,a),
        KEY(b,vc(64))
       ) ENGINE=InnoDB;
      ALTER TABLE t1 MODIFY a TEXT;
       
      # Cleanup
      DROP TABLE t1;
      

      10.4 fb01193c

      #3  <signal handler called>
      #4  0x00005562a5d173a5 in Item_field::register_field_in_read_map (this=0x7f6548062040, arg=0x7f659f5aa200) at /data/src/10.4/sql/item.cc:789
      #5  0x00005562a58a2091 in Item::walk (this=0x7f6548062040, processor=&virtual table offset 896, walk_subquery=true, arg=0x7f659f5aa200) at /data/src/10.4/sql/item.h:1783
      #6  0x00005562a592d93b in Item_args::walk_args (this=0x7f6548062268, processor=&virtual table offset 896, walk_subquery=true, arg=0x7f659f5aa200) at /data/src/10.4/sql/item.h:2478
      #7  0x00005562a592dfb5 in Item_func_or_sum::walk (this=0x7f65480621e0, processor=&virtual table offset 896, walk_subquery=true, arg=0x7f659f5aa200) at /data/src/10.4/sql/item.h:5096
      #8  0x00005562a592d93b in Item_args::walk_args (this=0x7f6548062de0, processor=&virtual table offset 896, walk_subquery=true, arg=0x7f659f5aa200) at /data/src/10.4/sql/item.h:2478
      #9  0x00005562a592dfb5 in Item_func_or_sum::walk (this=0x7f6548062d58, processor=&virtual table offset 896, walk_subquery=true, arg=0x7f659f5aa200) at /data/src/10.4/sql/item.h:5096
      #10 0x00005562a60647ba in prepare_vcol_for_base_setup<dict_v_col_t> (table=0x7f6548063578, field=0x7f65480616c8, col=0x7f65480639a8) at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:10759
      #11 0x00005562a604b9ed in innodb_base_col_setup (table=0x7f6548063578, field=0x7f65480616c8, v_col=0x7f65480639a8) at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:10783
      #12 0x00005562a60617c0 in create_table_info_t::create_table_def (this=0x7f659f5a9ca0) at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:11095
      #13 0x00005562a604de7d in create_table_info_t::create_table (this=0x7f659f5a9ca0, create_fk=true) at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:12365
      #14 0x00005562a60626e8 in ha_innobase::create (this=0x7f6548060c48, name=0x7f659f5ac94d "./test/#sql-2307_9", form=0x7f659f5aa200, create_info=0x7f659f5accd0, file_per_table=true, trx=0x7f65a40d5268) at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:12683
      #15 0x00005562a604ead1 in ha_innobase::create (this=0x7f6548060c48, name=0x7f659f5ac94d "./test/#sql-2307_9", form=0x7f659f5aa200, create_info=0x7f659f5accd0) at /data/src/10.4/storage/innobase/handler/ha_innodb.cc:12736
      #16 0x00005562a5d07af0 in handler::ha_create (this=0x7f6548060c48, name=0x7f659f5ac94d "./test/#sql-2307_9", form=0x7f659f5aa200, info_arg=0x7f659f5accd0) at /data/src/10.4/sql/handler.cc:4816
      #17 0x00005562a5d08b65 in ha_create_table (thd=0x7f6548000b00, path=0x7f659f5ac94d "./test/#sql-2307_9", db=0x7f6548015c38 "test", table_name=0x7f6548015558 "t1", create_info=0x7f659f5accd0, frm=0x7f659f5ab8a0) at /data/src/10.4/sql/handler.cc:5190
      #18 0x00005562a5aa462d in mysql_alter_table (thd=0x7f6548000b00, new_db=0x7f6548005290, new_name=0x7f6548005690, create_info=0x7f659f5accd0, table_list=0x7f6548015590, alter_info=0x7f659f5acc10, order_num=0, order=0x0, ignore=false) at /data/src/10.4/sql/sql_table.cc:9976
      #19 0x00005562a5b32922 in Sql_cmd_alter_table::execute (this=0x7f6548015d60, thd=0x7f6548000b00) at /data/src/10.4/sql/sql_alter.cc:499
      #20 0x00005562a59c3aca in mysql_execute_command (thd=0x7f6548000b00) at /data/src/10.4/sql/sql_parse.cc:6346
      #21 0x00005562a59c8c72 in mysql_parse (thd=0x7f6548000b00, rawbuf=0x7f65480154a8 "ALTER TABLE t1 MODIFY a TEXT", length=28, parser_state=0x7f659f5ae180, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8157
      #22 0x00005562a59b4360 in dispatch_command (command=COM_QUERY, thd=0x7f6548000b00, packet=0x7f6548139fe1 "ALTER TABLE t1 MODIFY a TEXT", packet_length=28, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1829
      #23 0x00005562a59b2b34 in do_command (thd=0x7f6548000b00) at /data/src/10.4/sql/sql_parse.cc:1358
      #24 0x00005562a5b2c837 in do_handle_one_connection (connect=0x5562a98a7dc0) at /data/src/10.4/sql/sql_connect.cc:1399
      #25 0x00005562a5b2c5a8 in handle_one_connection (arg=0x5562a98a7dc0) at /data/src/10.4/sql/sql_connect.cc:1302
      #26 0x00005562a6023979 in pfs_spawn_thread (arg=0x5562a98edc30) at /data/src/10.4/storage/perfschema/pfs.cc:1862
      #27 0x00007f65abf9b494 in start_thread (arg=0x7f659f5af700) at pthread_create.c:333
      #28 0x00007f65aa38193f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      10.4 ASAN fb01193c

      ==9357==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x564a17b27851 sp 0x7fbc00516c40 bp 0x7fbc00516c70 T27)
          #0 0x564a17b27850 in Item_field::register_field_in_read_map(void*) /data/src/10.4/sql/item.cc:789
          #1 0x564a170d7b87 in Item::walk(bool (Item::*)(void*), bool, void*) /data/src/10.4/sql/item.h:1783
          #2 0x564a172089ce in Item_args::walk_args(bool (Item::*)(void*), bool, void*) /data/src/10.4/sql/item.h:2478
          #3 0x564a17209b36 in Item_func_or_sum::walk(bool (Item::*)(void*), bool, void*) /data/src/10.4/sql/item.h:5096
          #4 0x564a172089ce in Item_args::walk_args(bool (Item::*)(void*), bool, void*) /data/src/10.4/sql/item.h:2478
          #5 0x564a17209b36 in Item_func_or_sum::walk(bool (Item::*)(void*), bool, void*) /data/src/10.4/sql/item.h:5096
          #6 0x564a1832f5d4 in void prepare_vcol_for_base_setup<dict_v_col_t>(dict_table_t const*, Field const*, dict_v_col_t*) (/data/bld/10.4-asan-daily/bin/mysqld+0x1fd35d4)
          #7 0x564a182f8843 in innodb_base_col_setup(dict_table_t*, Field const*, dict_v_col_t*) /data/src/10.4/storage/innobase/handler/ha_innodb.cc:10783
          #8 0x564a183296bc in create_table_info_t::create_table_def() (/data/bld/10.4-asan-daily/bin/mysqld+0x1fcd6bc)
          #9 0x564a182fe433 in create_table_info_t::create_table(bool) /data/src/10.4/storage/innobase/handler/ha_innodb.cc:12365
          #10 0x564a1832bb7d in ha_innobase::create(char const*, TABLE*, HA_CREATE_INFO*, bool, trx_t*) (/data/bld/10.4-asan-daily/bin/mysqld+0x1fcfb7d)
          #11 0x564a18300087 in ha_innobase::create(char const*, TABLE*, HA_CREATE_INFO*) /data/src/10.4/storage/innobase/handler/ha_innodb.cc:12736
          #12 0x564a17b00b4f in handler::ha_create(char const*, TABLE*, HA_CREATE_INFO*) /data/src/10.4/sql/handler.cc:4816
          #13 0x564a17b03c2e in ha_create_table(THD*, char const*, char const*, char const*, HA_CREATE_INFO*, st_mysql_const_unsigned_lex_string*) /data/src/10.4/sql/handler.cc:5190
          #14 0x564a1758cd26 in mysql_alter_table(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*, HA_CREATE_INFO*, TABLE_LIST*, Alter_info*, unsigned int, st_order*, bool) /data/src/10.4/sql/sql_table.cc:9976
          #15 0x564a176e2b5a in Sql_cmd_alter_table::execute(THD*) /data/src/10.4/sql/sql_alter.cc:499
          #16 0x564a1735fe7d in mysql_execute_command(THD*) /data/src/10.4/sql/sql_parse.cc:6346
          #17 0x564a1736a87e in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /data/src/10.4/sql/sql_parse.cc:8157
          #18 0x564a17342a87 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /data/src/10.4/sql/sql_parse.cc:1829
          #19 0x564a1733f888 in do_command(THD*) /data/src/10.4/sql/sql_parse.cc:1358
          #20 0x564a176d3449 in do_handle_one_connection(CONNECT*) /data/src/10.4/sql/sql_connect.cc:1399
          #21 0x564a176d2e42 in handle_one_connection /data/src/10.4/sql/sql_connect.cc:1302
          #22 0x564a1829df5e in pfs_spawn_thread /data/src/10.4/storage/perfschema/pfs.cc:1862
          #23 0x7fbc0bec6493 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x7493)
          #24 0x7fbc0a2ac93e in __clone (/lib/x86_64-linux-gnu/libc.so.6+0xe893e)
       
      AddressSanitizer can not provide additional info.
      SUMMARY: AddressSanitizer: SEGV /data/src/10.4/sql/item.cc:789 Item_field::register_field_in_read_map(void*)
      Thread T27 created by T0 here:
          #0 0x7fbc0c0ffbba in pthread_create (/usr/lib/x86_64-linux-gnu/libasan.so.1+0x23bba)
          #1 0x564a1829e526 in spawn_thread_v1 /data/src/10.4/storage/perfschema/pfs.cc:1912
          #2 0x564a1708ec96 in inline_mysql_thread_create /data/src/10.4/include/mysql/psi/mysql_thread.h:1268
          #3 0x564a170a44c0 in create_thread_to_handle_connection(CONNECT*) /data/src/10.4/sql/mysqld.cc:6194
          #4 0x564a170a4bc5 in create_new_thread(CONNECT*) /data/src/10.4/sql/mysqld.cc:6264
          #5 0x564a170a4f55 in handle_accepted_socket(st_mysql_socket, st_mysql_socket) /data/src/10.4/sql/mysqld.cc:6362
          #6 0x564a170a5ba1 in handle_connections_sockets() /data/src/10.4/sql/mysqld.cc:6520
          #7 0x564a170a3cfb in mysqld_main(int, char**) /data/src/10.4/sql/mysqld.cc:5852
          #8 0x564a1708cb1f in main /data/src/10.4/sql/main.cc:25
          #9 0x7fbc0a1e42b0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202b0)
       
      ==9357==ABORTING
      

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.