Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.5, 10.6, 10.11, 11.4, 11.8, 12.0
Description
Different from MDEV-24706 (which the below testcase also triggers, upon the CREATE TABLE but only in debug builds), we have:
INSTALL SONAME 'ha_rocksdb'; |
SET sql_mode=''; |
CREATE OR REPLACE TABLE mysql.general_log (c INT) ENGINE=RocksDB; |
SET GLOBAL log_output='TABLE', GLOBAL general_log=TRUE; |
CREATE TABLE t (c INT) ENGINE=RocksDB; # Debug crash, i.e. MDEV-24706 |
XA START 'x'; |
INSERT INTO t VALUES (1); |
XA END 'x'; |
SET autocommit=0; |
XA COMMIT 'x' ONE PHASE; # Optimized builds crash, i.e. the bug described in this ticket, MDEV-36611 |
Leading to (note optimized builds only):
CS 10.11.12 acd071f599f416ddb4821dec485c4d912844213f (Optimized) Build 12/04/2025 |
Core was generated by `/test/MD120425-mariadb-10.11.12-linux-x86_64-opt/bin/mariadbd --no-defaults --m'.
|
Program terminated with signal SIGSEGV, Segmentation fault.
|
#0 0x00007e7a7842620f in myrocks::Rdb_transaction_impl::get_write_batch (this=<optimized out>) at /test/10.11_opt/storage/rocksdb/ha_rocksdb.cc:3134
|
3134 bool is_two_phase() const { return m_is_two_phase; }
|
[Current thread is 1 (LWP 1134505)]
|
(gdb) bt
|
#0 0x00007e7a7842620f in myrocks::Rdb_transaction_impl::get_write_batch (this=<optimized out>) at /test/10.11_opt/storage/rocksdb/ha_rocksdb.cc:3134
|
#1 0x00007e7a7842d6fa in myrocks::Rdb_transaction::make_stmt_savepoint_permanent (this=0x0, this@entry=0x7e79b825e150)at /test/10.11_opt/storage/rocksdb/ha_rocksdb.cc:3071
|
#2 0x00007e7a7841573f in myrocks::rocksdb_commit (hton=<optimized out>, thd=0x7e79b8000c68, commit_tx=false)at /test/10.11_opt/storage/rocksdb/ha_rocksdb.cc:4247
|
#3 0x000065082eea19b0 in commit_one_phase_2 (thd=thd@entry=0x7e79b8000c68, all=false, trans=0x7e79b8004518, is_real_trans=true)at /test/10.11_opt/sql/handler.cc:2160
|
#4 0x000065082eea1464 in ha_commit_one_phase (thd=0x7e79b8000c68, all=false)at /test/10.11_opt/sql/handler.cc:2111
|
#5 ha_commit_trans (thd=thd@entry=0x7e79b8000c68, all=false)at /test/10.11_opt/sql/handler.cc:1903
|
#6 0x000065082ed8913a in trans_commit_stmt (thd=thd@entry=0x7e79b8000c68)at /test/10.11_opt/sql/transaction.cc:501
|
#7 0x000065082ec5be41 in mysql_execute_command (thd=thd@entry=0x7e79b8000c68, is_called_from_prepared_stmt=<optimized out>)at /test/10.11_opt/sql/sql_parse.cc:6225
|
#8 0x000065082ec53c11 in mysql_parse (thd=thd@entry=0x7e79b8000c68, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x7e7aa1bfe480)at /test/10.11_opt/sql/sql_parse.cc:8188
|
#9 0x000065082ec520cc in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7e79b8000c68, packet=packet@entry=0x7e79b8008759 "XA COMMIT 'x' ONE PHASE", packet_length=packet_length@entry=23, blocking=true)at /test/10.11_opt/sql/sql_parse.cc:1905
|
#10 0x000065082ec54021 in do_command (thd=thd@entry=0x7e79b8000c68, blocking=true) at /test/10.11_opt/sql/sql_parse.cc:1418
|
#11 0x000065082ed781cd in do_handle_one_connection (connect=<optimized out>, connect@entry=0x6508323ba998, put_in_cache=true)at /test/10.11_opt/sql/sql_connect.cc:1386
|
#12 0x000065082ed77f93 in handle_one_connection (arg=arg@entry=0x6508323ba998)at /test/10.11_opt/sql/sql_connect.cc:1298
|
#13 0x000065082f0d664e in pfs_spawn_thread (arg=0x65083235a328)at /test/10.11_opt/storage/perfschema/pfs.cc:2201
|
#14 0x00007e7aa889ca94 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
|
#15 0x00007e7aa8929c3c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
|
Bug Detection Matrix |
Rel o/d Build Commit UniqueID observed
|
CS 10.5 dbg 120425 e6ea5d568c0fb972a391a8c64716846ddb7c57ef thd->transaction->stmt.is_empty() || thd->in_sub_stmt|SIGABRT|mysql_execute_command|mysql_parse|dispatch_command|do_command
|
CS 10.5 opt 120425 e6ea5d568c0fb972a391a8c64716846ddb7c57ef SIGSEGV|myrocks::Rdb_transaction_impl::get_write_batch|myrocks::Rdb_transaction::make_stmt_savepoint_permanent|myrocks::rocksdb_commit|commit_one_phase_2
|
CS 10.6 dbg 120425 690b2cf776faa2e1a6832077cec2246c86cd00bf thd->transaction->stmt.is_empty() || thd->in_sub_stmt|SIGABRT|mysql_execute_command|mysql_parse|dispatch_command|do_command
|
CS 10.6 opt 120425 690b2cf776faa2e1a6832077cec2246c86cd00bf SIGSEGV|myrocks::Rdb_transaction_impl::get_write_batch|myrocks::Rdb_transaction::make_stmt_savepoint_permanent|myrocks::rocksdb_commit|commit_one_phase_2
|
CS 10.11 dbg 120425 acd071f599f416ddb4821dec485c4d912844213f thd->transaction->stmt.is_empty() || thd->in_sub_stmt|SIGABRT|mysql_execute_command|mysql_parse|dispatch_command|do_command
|
CS 10.11 opt 120425 acd071f599f416ddb4821dec485c4d912844213f SIGSEGV|myrocks::Rdb_transaction_impl::get_write_batch|myrocks::Rdb_transaction::make_stmt_savepoint_permanent|myrocks::rocksdb_commit|commit_one_phase_2
|
CS 11.4 dbg 120425 4a701e8ce4a178faf955641caf59fc13fcc718e9 thd->transaction->stmt.is_empty() || thd->in_sub_stmt|SIGABRT|mysql_execute_command|mysql_parse|dispatch_command|do_command
|
CS 11.4 opt 120425 4a701e8ce4a178faf955641caf59fc13fcc718e9 SIGSEGV|myrocks::Rdb_transaction_impl::get_write_batch|myrocks::Rdb_transaction::make_stmt_savepoint_permanent|myrocks::rocksdb_commit|commit_one_phase_2
|
CS 11.8 dbg 120425 db5bb6f3339be5a49c0f397eb80a0f259f73f447 thd->transaction->stmt.is_empty() || thd->in_sub_stmt|SIGABRT|mysql_execute_command|mysql_parse|dispatch_command|do_command
|
CS 11.8 opt 120425 db5bb6f3339be5a49c0f397eb80a0f259f73f447 SIGSEGV|myrocks::Rdb_transaction_impl::get_write_batch|myrocks::Rdb_transaction::make_stmt_savepoint_permanent|myrocks::rocksdb_commit|commit_one_phase_2
|
CS 12.0 dbg 120425 22efc2c784e1b7199fb5804e6330168277ea7dce thd->transaction->stmt.is_empty() || thd->in_sub_stmt|SIGABRT|mysql_execute_command|mysql_parse|dispatch_command|do_command
|
CS 12.0 opt 120425 22efc2c784e1b7199fb5804e6330168277ea7dce SIGSEGV|myrocks::Rdb_transaction_impl::get_write_batch|myrocks::Rdb_transaction::make_stmt_savepoint_permanent|myrocks::rocksdb_commit|commit_one_phase_2
|
ES 10.5 dbg 120425 0d368ec0042a81d9549fc939fb742f82350b20ab thd->transaction->stmt.is_empty() || thd->in_sub_stmt|SIGABRT|mysql_execute_command|mysql_parse|dispatch_command|do_command
|
ES 10.5 opt 120425 0d368ec0042a81d9549fc939fb742f82350b20ab SIGSEGV|myrocks::Rdb_transaction_impl::get_write_batch|myrocks::Rdb_transaction::make_stmt_savepoint_permanent|myrocks::rocksdb_commit|commit_one_phase_2
|
ES 10.6 dbg 120425 74602d1b054ba6c9ee20af79d6e7807440a7a98e thd->transaction->stmt.is_empty() || thd->in_sub_stmt|SIGABRT|mysql_execute_command|mysql_parse|dispatch_command|do_command
|
ES 10.6 opt 120425 74602d1b054ba6c9ee20af79d6e7807440a7a98e SIGSEGV|myrocks::Rdb_transaction_impl::get_write_batch|myrocks::Rdb_transaction::make_stmt_savepoint_permanent|myrocks::rocksdb_commit|commit_one_phase_2
|
ES 11.4 dbg 120425 9cd12544ebfd0d52d2158af66b5aced58121cf1f thd->transaction->stmt.is_empty() || thd->in_sub_stmt|SIGABRT|mysql_execute_command|mysql_parse|dispatch_command|do_command
|
ES 11.4 opt 120425 9cd12544ebfd0d52d2158af66b5aced58121cf1f SIGSEGV|myrocks::Rdb_transaction_impl::get_write_batch|myrocks::Rdb_transaction::make_stmt_savepoint_permanent|myrocks::rocksdb_commit|commit_one_phase_2
|
Note: bug also present in bb-10.11.11-mdev16253-rocksdb-6.29fb. Testcase is CLI and MTR compatible.
We also see a UBSAN error for this on optimized UBASAN builds:
CS 11.8.1 33e0796e7a154e02a5e53c55cefc5d6feb4f5e6d (Optimized, UBASAN, Clang) Build 15/02/2025
/test/11.8_opt_san/storage/rocksdb/ha_rocksdb.cc:3352:28: runtime error: member call on null pointer of type 'rocksdb::Transaction'
#0 0x75bc1dc137d1 in myrocks::Rdb_transaction_impl::get_write_batch() /test/11.8_opt_san/storage/rocksdb/ha_rocksdb.cc:3352:28
#1 0x75bc1dc3ad92 in myrocks::Rdb_transaction::make_stmt_savepoint_permanent() /test/11.8_opt_san/storage/rocksdb/ha_rocksdb.cc:3046:40
#2 0x75bc1dbe1f04 in myrocks::rocksdb_commit(THD*, bool) /test/11.8_opt_san/storage/rocksdb/ha_rocksdb.cc:4218:11
#3 0x58d28a2554d5 in commit_one_phase_2(THD*, bool, THD_TRANS*, bool) /test/11.8_opt_san/sql/handler.cc:2218:17
#4 0x58d28a252e7b in ha_commit_trans(THD*, bool) /test/11.8_opt_san/sql/handler.cc:1954:12
#5 0x58d289b321e7 in trans_commit_stmt(THD*) /test/11.8_opt_san/sql/transaction.cc:496:10
#6 0x58d289476d4f in mysql_execute_command(THD*, bool) /test/11.8_opt_san/sql/sql_parse.cc:5970:7
#7 0x58d28944e600 in mysql_parse(THD*, char*, unsigned int, Parser_state*) /test/11.8_opt_san/sql/sql_parse.cc:7915:18
#8 0x58d2894458c6 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /test/11.8_opt_san/sql/sql_parse.cc:1902:7
#9 0x58d2894508c6 in do_command(THD*, bool) /test/11.8_opt_san/sql/sql_parse.cc:1415:17
#10 0x58d289ad6f5c in do_handle_one_connection(CONNECT*, bool) /test/11.8_opt_san/sql/sql_connect.cc:1415:11
#11 0x58d289ad67b6 in handle_one_connection /test/11.8_opt_san/sql/sql_connect.cc:1327:5
#12 0x58d288e9299c in asan_thread_start(void*) asan_interceptors.cpp.o
#13 0x75bcfaa9ca93 in start_thread nptl/pthread_create.c:447:8
#14 0x75bcfab29c3b in clone3 misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
SUMMARY: UndefinedBehaviorSanitizer: null-pointer-use /test/11.8_opt_san/storage/rocksdb/ha_rocksdb.cc:3352:28
250416 17:11:43 [ERROR] /test/UBASAN_MD150225-mariadb-11.8.1-linux-x86_64-opt/bin/mariadbd got signal 11 ;