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

use-of-uninitialized-value in rollback_inplace_alter_table(Alter_inplace_info*, TABLE const*, row_prebuilt_t*)

    XMLWordPrintable

Details

    • Can result in hang or crash
    • Hide
      When an ALTER TABLE statement using ALGORITHM=INSTANT on an InnoDB table with virtual columns failed and rolled back, the virtual columns were corrupted. This occurred if the operation failed during the preparation or commit phase, such as when adding a column caused the row size to exceed the limit of 8126 bytes. The server now correctly rolls back the operation without corrupting the virtual columns.
      Show
      When an ALTER TABLE statement using ALGORITHM=INSTANT on an InnoDB table with virtual columns failed and rolled back, the virtual columns were corrupted. This occurred if the operation failed during the preparation or commit phase, such as when adding a column caused the row size to exceed the limit of 8126 bytes. The server now correctly rolls back the operation without corrupting the virtual columns.
    • Q4/2026 Server Maintenance

    Description

      CS 10.11.19 9b6fdee3456df8e979f91ffdd727ba85fc491442 (Debug, MSAN, Clang 20.1.8-20250804) Build 08/07/2026

      # 2026-07-08T23:09:33 [3070108] | SUMMARY: MemorySanitizer: use-of-uninitialized-value /test/10.11_dbg_msan/storage/innobase/handler/handler0alter.cc:9378:22 in rollback_inplace_alter_table(Alter_inplace_info*, TABLE const*, row_prebuilt_t*)
      
      

      StackTrace

      # 2026-07-08T23:09:33 [3070108] | 2026-07-08 23:07:15 30 [ERROR] InnoDB: Cannot add field `col_text_copy` in table `test`.`t4` because after adding it, the row size is 2144 which is greater than maximum allowed size (1979 bytes) for a record on index leaf page.
      # 2026-07-08T23:09:33 [3070108] | ==3079868==WARNING: MemorySanitizer: use-of-uninitialized-value
      # 2026-07-08T23:09:33 [3070108] | 2026-07-08 23:07:20 0 [Note] InnoDB: Resized log to 64.000MiB; start LSN=856576
      # 2026-07-08T23:09:33 [3070108] |     #0 0x5f2eddb43199 in rollback_inplace_alter_table(Alter_inplace_info*, TABLE const*, row_prebuilt_t*) /test/10.11_dbg_msan/storage/innobase/handler/handler0alter.cc:9378:22
      # 2026-07-08T23:09:33 [3070108] |     #1 0x5f2edcf51cf0 in mysql_inplace_alter_table(THD*, TABLE_LIST*, TABLE*, TABLE*, Alter_inplace_info*, MDL_request*, st_ddl_log_state*, TRIGGER_RENAME_PARAM*, Alter_table_ctx*, bool&, unsigned long long&, bool) /test/10.11_dbg_msan/sql/sql_table.cc:8295:16
      # 2026-07-08T23:09:33 [3070108] |     #2 0x5f2edcf3c37c in mysql_alter_table(THD*, st_mysql_const_lex_string const*, st_mysql_const_lex_string const*, Table_specification_st*, TABLE_LIST*, Recreate_info*, Alter_info*, unsigned int, st_order*, bool, bool) /test/10.11_dbg_msan/sql/sql_table.cc:11462:16
      # 2026-07-08T23:09:33 [3070108] |     #3 0x5f2edd11f87a in Sql_cmd_alter_table::execute(THD*) /test/10.11_dbg_msan/sql/sql_alter.cc:688:11
      # 2026-07-08T23:09:33 [3070108] |     #4 0x5f2edcc46079 in mysql_execute_command(THD*, bool) /test/10.11_dbg_msan/sql/sql_parse.cc:6199:26
      # 2026-07-08T23:09:33 [3070108] |     #5 0x5f2edcc3a6ef in mysql_parse(THD*, char*, unsigned int, Parser_state*) /test/10.11_dbg_msan/sql/sql_parse.cc:8219:18
      # 2026-07-08T23:09:33 [3070108] |     #6 0x5f2edcc34126 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /test/10.11_dbg_msan/sql/sql_parse.cc:1924:7
      # 2026-07-08T23:09:33 [3070108] |     #7 0x5f2edcc3b1ae in do_command(THD*, bool) /test/10.11_dbg_msan/sql/sql_parse.cc:1434:17
      # 2026-07-08T23:09:33 [3070108] |     #8 0x5f2edd10722c in do_handle_one_connection(CONNECT*, bool) /test/10.11_dbg_msan/sql/sql_connect.cc:1482:11
      # 2026-07-08T23:09:33 [3070108] |     #9 0x5f2edd106bb6 in handle_one_connection /test/10.11_dbg_msan/sql/sql_connect.cc:1394:5
      # 2026-07-08T23:09:33 [3070108] |     #10 0x79b9c709caa3 in start_thread nptl/pthread_create.c:447:8
      # 2026-07-08T23:09:33 [3070108] |     #11 0x79b9c7129a63 in clone misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:100
      # 2026-07-08T23:09:33 [3070108] | 
      # 2026-07-08T23:09:33 [3070108] |   Member fields were destroyed
      # 2026-07-08T23:09:33 [3070108] |     #0 0x5f2edc1696b1 in __sanitizer_dtor_callback_fields (/data/Server_bin/MSAN_MD080726-mariadb-10.11.19-linux-x86_64-dbg/bin/mariadbd+0xff86b1) (BuildId: 9ac4fa3f4478741e712ebd6016da11b676c29367)
      # 2026-07-08T23:09:33 [3070108] |     #1 0x5f2eddb51889 in dict_v_col_t::~dict_v_col_t() /test/10.11_dbg_msan/storage/innobase/include/dict0mem.h:735:14
      # 2026-07-08T23:09:33 [3070108] |     #2 0x5f2eddb51889 in dict_v_col_t::~dict_v_col_t() /test/10.11_dbg_msan/storage/innobase/include/dict0mem.h:733:8
      # 2026-07-08T23:09:33 [3070108] |     #3 0x5f2eddb51889 in ha_innobase_inplace_ctx::~ha_innobase_inplace_ctx() /test/10.11_dbg_msan/storage/innobase/handler/handler0alter.cc:1203:19
      # 2026-07-08T23:09:33 [3070108] | 
      # 2026-07-08T23:09:33 [3070108] | SUMMARY: MemorySanitizer: use-of-uninitialized-value /test/10.11_dbg_msan/storage/innobase/handler/handler0alter.cc:9378:22 in rollback_inplace_alter_table(Alter_inplace_info*, TABLE const*, row_prebuilt_t*)
      

      RQG startup options

      # $RQG_HOME/rqg.pl \
      # --gendata=conf/mariadb/table_stress.zz \
      # --gendata_sql=conf/mariadb/table_stress.sql \
      # --grammar=conf/mariadb/table_stress_innodb_nocopy1.yy \
      # --redefine=conf/mariadb/redefine_innodb_log_archive.yy \
      # --mysqld=--loose-innodb_log_archive=ON \
      # --mysqld=--loose-innodb_log_file_size=16M \
      # --reporters=LogArchiveRecovery \
      # --mysqld=--loose-innodb_lock_schedule_algorithm=fcfs \
      # --mysqld=--loose-idle_write_transaction_timeout=0 \
      # --mysqld=--loose-idle_transaction_timeout=0 \
      # --mysqld=--loose-idle_readonly_transaction_timeout=0 \
      # --mysqld=--connect_timeout=60 \
      # --mysqld=--interactive_timeout=28800 \
      # --mysqld=--slave_net_timeout=60 \
      # --mysqld=--net_read_timeout=30 \
      # --mysqld=--net_write_timeout=60 \
      # --mysqld=--loose-table_lock_wait_timeout=50 \
      # --mysqld=--wait_timeout=28800 \
      # --no_mask \
      # --queries=10000000 \
      # --seed=random \
      # --reporters=None \
      # --reporters=ErrorLog \
      # --reporters=Deadlock \
      # --validators=None \
      # --mysqld=--log_output=none \
      # --mysqld=--log_bin_trust_function_creators=1 \
      # --mysqld=--loose-debug_assert_on_not_freed_memory=0 \
      # --engine=InnoDB \
      # --restart_timeout=240 \
      # --mysqld=--plugin-load-add=file_key_management.so \
      # --mysqld=--loose-file-key-management-filename=$RQG_HOME/conf/mariadb/encryption_keys.txt \
      # --mysqld=--plugin-load-add=provider_lzo.so \
      # --mysqld=--plugin-load-add=provider_bzip2.so \
      # --mysqld=--plugin-load-add=provider_lzma.so \
      # --mysqld=--plugin-load-add=provider_snappy.so \
      # --mysqld=--plugin-load-add=provider_lz4.so \
      # --mysqld=--loose-innodb_compression_level=1 \
      # --duration=300 \
      # --mysqld=--loose-innodb_fatal_semaphore_wait_threshold=300 \
      # --mysqld=--loose-innodb_data_file_path=ibdata1:1M:autoextend:autoshrink \
      # --redefine=conf/mariadb/redefine_innodb_log_write_ahead_size.yy \
      # --mysqld=--lock-wait-timeout=86400 \
      # --mysqld=--innodb-lock-wait-timeout=50 \
      # --mysqld=--sql_mode=STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION \
      # --mysqld=--loose-innodb_read_only_compressed=OFF \
      # --mysqld=--innodb_stats_persistent=on \
      # --mysqld=--innodb_adaptive_hash_index=off \
      # --mysqld=--innodb_random_read_ahead=OFF \
      # --mysqld=--innodb_log_buffer_size=2M \
      # --mysqld=--log-bin \
      # --mysqld=--sync-binlog=1 \
      # --mysqld=--loose-innodb_evict_tables_on_commit_debug=on \
      # --threads=6 \
      # --rr=rr record --wait \
      # --mysqld=--innodb_undo_log_truncate=OFF \
      # --mysqld=--innodb_undo_tablespaces=0 \
      # --mysqld=--innodb_rollback_on_timeout=ON \
      # --mysqld=--innodb_page_size=4K \
      # --mysqld=--innodb-buffer-pool-size=256M \
      # --vardir_type=slow \
      # --no_mask \
      # --batch \
      # --basedir1=/Server_bin/MSAN_MD080726-mariadb-10.11.19-linux-x86_64-dbg \
      # --basedir2=/Server_bin/MSAN_MD080726-mariadb-10.11.19-linux-x86_64-dbg \
      # --script_debug=_nix_ \
      # --major_runid=1783576491 \
      # --minor_runid=107
      

      RR trace is present on SDP:-
      /data/results/1783576491/TBR-2451

      Attachments

        Issue Links

          Activity

            People

              thiru Thirunarayanan Balathandayuthapani
              saahil Saahil Alam
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 0d
                  0d
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 1d 0.5h
                  1d 0.5h

                  Git Integration

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