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

ASAN SEGV in get_prefix upon modifying base column type with existing indexed virtual column

    XMLWordPrintable

Details

    Description

      CREATE TABLE t1 ( 
          a TIMESTAMP,
          b TIMESTAMP AS (a) VIRTUAL,
          KEY (b)
      );
      ALTER TABLE t1 MODIFY a BLOB FIRST;
       
      # Cleanup
      DROP TABLE t1;
      

      10.4 ASAN b9dea911

      ASAN:DEADLYSIGNAL
      =================================================================
      ==21894==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x5630df985385 bp 0x7f90a7deff50 sp 0x7f90a7deff20 T5)
          #0 0x5630df985384 in get_prefix /data/src/10.4/sql-common/my_time.c:328
          #1 0x5630df9855ed in find_body /data/src/10.4/sql-common/my_time.c:357
          #2 0x5630df9882b1 in str_to_datetime_or_date /data/src/10.4/sql-common/my_time.c:880
          #3 0x5630de1b60a0 in Temporal::ascii_to_datetime_or_date(st_mysql_time_status*, char const*, unsigned long, date_mode_t) (/data/bld/10.4-asan-nightly/bin/mysqld+0x155f0a0)
          #4 0x5630de1aceda in Temporal::str_to_datetime_or_date(THD*, st_mysql_time_status*, char const*, unsigned long, charset_info_st const*, date_mode_t) /data/src/10.4/sql/sql_time.cc:393
          #5 0x5630de3a3f15 in Temporal_with_date::Temporal_with_date(THD*, st_mysql_time_status*, char const*, unsigned long, charset_info_st const*, date_mode_t) /data/src/10.4/sql/sql_type.h:1827
          #6 0x5630de3a4d21 in Datetime::Datetime(THD*, st_mysql_time_status*, char const*, unsigned long, charset_info_st const*, date_mode_t) (/data/bld/10.4-asan-nightly/bin/mysqld+0x174dd21)
          #7 0x5630de38fd86 in Type_handler_string_result::Item_temporal_precision(THD*, Item*, bool) const /data/src/10.4/sql/sql_type.cc:6343
          #8 0x5630de3aa822 in Type_handler_string_result::Item_datetime_precision(THD*, Item*) const /data/src/10.4/sql/sql_type.h:4651
          #9 0x5630de3b087c in Item::datetime_precision(THD*) /data/src/10.4/sql/item.h:1639
          #10 0x5630de5a9a0f in Field_timestamp::conversion_depends_on_sql_mode(THD*, Item*) const /data/src/10.4/sql/field.cc:5070
          #11 0x5630de58c4b8 in Field::check_vcol_sql_mode_dependency(THD*, vcol_init_mode) const /data/src/10.4/sql/field.cc:1411
          #12 0x5630de15fc48 in parse_vcol_defs(THD*, st_mem_root*, TABLE*, bool*, vcol_init_mode) /data/src/10.4/sql/table.cc:1155
          #13 0x5630de176e9b in open_table_from_share(THD*, TABLE_SHARE*, st_mysql_const_lex_string const*, unsigned int, unsigned int, unsigned int, TABLE*, bool, List<String>*) /data/src/10.4/sql/table.cc:3798
          #14 0x5630de0e9763 in create_table_for_inplace_alter /data/src/10.4/sql/sql_table.cc:9302
          #15 0x5630de0ed1dc 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:10025
          #16 0x5630de24e1bf in Sql_cmd_alter_table::execute(THD*) /data/src/10.4/sql/sql_alter.cc:508
          #17 0x5630ddebd241 in mysql_execute_command(THD*) /data/src/10.4/sql/sql_parse.cc:6094
          #18 0x5630ddec82b2 in mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool) /data/src/10.4/sql/sql_parse.cc:7912
          #19 0x5630dde9fa09 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool) /data/src/10.4/sql/sql_parse.cc:1841
          #20 0x5630dde9c758 in do_command(THD*) /data/src/10.4/sql/sql_parse.cc:1359
          #21 0x5630de23838d in do_handle_one_connection(CONNECT*) /data/src/10.4/sql/sql_connect.cc:1412
          #22 0x5630de237d41 in handle_one_connection /data/src/10.4/sql/sql_connect.cc:1316
          #23 0x5630df81f05d in pfs_spawn_thread /data/src/10.4/storage/perfschema/pfs.cc:1862
          #24 0x7f90b26034a3 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x74a3)
          #25 0x7f90b0b4bd0e in __clone (/lib/x86_64-linux-gnu/libc.so.6+0xe8d0e)
       
      AddressSanitizer can not provide additional info.
      SUMMARY: AddressSanitizer: SEGV /data/src/10.4/sql-common/my_time.c:328 in get_prefix
      Thread T5 created by T0 here:
          #0 0x7f90b2849f59 in __interceptor_pthread_create (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x30f59)
          #1 0x5630df81f44a in spawn_thread_v1 /data/src/10.4/storage/perfschema/pfs.cc:1912
          #2 0x5630ddbdf5e8 in inline_mysql_thread_create /data/src/10.4/include/mysql/psi/mysql_thread.h:1268
          #3 0x5630ddbf444f in create_thread_to_handle_connection(CONNECT*) /data/src/10.4/sql/mysqld.cc:6240
          #4 0x5630ddbf4b32 in create_new_thread(CONNECT*) /data/src/10.4/sql/mysqld.cc:6310
          #5 0x5630ddbf4ebd in handle_accepted_socket(st_mysql_socket, st_mysql_socket) /data/src/10.4/sql/mysqld.cc:6408
          #6 0x5630ddbf5b0f in handle_connections_sockets() /data/src/10.4/sql/mysqld.cc:6566
          #7 0x5630ddbf3cd0 in mysqld_main(int, char**) /data/src/10.4/sql/mysqld.cc:5898
          #8 0x5630ddbdd4cf in main /data/src/10.4/sql/main.cc:25
          #9 0x7f90b0a832e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)
       
      ==21894==ABORTING
      

      Non-ASAN build doesn't crash, but possibly it's just the matter of luck.

      The failure appeared in 10.4 tree after this commit:

      commit c924e39fab54ed63a427c27d39778eacd961764b
      Author: Alexander Barkov
      Date:   Fri Sep 13 11:04:23 2019 +0400
       
          MDEV-18153 Assertion `0' or Assertion `btr_validate_index(index, 0)' failed in row_upd_sec_index_entry or error code 126: Index is corrupted upon UPDATE with TIME_ROUND_FRACTIONAL
      

      Attachments

        Activity

          People

            bar Alexander Barkov
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.