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

SIGSEGV in do_mark_index_columns on UPDATE w/ UNIQUE index

    XMLWordPrintable

Details

    • Not for Release Notes

    Description

      set sql_mode='';
      CREATE TABLE t (a INT) ENGINE=InnoDB PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (1));
      INSERT INTO t VALUES (NULL);
      ALTER TABLE t ADD PARTITION (PARTITION p2 VALUES LESS THAN (20));
      INSERT INTO t VALUES (ADDTIME('10:10:10',0));
      CREATE UNIQUE INDEX i2 ON t (a);
      UPDATE t SET a=((SELECT MAX(a) FROM t));
      

      MDEV-36301 CS 12.1.0 8f486f2f74a81d568b0ae1c89f7971cbff4ed6ee (Optimized) Build 03/06/2025

      Issue was found during testing MDEV-36301 on UBSAN build
      

      SETUP:

      Compiled with a recent version of Clang (I used Clang 18.1.3) with LLVM 18. Ubuntu 
      Compiled with: "-DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_C{,XX}_FLAGS='-march=native -mtune=native'" and:
      

      Stacktrace from 12.0.1

      Thread pointer: 0x52c0001b0218
      stack_bottom = 0x7543e22db000 thread_stack 0xb00000
      /test/UBASAN_MD070525-mariadb-12.0.1-linux-x86_64-dbg/bin/mariadbd(___interceptor_backtrace+0x4a)[0x6073d04c609a]
      mysys/stacktrace.c:215(my_print_stacktrace)[0x6073d339b614]
      sql/signal_handler.cc:0(handle_fatal_signal)[0x6073d19f23af]
      libc_sigaction.c:0(__restore_rt)[0x7544d2445330] 
      sql/table.cc:7795(do_mark_index_columns(TABLE*, unsigned int, st_bitmap*, bool))[0x6073d1132c82]
      sql/sql_update.cc:0(prepare_record_for_error_message(int, TABLE*))[0x6073d1066476]
      sql/sql_update.cc:2842(multi_update::do_updates())[0x6073d1081dc6]
      sql/sql_update.cc:0(multi_update::send_eof())[0x6073d108349e]
      sql/sql_select.cc:24012(do_select(JOIN*, Procedure*))[0x6073d0d4865f]
      sql/sql_select.cc:0(JOIN::exec_inner())[0x6073d0d43f02]
      sql/sql_select.cc:4858(JOIN::exec())[0x6073d0d41823]
      sql/sql_select.cc:34736(Sql_cmd_dml::execute_inner(THD*))[0x6073d0e211da]
      sql/sql_update.cc:0(Sql_cmd_update::execute_inner(THD*))[0x6073d1089c87]
      sql/sql_select.cc:34674(Sql_cmd_dml::execute(THD*))[0x6073d0e1ff96]
      sql/sql_parse.cc:0(mysql_execute_command(THD*, bool))[0x6073d0b6cbb8]
      sql/sql_parse.cc:7908(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x6073d0b4a619]
      sql/sql_parse.cc:0(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x6073d0b3e582]
      sql/sql_parse.cc:1418(do_command(THD*, bool))[0x6073d0b4d03e]
      sql/sql_connect.cc:1414(do_handle_one_connection(CONNECT*, bool))[0x6073d1219ddd]
      sql/sql_connect.cc:0(handle_one_connection)[0x6073d1219698]
      asan_interceptors.cpp.o:0(asan_thread_start(void*))[0x6073d051a0bd]
      nptl/pthread_create.c:447(start_thread)[0x7544d249caa4]
      

      Also seen on other branches:

      SAN Bug Detection Matrix

          Rel    o/d  Build   Commit                                    UniqueID observed
      CS  10.5   dbg  070525  5c92b27d5433df7558f41ac5718481f87bdfa544  SIGSEGV|do_mark_index_columns|prepare_record_for_error_message|multi_update::do_updates|multi_update::send_eof
      CS  10.5   opt  070525  5c92b27d5433df7558f41ac5718481f87bdfa544  SIGSEGV|do_mark_index_columns|prepare_record_for_error_message|multi_update::do_updates|multi_update::send_eof
      CS  10.6   dbg  070525  c62671543976eb397576f1b57fb6817029bc21ee  SIGSEGV|do_mark_index_columns|prepare_record_for_error_message|multi_update::do_updates|multi_update::send_eof
      CS  10.6   opt  070525  c62671543976eb397576f1b57fb6817029bc21ee  SIGSEGV|do_mark_index_columns|prepare_record_for_error_message|multi_update::do_updates|multi_update::send_eof
      CS  10.11  dbg  070525  2263c8a1f7db9b308e1458d1ddc4203d006940d7  SIGSEGV|do_mark_index_columns|prepare_record_for_error_message|multi_update::do_updates|multi_update::send_eof
      CS  10.11  opt  070525  2263c8a1f7db9b308e1458d1ddc4203d006940d7  SIGSEGV|do_mark_index_columns|prepare_record_for_error_message|multi_update::do_updates|multi_update::send_eof
      CS  11.4   dbg  070525  da5a4d05b9da58705498a42b6ffa5d9211f446af  SIGSEGV|do_mark_index_columns|prepare_record_for_error_message|multi_update::do_updates|multi_update::send_eof
      CS  11.4   opt  070525  da5a4d05b9da58705498a42b6ffa5d9211f446af  SIGSEGV|do_mark_index_columns|prepare_record_for_error_message|multi_update::do_updates|multi_update::send_eof
      CS  11.8   dbg  070525  865b05bf4acf10e0d4b3359019ed7b2efe0be81d  SIGSEGV|do_mark_index_columns|prepare_record_for_error_message|multi_update::do_updates|multi_update::send_eof
      CS  11.8   opt  070525  865b05bf4acf10e0d4b3359019ed7b2efe0be81d  SIGSEGV|do_mark_index_columns|prepare_record_for_error_message|multi_update::do_updates|multi_update::send_eof
      CS  12.0   dbg  070525  51c0afcd248ad57095fdcf56efec2865ea49bd83  SIGSEGV|do_mark_index_columns|prepare_record_for_error_message|multi_update::do_updates|multi_update::send_eof
      CS  12.0   opt  070525  51c0afcd248ad57095fdcf56efec2865ea49bd83  SIGSEGV|do_mark_index_columns|prepare_record_for_error_message|multi_update::do_updates|multi_update::send_eof
      ES  10.5   dbg  070525  0d368ec0042a81d9549fc939fb742f82350b20ab  No bug found
      ES  10.5   opt  070525  0d368ec0042a81d9549fc939fb742f82350b20ab  No bug found
      ES  10.6   opt  070525  6111fbaf7bdcb6f1170f556ffd05d6e1a4159f62  No bug found
      ES  11.4   dbg  070525  9cd12544ebfd0d52d2158af66b5aced58121cf1f  No bug found
      ES  11.4   opt  070525  9cd12544ebfd0d52d2158af66b5aced58121cf1f  No bug found
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              saahil Saahil Alam
              Votes:
              0 Vote for this issue
              Watchers:
              5 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.