I used my fuzzing tool to test Mariadb , and found a bug that can result in an abortion.
Mariadb installation:
1) cd mariadb-10.5.9
2) mkdir build; cd build
3) cmake -DWITH_ASAN=ON -DWITH_ASAN_SCOPE=ON -DWITH_DEBUG=ON ../
4) make -j8 && sudo make install
How to Repeat:
export ASAN_OPTIONS=detect_leaks=0
/usr/local/mysql/bin/mysqld_safe &
/usr/local/mysql/bin/mysql -uroot -p123456(your password)
MariaDB> drop database if exists test_db;
MariaDB> create database test_db;
MariaDB> source fuzz.sql;
I have simplified the content of fuzz.sql, and I hope fuzz.sql can help you reproduce the bug and fix it. In addition, I attach the abortion report (which has its stack trace).
- duplicates
-
MDEV-22464
Server crash on UPDATE with nested subquery
-
-
Closed
- links to
-
{"report":{"fcp":1050.6999998092651,"ttfb":196.19999980926514,"pageVisibility":"visible","entityId":99512,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"c4029bdd-d137-475e-849f-ca647311456c","navigationType":0,"readyForUser":1153.4000005722046,"redirectCount":0,"resourceLoadedEnd":1385.5,"resourceLoadedStart":212.80000019073486,"resourceTiming":[{"duration":194.19999980926514,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":212.80000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":212.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":407,"responseStart":0,"secureConnectionStart":0},{"duration":194.4000005722046,"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":213,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":213,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":407.4000005722046,"responseStart":0,"secureConnectionStart":0},{"duration":204.9000005722046,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":213.19999980926514,"connectEnd":213.19999980926514,"connectStart":213.19999980926514,"domainLookupEnd":213.19999980926514,"domainLookupStart":213.19999980926514,"fetchStart":213.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":213.19999980926514,"responseEnd":418.1000003814697,"responseStart":418.1000003814697,"secureConnectionStart":213.19999980926514},{"duration":306.3999996185303,"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":213.4000005722046,"connectEnd":213.4000005722046,"connectStart":213.4000005722046,"domainLookupEnd":213.4000005722046,"domainLookupStart":213.4000005722046,"fetchStart":213.4000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":213.4000005722046,"responseEnd":519.8000001907349,"responseStart":519.8000001907349,"secureConnectionStart":213.4000005722046},{"duration":313.1000003814697,"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":213.69999980926514,"connectEnd":213.69999980926514,"connectStart":213.69999980926514,"domainLookupEnd":213.69999980926514,"domainLookupStart":213.69999980926514,"fetchStart":213.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":213.69999980926514,"responseEnd":526.8000001907349,"responseStart":526.8000001907349,"secureConnectionStart":213.69999980926514},{"duration":313.5,"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":213.80000019073486,"connectEnd":213.80000019073486,"connectStart":213.80000019073486,"domainLookupEnd":213.80000019073486,"domainLookupStart":213.80000019073486,"fetchStart":213.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":213.80000019073486,"responseEnd":527.3000001907349,"responseStart":527.3000001907349,"secureConnectionStart":213.80000019073486},{"duration":313.5999994277954,"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":214.10000038146973,"connectEnd":214.10000038146973,"connectStart":214.10000038146973,"domainLookupEnd":214.10000038146973,"domainLookupStart":214.10000038146973,"fetchStart":214.10000038146973,"redirectEnd":0,"redirectStart":0,"requestStart":214.10000038146973,"responseEnd":527.6999998092651,"responseStart":527.6999998092651,"secureConnectionStart":214.10000038146973},{"duration":389.20000076293945,"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":214.19999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":214.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":603.4000005722046,"responseStart":0,"secureConnectionStart":0},{"duration":313.79999923706055,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":214.4000005722046,"connectEnd":214.4000005722046,"connectStart":214.4000005722046,"domainLookupEnd":214.4000005722046,"domainLookupStart":214.4000005722046,"fetchStart":214.4000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":214.4000005722046,"responseEnd":528.1999998092651,"responseStart":528.1999998092651,"secureConnectionStart":214.4000005722046},{"duration":389.19999980926514,"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":214.60000038146973,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":214.60000038146973,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":603.8000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":314.1000003814697,"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":214.80000019073486,"connectEnd":214.80000019073486,"connectStart":214.80000019073486,"domainLookupEnd":214.80000019073486,"domainLookupStart":214.80000019073486,"fetchStart":214.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":214.80000019073486,"responseEnd":528.9000005722046,"responseStart":528.9000005722046,"secureConnectionStart":214.80000019073486},{"duration":1095.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":215.80000019073486,"connectEnd":215.80000019073486,"connectStart":215.80000019073486,"domainLookupEnd":215.80000019073486,"domainLookupStart":215.80000019073486,"fetchStart":215.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":215.80000019073486,"responseEnd":1311.6999998092651,"responseStart":1311.6999998092651,"secureConnectionStart":215.80000019073486},{"duration":1096.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":215.9000005722046,"connectEnd":215.9000005722046,"connectStart":215.9000005722046,"domainLookupEnd":215.9000005722046,"domainLookupStart":215.9000005722046,"fetchStart":215.9000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":215.9000005722046,"responseEnd":1312.1000003814697,"responseStart":1312.1000003814697,"secureConnectionStart":215.9000005722046},{"duration":154.5,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":628,"connectEnd":628,"connectStart":628,"domainLookupEnd":628,"domainLookupStart":628,"fetchStart":628,"redirectEnd":0,"redirectStart":0,"requestStart":628,"responseEnd":782.5,"responseStart":782.5,"secureConnectionStart":628},{"duration":451.80000019073486,"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":932.6000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":932.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1384.4000005722046,"responseStart":0,"secureConnectionStart":0},{"duration":452.30000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/50bc9be5bfead1a25e72c1a9338c94f6-CDN/lu2cib/820016/12ta74/e108c7645258ccb43280ed3404e3e949/_/download/contextbatch/css/com.atlassian.jira.plugins.jira-development-integration-plugin:0,-_super,-jira.view.issue,-jira.global,-jira.general,-jira.browse.project,-project.issue.navigator,-atl.general/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":933.1999998092651,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":933.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1385.5,"responseStart":0,"secureConnectionStart":0},{"duration":516.8000001907349,"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":934,"connectEnd":934,"connectStart":934,"domainLookupEnd":934,"domainLookupStart":934,"fetchStart":934,"redirectEnd":0,"redirectStart":0,"requestStart":934,"responseEnd":1450.8000001907349,"responseStart":1450.8000001907349,"secureConnectionStart":934},{"duration":569,"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":934.5,"connectEnd":934.5,"connectStart":934.5,"domainLookupEnd":934.5,"domainLookupStart":934.5,"fetchStart":934.5,"redirectEnd":0,"redirectStart":0,"requestStart":934.5,"responseEnd":1503.5,"responseStart":1503.5,"secureConnectionStart":934.5}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":35,"responseStart":196,"responseEnd":204,"domLoading":210,"domInteractive":1397,"domContentLoadedEventStart":1397,"domContentLoadedEventEnd":1518,"domComplete":2143,"loadEventStart":2143,"loadEventEnd":2143,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1318.1000003814697},{"name":"bigPipe.sidebar-id.end","time":1319},{"name":"bigPipe.activity-panel-pipe-id.start","time":1319.1999998092651},{"name":"bigPipe.activity-panel-pipe-id.end","time":1321.3000001907349},{"name":"activityTabFullyLoaded","time":1544.8000001907349}],"measures":[],"correlationId":"388ced39305d34","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":101,"dbReadsTimeInMs":13,"dbConnsTimeInMs":22,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Thanks! Repeatable on 10.3-10.5. This is a duplicate of
MDEV-22464:10.3 98e6159892ae36d4ab82c
Version: '10.3.29-MariaDB-debug-log'
210510 12:19:43 [ERROR] mysqld got signal 11 ;
sigaction.c:0(__restore_rt)[0x7fef67b3f3c0]
sql/item.cc:7956(Item_ref::fix_fields(THD*, Item**))[0x55e2b7725dfd]
sql/item.h:829(Item::fix_fields_if_needed(THD*, Item**))[0x55e2b6cbc75b]
sql/item_func.cc:352(Item_func::fix_fields(THD*, Item**))[0x55e2b77e33e6]
sql/item.h:829(Item::fix_fields_if_needed(THD*, Item**))[0x55e2b6cbc75b]
sql/item.h:833(Item::fix_fields_if_needed_for_scalar(THD*, Item**))[0x55e2b6cbc795]
sql/item.h:838(Item::fix_fields_if_needed_for_bool(THD*, Item**))[0x55e2b6de1589]
sql/sql_select.cc:1211(JOIN::prepare(TABLE_LIST*, unsigned int, Item*, unsigned int, st_order*, bool, st_order*, Item*, st_order*, st_select_lex*, st_select_lex_unit*))[0x55e2b6fd5c77]
sql/item_subselect.cc:3790(subselect_single_select_engine::prepare(THD*))[0x55e2b78d64fa]
sql/item_subselect.cc:280(Item_subselect::fix_fields(THD*, Item**))[0x55e2b78b04c3]
sql/item.h:829(Item::fix_fields_if_needed(THD*, Item**))[0x55e2b6cbc75b]
sql/item_func.cc:352(Item_func::fix_fields(THD*, Item**))[0x55e2b77e33e6]
sql/item.h:829(Item::fix_fields_if_needed(THD*, Item**))[0x55e2b6cbc75b]
sql/item_func.cc:352(Item_func::fix_fields(THD*, Item**))[0x55e2b77e33e6]
sql/item.h:829(Item::fix_fields_if_needed(THD*, Item**))[0x55e2b6cbc75b]
sql/item.h:833(Item::fix_fields_if_needed_for_scalar(THD*, Item**))[0x55e2b6cbc795]
sql/item.h:838(Item::fix_fields_if_needed_for_bool(THD*, Item**))[0x55e2b6de1589]
sql/sql_base.cc:8299(setup_conds(THD*, TABLE_LIST*, List<TABLE_LIST>&, Item**))[0x55e2b6dd8ed1]
sql/sql_select.cc:660(setup_without_group(THD*, Bounds_checked_array<Item*>, TABLE_LIST*, List<TABLE_LIST>&, List<Item>&, List<Item>&, Item**, st_order*, st_order*, List<Window_spec>&, List<Item_window_func>&, bool*, unsigned int*))[0x55e2b6fcf2bc]
sql/sql_select.cc:1153(JOIN::prepare(TABLE_LIST*, unsigned int, Item*, unsigned int, st_order*, bool, st_order*, Item*, st_order*, st_select_lex*, st_select_lex_unit*))[0x55e2b6fd504e]
sql/sql_select.cc:4318(mysql_select(THD*, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*))[0x55e2b6ff6846]
sql/sql_update.cc:1816(mysql_multi_update(THD*, TABLE_LIST*, List<Item>*, List<Item>*, Item*, unsigned long long, enum_duplicates, bool, st_select_lex_unit*, st_select_lex*, multi_update**))[0x55e2b71e1b4e]
sql/sql_parse.cc:4422(mysql_execute_command(THD*))[0x55e2b6f2ff56]
sql/sql_parse.cc:7873(mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool))[0x55e2b6f48888]
sql/sql_parse.cc:1855(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x55e2b6f1f66d]
sql/sql_parse.cc:1398(do_command(THD*))[0x55e2b6f1c1a4]
sql/sql_connect.cc:1403(do_handle_one_connection(CONNECT*))[0x55e2b72ea2c9]
sql/sql_connect.cc:1309(handle_one_connection)[0x55e2b72e9b83]
perfschema/pfs.cc:1871(pfs_spawn_thread)[0x55e2b891d7a7]
nptl/pthread_create.c:478(start_thread)[0x7fef67b33609]
x86_64/clone.S:97(__GI___clone)[0x7fef67a5a293]
Query (0x62b000000290): UPDATE v0 SET
v1 = 26 WHERE (
SELECT 33 FROM v0 AS v2
JOIN v0
ON 0<>0 ) = ( SELECT ( v1 + v1 ) / 127 AS v3 FROM v0 AS v4 GROUP BY NOT v1 <= 'x' HAVING v1 ) - v1