I used my fuzzing tool to test MariaDB and found a transaction-related bug that make the crashes.
Mariadb installation
1) cd mariadb-10.8.3
2) mkdir build; cd build
3) cmake .. -DCMAKE_BUILD_TYPE=Debug -DWITH_ASAN=ON
4) make -j12 && sudo make install
Setup the environment
1) export ASAN_OPTIONS=detect_leaks=0
2) /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql &
3) /usr/local/mysql/bin/mysql -uroot -Dtestdb < mysql_bk.sql (attached) # set up the database
Reproduce bug
/usr/local/mysql/bin/mysql -uroot -Dtestdb # set up connection conn_0
/usr/local/mysql/bin/mysql -uroot -Dtestdb # set up connection conn_1
/usr/local/mysql/bin/mysql -uroot -Dtestdb # set up connection conn_2
conn_1> START TRANSACTION;
conn_2> START TRANSACTION;
conn_0> START TRANSACTION;
conn_1> update t_wmmbvd set wkey = 64;
conn_2> insert into t_gj1wgb (wkey, pkey, c_a7cvid) values
(109, 121000, case when 15 between 34 and 36 then case when exists (
select distinct
ref_0.pkey as c8
from
t_wmmbvd as ref_0
) then '0ulyqb' else 'gog9pb' end
else 'ucbsmc' end
),
(109, 127000, null);
conn_0> delete from t_gj1wgb; --- This Delete is blocked
conn_1> insert into t_wmmbvd (wkey, pkey, c_wnzys, c_gmrl1c, c_rajdu) values
(67, 102000, 'qgziz', 64.93, null),
(67, 104000, case when null in (
select
ref_0.pkey as c0
from
t_gj1wgb as ref_0
) then null else 'nmivpc' end
, 74.22, 'ehl4ac'); --- This INSERT is blocked
conn_2> COMMIT; --- This COMMIT will unblock the above DELETE (in conn_0)
conn_0> update t_wmmbvd set wkey = 42; --- this UPDATE should be putted in conn_0 as soon as possible after the above COMMIT (in conn_2) is executed, and it will make the above INSERT (in conn_1) crash the maridb server
conn_0> COMMIT;
conn_1> COMMIT;
I have simplified the content of the test case, and I hope this report can help you reproduce and fix the bug. In addition, I attached the failure report (which has its stack trace).
is duplicated by
MDEV-29118
Assertion `lock_table_has(trx, index->table, LOCK_IX)' failed at lock0lock.cc:4972
Closed
Elena Stepanova
made changes -
2022-08-03 09:43
Field
Original Value
New Value
Fix Version/s
N/A
[ 14700
]
Resolution
Duplicate
[ 3
]
Status
Open
[ 1
]
Closed
[ 6
]
{"report":{"fcp":1577.9000000953674,"ttfb":602.4000000953674,"pageVisibility":"visible","entityId":113401,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"062b55e4-81ae-48cb-b36a-f9392de46d66","navigationType":0,"readyForUser":1659.9000000953674,"redirectCount":0,"resourceLoadedEnd":2534,"resourceLoadedStart":608.1000003814697,"resourceTiming":[{"duration":437.7999997138977,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":608.1000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":608.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1045.9000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":439.80000019073486,"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":608.4000000953674,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":608.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1048.2000002861023,"responseStart":0,"secureConnectionStart":0},{"duration":493,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":608.6000003814697,"connectEnd":608.6000003814697,"connectStart":608.6000003814697,"domainLookupEnd":608.6000003814697,"domainLookupStart":608.6000003814697,"fetchStart":608.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":608.6000003814697,"responseEnd":1101.6000003814697,"responseStart":1101.6000003814697,"secureConnectionStart":608.6000003814697},{"duration":554.8000001907349,"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":608.8000001907349,"connectEnd":608.8000001907349,"connectStart":608.8000001907349,"domainLookupEnd":608.8000001907349,"domainLookupStart":608.8000001907349,"fetchStart":608.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":608.8000001907349,"responseEnd":1163.6000003814697,"responseStart":1163.5,"secureConnectionStart":608.8000001907349},{"duration":558.7999997138977,"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":609.1000003814697,"connectEnd":609.1000003814697,"connectStart":609.1000003814697,"domainLookupEnd":609.1000003814697,"domainLookupStart":609.1000003814697,"fetchStart":609.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":609.1000003814697,"responseEnd":1167.9000000953674,"responseStart":1167.9000000953674,"secureConnectionStart":609.1000003814697},{"duration":559.3000001907349,"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":609.3000001907349,"connectEnd":609.3000001907349,"connectStart":609.3000001907349,"domainLookupEnd":609.3000001907349,"domainLookupStart":609.3000001907349,"fetchStart":609.3000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":609.3000001907349,"responseEnd":1168.6000003814697,"responseStart":1168.6000003814697,"secureConnectionStart":609.3000001907349},{"duration":559.5999999046326,"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":609.4000000953674,"connectEnd":609.4000000953674,"connectStart":609.4000000953674,"domainLookupEnd":609.4000000953674,"domainLookupStart":609.4000000953674,"fetchStart":609.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":609.4000000953674,"responseEnd":1169,"responseStart":1169,"secureConnectionStart":609.4000000953674},{"duration":641.3999996185303,"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":609.6000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":609.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1251,"responseStart":0,"secureConnectionStart":0},{"duration":559.9000000953674,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":609.8000001907349,"connectEnd":609.8000001907349,"connectStart":609.8000001907349,"domainLookupEnd":609.8000001907349,"domainLookupStart":609.8000001907349,"fetchStart":609.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":609.8000001907349,"responseEnd":1169.7000002861023,"responseStart":1169.7000002861023,"secureConnectionStart":609.8000001907349},{"duration":641.3000001907349,"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":609.9000000953674,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":609.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1251.2000002861023,"responseStart":0,"secureConnectionStart":0},{"duration":560.3000001907349,"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":610,"connectEnd":610,"connectStart":610,"domainLookupEnd":610,"domainLookupStart":610,"fetchStart":610,"redirectEnd":0,"redirectStart":0,"requestStart":610,"responseEnd":1170.3000001907349,"responseStart":1170.3000001907349,"secureConnectionStart":610},{"duration":1922.7000002861023,"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":610.9000000953674,"connectEnd":610.9000000953674,"connectStart":610.9000000953674,"domainLookupEnd":610.9000000953674,"domainLookupStart":610.9000000953674,"fetchStart":610.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":610.9000000953674,"responseEnd":2533.6000003814697,"responseStart":2533.6000003814697,"secureConnectionStart":610.9000000953674},{"duration":1917.1999998092651,"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":616.8000001907349,"connectEnd":616.8000001907349,"connectStart":616.8000001907349,"domainLookupEnd":616.8000001907349,"domainLookupStart":616.8000001907349,"fetchStart":616.8000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":616.8000001907349,"responseEnd":2534,"responseStart":2534,"secureConnectionStart":616.8000001907349},{"duration":913,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1263.5,"connectEnd":1263.5,"connectStart":1263.5,"domainLookupEnd":1263.5,"domainLookupStart":1263.5,"fetchStart":1263.5,"redirectEnd":0,"redirectStart":0,"requestStart":1263.5,"responseEnd":2176.5,"responseStart":2176.5,"secureConnectionStart":1263.5},{"duration":971,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1567,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1567,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":2538,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":426,"responseStart":602,"responseEnd":617,"domLoading":606,"domInteractive":2561,"domContentLoadedEventStart":2561,"domContentLoadedEventEnd":2607,"domComplete":3475,"loadEventStart":3475,"loadEventEnd":3476,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":2540.1000003814697},{"name":"bigPipe.sidebar-id.end","time":2540.800000190735},{"name":"bigPipe.activity-panel-pipe-id.start","time":2540.9000000953674},{"name":"bigPipe.activity-panel-pipe-id.end","time":2542.7000002861023},{"name":"activityTabFullyLoaded","time":2621.5}],"measures":[],"correlationId":"9ba764b891c0fc","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":122,"dbReadsTimeInMs":21,"dbConnsTimeInMs":31,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}