Because I only had a non-debug build readily available, I changed the debug assertion as well.
The intention here is that the offsets_ will be large enough for storing offsets. There was an off-by-one error in the condition.
Marko Mäkelä
added a comment - Here is a better parameterized test case:
--source include/have_innodb.inc
--source include/have_sequence.inc
DELIMITER $$;
BEGIN NOT ATOMIC
DECLARE c TEXT DEFAULT ( SELECT CONCAT( 'CREATE TABLE t1(c' ,
GROUP_CONCAT(seq SEPARATOR
' INT DEFAULT 0, c' ),
' INT DEFAULT 0, PRIMARY KEY(c' ,
GROUP_CONCAT(seq SEPARATOR ', c' ),
')) ENGINE=InnoDB;' ) FROM seq_1_to_32);
EXECUTE IMMEDIATE c;
END ;
$$
DELIMITER ;$$
INSERT INTO t1() VALUES ();
SET GLOBAL innodb_max_purge_lag_wait=0;
DROP TABLE t1;
If I change the 32 to 33, the test will fail with an error:
' failed: ER_TOO_MANY_KEY_PARTS (1070): Too many key parts specified; max 32 parts allowed
If I change the 32 to 31, the assertion failure will be avoided. The fix is simple:
diff --git a/storage/innobase/row/row0purge.cc b/storage/innobase/row/row0purge.cc
index 629f4177552..9cce724a7eb 100644
--- a/storage/innobase/row/row0purge.cc
+++ b/storage/innobase/row/row0purge.cc
@@ -1062,12 +1062,12 @@ static void row_purge_reset_trx_id(purge_node_t* node, mtr_t* mtr)
mem_heap_t* heap = NULL;
/* Reserve enough offsets for the PRIMARY KEY and 2 columns
so that we can access DB_TRX_ID, DB_ROLL_PTR. */
- rec_offs offsets_[REC_OFFS_HEADER_SIZE + MAX_REF_PARTS + 2];
+ rec_offs offsets_[REC_OFFS_HEADER_SIZE + MAX_REF_PARTS + 3];
rec_offs_init(offsets_);
rec_offs* offsets = rec_get_offsets(
rec, index, offsets_, index->n_core_fields,
trx_id_pos + 2, &heap);
- ut_ad(heap == NULL);
+ ut_a(heap == NULL);
ut_ad(dict_index_get_nth_field(index, trx_id_pos)
->col->mtype == DATA_SYS);
Because I only had a non-debug build readily available, I changed the debug assertion as well.
The intention here is that the offsets_ will be large enough for storing offsets . There was an off-by-one error in the condition.
People
Marko Mäkelä
Roel Van de Paar
Votes:
0Vote for this issue
Watchers:
3Start 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.
{"report":{"fcp":1385.5,"ttfb":222.90000009536743,"pageVisibility":"visible","entityId":129022,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"ebd5a6a3-a8fe-4b0d-9c98-fba085d066b7","navigationType":0,"readyForUser":1540.5,"redirectCount":0,"resourceLoadedEnd":1476.8000001907349,"resourceLoadedStart":228.5,"resourceTiming":[{"duration":650.2000002861023,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":228.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":228.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":878.7000002861023,"responseStart":0,"secureConnectionStart":0},{"duration":650.0999999046326,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/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&whisper-enabled=true","startTime":228.80000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":228.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":878.9000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":659.8000001907349,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":229,"connectEnd":229,"connectStart":229,"domainLookupEnd":229,"domainLookupStart":229,"fetchStart":229,"redirectEnd":0,"redirectStart":0,"requestStart":229,"responseEnd":888.8000001907349,"responseStart":888.8000001907349,"secureConnectionStart":229},{"duration":753.1999998092651,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/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&whisper-enabled=true","startTime":229.2000002861023,"connectEnd":229.2000002861023,"connectStart":229.2000002861023,"domainLookupEnd":229.2000002861023,"domainLookupStart":229.2000002861023,"fetchStart":229.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":229.2000002861023,"responseEnd":982.4000000953674,"responseStart":982.4000000953674,"secureConnectionStart":229.2000002861023},{"duration":757.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":229.30000019073486,"connectEnd":229.30000019073486,"connectStart":229.30000019073486,"domainLookupEnd":229.30000019073486,"domainLookupStart":229.30000019073486,"fetchStart":229.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":229.30000019073486,"responseEnd":986.8000001907349,"responseStart":986.8000001907349,"secureConnectionStart":229.30000019073486},{"duration":757.9000000953674,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":229.59999990463257,"connectEnd":229.59999990463257,"connectStart":229.59999990463257,"domainLookupEnd":229.59999990463257,"domainLookupStart":229.59999990463257,"fetchStart":229.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":229.59999990463257,"responseEnd":987.5,"responseStart":987.5,"secureConnectionStart":229.59999990463257},{"duration":758.1999998092651,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":229.7000002861023,"connectEnd":229.7000002861023,"connectStart":229.7000002861023,"domainLookupEnd":229.7000002861023,"domainLookupStart":229.7000002861023,"fetchStart":229.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":229.7000002861023,"responseEnd":987.9000000953674,"responseStart":987.9000000953674,"secureConnectionStart":229.7000002861023},{"duration":805.0999999046326,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":229.90000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":229.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1035,"responseStart":0,"secureConnectionStart":0},{"duration":758.4000000953674,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":230.09999990463257,"connectEnd":230.09999990463257,"connectStart":230.09999990463257,"domainLookupEnd":230.09999990463257,"domainLookupStart":230.09999990463257,"fetchStart":230.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":230.09999990463257,"responseEnd":988.5,"responseStart":988.4000000953674,"secureConnectionStart":230.09999990463257},{"duration":805,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/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":230.2000002861023,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":230.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1035.2000002861023,"responseStart":0,"secureConnectionStart":0},{"duration":758.5999999046326,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/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":230.40000009536743,"connectEnd":230.40000009536743,"connectStart":230.40000009536743,"domainLookupEnd":230.40000009536743,"domainLookupStart":230.40000009536743,"fetchStart":230.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":230.40000009536743,"responseEnd":989,"responseStart":989,"secureConnectionStart":230.40000009536743},{"duration":1111.8999996185303,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":236.2000002861023,"connectEnd":236.2000002861023,"connectStart":236.2000002861023,"domainLookupEnd":236.2000002861023,"domainLookupStart":236.2000002861023,"fetchStart":236.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":236.2000002861023,"responseEnd":1348.0999999046326,"responseStart":1348.0999999046326,"secureConnectionStart":236.2000002861023},{"duration":1107.6999998092651,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":248.40000009536743,"connectEnd":248.40000009536743,"connectStart":248.40000009536743,"domainLookupEnd":248.40000009536743,"domainLookupStart":248.40000009536743,"fetchStart":248.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":248.40000009536743,"responseEnd":1356.0999999046326,"responseStart":1356.0999999046326,"secureConnectionStart":248.40000009536743},{"duration":301.30000019073486,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1047.4000000953674,"connectEnd":1047.4000000953674,"connectStart":1047.4000000953674,"domainLookupEnd":1047.4000000953674,"domainLookupStart":1047.4000000953674,"fetchStart":1047.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":1047.4000000953674,"responseEnd":1348.7000002861023,"responseStart":1348.7000002861023,"secureConnectionStart":1047.4000000953674},{"duration":220.5,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1377,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1377,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1597.5,"responseStart":0,"secureConnectionStart":0},{"duration":61.09999990463257,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2cib/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/css/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":1402.4000000953674,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1402.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1463.5,"responseStart":0,"secureConnectionStart":0},{"duration":41.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-project.issue.navigator,-jira.view.issue,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":1403.3000001907349,"connectEnd":1403.3000001907349,"connectStart":1403.3000001907349,"domainLookupEnd":1403.3000001907349,"domainLookupStart":1403.3000001907349,"fetchStart":1403.3000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":1403.3000001907349,"responseEnd":1444.9000000953674,"responseStart":1444.9000000953674,"secureConnectionStart":1403.3000001907349},{"duration":72.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/097ae97cb8fbec7d6ea4bbb1f26955b9-CDN/lu2cib/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/js/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true&whisper-enabled=true","startTime":1403.9000000953674,"connectEnd":1403.9000000953674,"connectStart":1403.9000000953674,"domainLookupEnd":1403.9000000953674,"domainLookupStart":1403.9000000953674,"fetchStart":1403.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":1403.9000000953674,"responseEnd":1476.8000001907349,"responseStart":1476.8000001907349,"secureConnectionStart":1403.9000000953674}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":45,"responseStart":223,"responseEnd":249,"domLoading":226,"domInteractive":1636,"domContentLoadedEventStart":1636,"domContentLoadedEventEnd":1700,"domComplete":2288,"loadEventStart":2288,"loadEventEnd":2289,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1602.7000002861023},{"name":"bigPipe.sidebar-id.end","time":1603.5},{"name":"bigPipe.activity-panel-pipe-id.start","time":1603.7000002861023},{"name":"bigPipe.activity-panel-pipe-id.end","time":1607.0999999046326},{"name":"activityTabFullyLoaded","time":1724.2000002861023}],"measures":[],"correlationId":"dfc4ba55ff1fde","effectiveType":"4g","downlink":9.2,"rtt":0,"serverDuration":106,"dbReadsTimeInMs":11,"dbConnsTimeInMs":20,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
LSAN observes a memory leak in mem_heap_create_block_func (in optimized builds, whereas the assert is in debug builds):
11.3.3 2d9f91a9c8692b2532ee2f475ae10a1b66009f73 (Optimized, UBASAN)
==2401185==ERROR: LeakSanitizer: detected memory leaks
Indirect leak of 472 byte(s) in 1 object(s) allocated from:
#0 0x55ae147659af in malloc (/test/UBASAN_MD250424-mariadb-11.3.3-linux-x86_64-opt/bin/mariadbd+0x7f3e9af)
#1 0x55ae1801b6c2 in mem_heap_create_block_func(mem_block_info_t*, unsigned long, unsigned long) /test/11.3_opt_san/storage/innobase/mem/mem0mem.cc:277
#2 0x55ae1801bdc1 in mem_heap_add_block(mem_block_info_t*, unsigned long) /test/11.3_opt_san/storage/innobase/mem/mem0mem.cc:378
#3 0x55ae1819e195 in mem_heap_alloc /test/11.3_opt_san/storage/innobase/include/mem0mem.inl:193
#4 0x55ae1819e195 in rec_get_offsets_func(unsigned char const*, dict_index_t const*, unsigned short*, unsigned long, unsigned long, mem_block_info_t**) /test/11.3_opt_san/storage/innobase/rem/rem0rec.cc:913
#5 0x55ae182de424 in row_purge_reset_trx_id /test/11.3_opt_san/storage/innobase/row/row0purge.cc:614
#6 0x55ae182ef63d in row_purge_record_func /test/11.3_opt_san/storage/innobase/row/row0purge.cc:1094
#7 0x55ae182f3f1b in row_purge /test/11.3_opt_san/storage/innobase/row/row0purge.cc:1138
#8 0x55ae182f3f1b in row_purge_step(que_thr_t*) /test/11.3_opt_san/storage/innobase/row/row0purge.cc:1201
#9 0x55ae1817ccea in que_thr_step /test/11.3_opt_san/storage/innobase/que/que0que.cc:588
#10 0x55ae1817ccea in que_run_threads_low /test/11.3_opt_san/storage/innobase/que/que0que.cc:644
#11 0x55ae1817ccea in que_run_threads(que_thr_t*) /test/11.3_opt_san/storage/innobase/que/que0que.cc:664
#12 0x55ae146675f0 in trx_purge(unsigned long, unsigned long) /test/11.3_opt_san/storage/innobase/trx/trx0purge.cc:1484
#13 0x55ae183d2711 in purge_coordinator_state::do_purge() /test/11.3_opt_san/storage/innobase/srv/srv0srv.cc:1418
#14 0x55ae183d2711 in purge_coordinator_callback /test/11.3_opt_san/storage/innobase/srv/srv0srv.cc:1496
#15 0x55ae18afffa1 in tpool::task_group::execute(tpool::task*) /test/11.3_opt_san/tpool/task_group.cc:70
#16 0x55ae18aefcd8 in tpool::thread_pool_generic::worker_main(tpool::worker_data*) /test/11.3_opt_san/tpool/tpool_generic.cc:583
#17 0x14dca72e63e2 (/lib/x86_64-linux-gnu/libstdc++.so.6+0xe63e2)
Indirect leak of 184 byte(s) in 1 object(s) allocated from:
#0 0x55ae147659af in malloc (/test/UBASAN_MD250424-mariadb-11.3.3-linux-x86_64-opt/bin/mariadbd+0x7f3e9af)
#1 0x55ae1801b6c2 in mem_heap_create_block_func(mem_block_info_t*, unsigned long, unsigned long) /test/11.3_opt_san/storage/innobase/mem/mem0mem.cc:277
#2 0x55ae181a042c in mem_heap_create_func /test/11.3_opt_san/storage/innobase/include/mem0mem.inl:377
#3 0x55ae181a042c in rec_get_offsets_func(unsigned char const*, dict_index_t const*, unsigned short*, unsigned long, unsigned long, mem_block_info_t**) /test/11.3_opt_san/storage/innobase/rem/rem0rec.cc:909
#4 0x55ae182de424 in row_purge_reset_trx_id /test/11.3_opt_san/storage/innobase/row/row0purge.cc:614
#5 0x55ae182ef63d in row_purge_record_func /test/11.3_opt_san/storage/innobase/row/row0purge.cc:1094
#6 0x55ae182f3f1b in row_purge /test/11.3_opt_san/storage/innobase/row/row0purge.cc:1138
#7 0x55ae182f3f1b in row_purge_step(que_thr_t*) /test/11.3_opt_san/storage/innobase/row/row0purge.cc:1201
#8 0x55ae1817ccea in que_thr_step /test/11.3_opt_san/storage/innobase/que/que0que.cc:588
#9 0x55ae1817ccea in que_run_threads_low /test/11.3_opt_san/storage/innobase/que/que0que.cc:644
#10 0x55ae1817ccea in que_run_threads(que_thr_t*) /test/11.3_opt_san/storage/innobase/que/que0que.cc:664
#11 0x55ae146675f0 in trx_purge(unsigned long, unsigned long) /test/11.3_opt_san/storage/innobase/trx/trx0purge.cc:1484
#12 0x55ae183d2711 in purge_coordinator_state::do_purge() /test/11.3_opt_san/storage/innobase/srv/srv0srv.cc:1418
#13 0x55ae183d2711 in purge_coordinator_callback /test/11.3_opt_san/storage/innobase/srv/srv0srv.cc:1496
#14 0x55ae18afffa1 in tpool::task_group::execute(tpool::task*) /test/11.3_opt_san/tpool/task_group.cc:70
#15 0x55ae18aefcd8 in tpool::thread_pool_generic::worker_main(tpool::worker_data*) /test/11.3_opt_san/tpool/tpool_generic.cc:583
#16 0x14dca72e63e2 (/lib/x86_64-linux-gnu/libstdc++.so.6+0xe63e2)
SUMMARY: AddressSanitizer: 656 byte(s) leaked in 2 allocation(s).
240504 15:12:29 [ERROR] mysqld got signal 6 ;