Type:
Bug
Priority:
Major
Resolution:
Fixed
Affects Version/s:
10.6 , 10.8(EOL) , 10.9(EOL) , 10.10(EOL) , 10.11 , 11.0(EOL)
InnoDB internal fulltext transaction uses bulk insert and fails with heap use after free error.
Problem is that InnoDB fails to reset the check_foreigns and check_unique_secondary while
freeing the transaction or after commiting the transaction. This transaction object
is being used by the internal fulltext transaction, lead to un-necessary
bulk insert operation.
origin/10.7 8356fb68c366b7f515f9060d964ee598653756a6 2023-01-04T14:52:25+02:00
Some RQG test where 33 sessions run a DDL/DML mix.
==1862238==ERROR: AddressSanitizer: heap-use-after-free on address 0x6160114a5a20 at pc 0x563149ea3643 bp 0x31ff375c5cf0 sp 0x31ff375c5ce0
READ of size 8 at 0x6160114a5a20 thread T45
#0 0x563149ea3642 in row_merge_bulk_t::~row_merge_bulk_t() /data/Server/10.7A/storage/innobase/row/row0merge.cc:5125
#1 0x56314a093016 in trx_t::commit_cleanup() /data/Server/10.7A/storage/innobase/trx/trx0trx.cc:1398
#2 0x56314a09ed3a in trx_t::commit() /data/Server/10.7A/storage/innobase/trx/trx0trx.cc:1496
#3 0x56314a09f273 in trx_commit_for_mysql(trx_t*) /data/Server/10.7A/storage/innobase/trx/trx0trx.cc:1610
#4 0x56314a3f5a53 in fts_commit_table /data/Server/10.7A/storage/innobase/fts/fts0fts.cc:2966
#5 0x56314a3f5bad in fts_commit(trx_t*) /data/Server/10.7A/storage/innobase/fts/fts0fts.cc:2999
#6 0x56314a09a99a in trx_t::commit_low(mtr_t*) /data/Server/10.7A/storage/innobase/trx/trx0trx.cc:1431
#7 0x56314a09e39f in trx_t::commit_persist() /data/Server/10.7A/storage/innobase/trx/trx0trx.cc:1481
#8 0x56314a09e9c6 in trx_t::commit() /data/Server/10.7A/storage/innobase/trx/trx0trx.cc:1490
#9 0x56314a09f273 in trx_commit_for_mysql(trx_t*) /data/Server/10.7A/storage/innobase/trx/trx0trx.cc:1610
#10 0x563149ac8b32 in innobase_commit_low(trx_t*) /data/Server/10.7A/storage/innobase/handler/ha_innodb.cc:4375
#11 0x563149ac8c42 in innobase_commit_ordered_2 /data/Server/10.7A/storage/innobase/handler/ha_innodb.cc:4481
#12 0x563149ac942d in innobase_commit_ordered /data/Server/10.7A/storage/innobase/handler/ha_innodb.cc:4530
#13 0x56314962e9fc in TC_LOG::run_commit_ordered(THD*, bool) /data/Server/10.7A/sql/log.cc:9328
#14 0x563149644112 in MYSQL_BIN_LOG::trx_group_commit_leader(MYSQL_BIN_LOG::group_commit_entry*) /data/Server/10.7A/sql/log.cc:8557
#15 0x56314964572f in MYSQL_BIN_LOG::write_transaction_to_binlog_events(MYSQL_BIN_LOG::group_commit_entry*) /data/Server/10.7A/sql/log.cc:8134
#16 0x5631496464e2 in MYSQL_BIN_LOG::write_transaction_to_binlog(THD*, binlog_cache_mngr*, Log_event*, bool, bool, bool, bool) /data/Server/10.7A/sql/log.cc:7731
#17 0x56314964684d in binlog_flush_cache /data/Server/10.7A/sql/log.cc:1774
#18 0x56314964e13f in binlog_commit_flush_xid_caches /data/Server/10.7A/sql/log.cc:1924
#19 0x56314964e13f in MYSQL_BIN_LOG::log_and_order(THD*, unsigned long long, bool, bool, bool) /data/Server/10.7A/sql/log.cc:10268
# 2023-01-04T14:45:23 [1856282] | [rr 1862238 734941] #20 0x5631491b25b3 in ha_commit_trans(THD*, bool) /data/Server/10.7A/sql/handler.cc:1892
...
0x6160114a5a20 is located 160 bytes inside of 592-byte region [0x6160114a5980,0x6160114a5bd0)
freed by thread T45 here:
#0 0x563146fb37cf in __interceptor_free (/lib/x86_64-linux-gnu/libasan.so.5+0x10d7cf)
#1 0x563149d33b86 in mem_heap_block_free(mem_block_info_t*, mem_block_info_t*) /data/Server/10.7A/storage/innobase/mem/mem0mem.cc:416
...
# git clone https://github.com/mleich1/rqg --branch <pick the right branch> RQG
#
# GIT_SHOW: HEAD -> master, origin/master, origin/HEAD 3e746fb256826b1ce9344039ca9f5986068f86f5 2023-01-03T13:44:43+01:00
# rqg.pl : Version 4.2.1 (2022-12)
#
# $RQG_HOME/rqg.pl \
# --grammar=conf/mariadb/table_stress_innodb.yy \
# --gendata=conf/mariadb/table_stress.zz \
# --gendata_sql=conf/mariadb/table_stress.sql \
# --mysqld=--transaction-isolation=SERIALIZABLE \
# --validator=SelectStability \
# --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 \
# --mysqld=--lock-wait-timeout=86400 \
# --mysqld=--innodb-lock-wait-timeout=50 \
# --no-mask \
# --queries=10000000 \
# --seed=random \
# --reporters=Backtrace \
# --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 \
# --duration=300 \
# --mysqld=--loose-innodb_fatal_semaphore_wait_threshold=300 \
# --mysqld=--innodb_file_per_table=1 \
# --mysqld=--loose-innodb_read_only_compressed=OFF \
# --mysqld=--innodb_stats_persistent=off \
# --mysqld=--innodb_adaptive_hash_index=off \
# --redefine=conf/mariadb/redefine_checks_off.yy \
# --mysqld=--log-bin \
# --mysqld=--sync-binlog=1 \
# --mysqld=--loose-innodb_evict_tables_on_commit_debug=on \
# --mysqld=--loose-max-statement-time=30 \
# --threads=33 \
# --mysqld=--innodb-use-native-aio=0 \
# --mysqld=--loose-gdb \
# --mysqld=--loose-debug-gdb \
# --rr=Extended \
# --rr_options=--chaos --wait \
# --mysqld=--loose_innodb_change_buffering=all \
# --mysqld=--innodb_rollback_on_timeout=OFF \
# --mysqld=--innodb_page_size=64K \
# --mysqld=--innodb-buffer-pool-size=24M \
# <local settings>
pluto:/data/results/1672841958/TBR-1710$ _RR_TRACE_DIR=./1/rr/ rr replay --mark-stdio
pluto:/data/results/1672841958/TBR-1710/rqg.log ~ line 9329 ASAN output
{"report":{"fcp":1016.3999996185303,"ttfb":191.39999961853027,"pageVisibility":"visible","entityId":117989,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"e6e1a3b9-4809-409b-a7cb-5efb0a0e53dd","navigationType":0,"readyForUser":1108.1999998092651,"redirectCount":0,"resourceLoadedEnd":870.8999996185303,"resourceLoadedStart":197.7999997138977,"resourceTiming":[{"duration":173.90000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":197.7999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":197.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":371.69999980926514,"responseStart":0,"secureConnectionStart":0},{"duration":173.7999997138977,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bv2/820016/12ta74/2380add21a9a1006587582385952de73/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":198.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":198.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":371.8999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":184.2000002861023,"initiatorType":"script","name":"https://jira.mariadb.org/s/e9b27a47da5fb0f74a35acd57e9847fb-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":198.2999997138977,"connectEnd":198.2999997138977,"connectStart":198.2999997138977,"domainLookupEnd":198.2999997138977,"domainLookupStart":198.2999997138977,"fetchStart":198.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":198.2999997138977,"responseEnd":382.5,"responseStart":382.5,"secureConnectionStart":198.2999997138977},{"duration":282.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/c32eb0da7ad9831253f8397e6cc26afd-CDN/lu2bv2/820016/12ta74/2380add21a9a1006587582385952de73/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":198.5,"connectEnd":198.5,"connectStart":198.5,"domainLookupEnd":198.5,"domainLookupStart":198.5,"fetchStart":198.5,"redirectEnd":0,"redirectStart":0,"requestStart":198.5,"responseEnd":481.19999980926514,"responseStart":481.19999980926514,"secureConnectionStart":198.5},{"duration":287.1000003814697,"initiatorType":"script","name":"https://jira.mariadb.org/s/bc0bcb146314416123c992714ee00ff7-CDN/lu2bv2/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":198.89999961853027,"connectEnd":198.89999961853027,"connectStart":198.89999961853027,"domainLookupEnd":198.89999961853027,"domainLookupStart":198.89999961853027,"fetchStart":198.89999961853027,"redirectEnd":0,"redirectStart":0,"requestStart":198.89999961853027,"responseEnd":486,"responseStart":486,"secureConnectionStart":198.89999961853027},{"duration":287.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":199.2999997138977,"connectEnd":199.2999997138977,"connectStart":199.2999997138977,"domainLookupEnd":199.2999997138977,"domainLookupStart":199.2999997138977,"fetchStart":199.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":199.2999997138977,"responseEnd":486.3999996185303,"responseStart":486.3999996185303,"secureConnectionStart":199.2999997138977},{"duration":287.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":199.39999961853027,"connectEnd":199.39999961853027,"connectStart":199.39999961853027,"domainLookupEnd":199.39999961853027,"domainLookupStart":199.39999961853027,"fetchStart":199.39999961853027,"redirectEnd":0,"redirectStart":0,"requestStart":199.39999961853027,"responseEnd":486.8999996185303,"responseStart":486.8999996185303,"secureConnectionStart":199.39999961853027},{"duration":367.90000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bv2/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":199.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":199.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":567.5999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":287.5,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":199.7999997138977,"connectEnd":199.7999997138977,"connectStart":199.7999997138977,"domainLookupEnd":199.7999997138977,"domainLookupStart":199.7999997138977,"fetchStart":199.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":199.7999997138977,"responseEnd":487.2999997138977,"responseStart":487.2999997138977,"secureConnectionStart":199.7999997138977},{"duration":369.19999980926514,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bv2/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":200,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":200,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":569.1999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":287.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/719848dd97ebe0663199f49a3936487a-CDN/lu2bv2/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":200.19999980926514,"connectEnd":200.19999980926514,"connectStart":200.19999980926514,"domainLookupEnd":200.19999980926514,"domainLookupStart":200.19999980926514,"fetchStart":200.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":200.19999980926514,"responseEnd":487.8999996185303,"responseStart":487.8999996185303,"secureConnectionStart":200.19999980926514},{"duration":646.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":205.59999990463257,"connectEnd":205.59999990463257,"connectStart":205.59999990463257,"domainLookupEnd":205.59999990463257,"domainLookupStart":205.59999990463257,"fetchStart":205.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":205.59999990463257,"responseEnd":852.0999999046326,"responseStart":852.0999999046326,"secureConnectionStart":205.59999990463257},{"duration":665.1999998092651,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":205.69999980926514,"connectEnd":205.69999980926514,"connectStart":205.69999980926514,"domainLookupEnd":205.69999980926514,"domainLookupStart":205.69999980926514,"fetchStart":205.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":205.69999980926514,"responseEnd":870.8999996185303,"responseStart":870.8999996185303,"secureConnectionStart":205.69999980926514},{"duration":72,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":610.8999996185303,"connectEnd":610.8999996185303,"connectStart":610.8999996185303,"domainLookupEnd":610.8999996185303,"domainLookupStart":610.8999996185303,"fetchStart":610.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":610.8999996185303,"responseEnd":682.8999996185303,"responseStart":682.8999996185303,"secureConnectionStart":610.8999996185303}],"fetchStart":1,"domainLookupStart":1,"domainLookupEnd":1,"connectStart":1,"connectEnd":1,"requestStart":19,"responseStart":192,"responseEnd":198,"domLoading":196,"domInteractive":1172,"domContentLoadedEventStart":1172,"domContentLoadedEventEnd":1221,"domComplete":2618,"loadEventStart":2618,"loadEventEnd":2620,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1155.5999999046326},{"name":"bigPipe.sidebar-id.end","time":1156.3999996185303},{"name":"bigPipe.activity-panel-pipe-id.start","time":1156.5999999046326},{"name":"bigPipe.activity-panel-pipe-id.end","time":1159.1999998092651},{"name":"activityTabFullyLoaded","time":1226.2999997138977}],"measures":[],"correlationId":"be25fd078c8a5a","effectiveType":"4g","downlink":9.7,"rtt":0,"serverDuration":96,"dbReadsTimeInMs":11,"dbConnsTimeInMs":19,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}