One of our customers reported that the execution of stored procedure involving "CONNECT"/"MEMORY" engine tables, table_type=WMI, CTE, JOIN, UNION ALL QUERY, causing MariaDB server running on Windows platform to crash.
I can locally able to reproduce the crash, at 10.4.17 (customer version) and 10.5.9 (latest release).
Repro Steps:
1. Install MariaDB server 10.4.17/10.5.9 at the Window Machine.
2. Install connect plugin.
3. Restore the dump file - proc_monitor_values_prtg_new.sql
4. call the procedure - server_monitoring.query_monitor_values_prtg.
call server_monitoring.query_monitor_values_prtg;
First time execution, will work. 2nd time it will crash the server.
ERROR log:
2021-03-10 15:02:06 5 [Note] CONNECT: Version 1.07.0002 Feb 19 2021 10:36:16
|
210310 15:02:52 [ERROR] mysqld got exception 0xc0000005 ;
|
This could be because you hit a bug. It is also possible that this binary
|
or one of the libraries it was linked against is corrupt, improperly built,
|
or misconfigured. This error can also be caused by malfunctioning hardware.
|
|
To report this bug, see https://mariadb.com/kb/en/reporting-bugs
|
|
We will try our best to scrape up some info that will hopefully help
|
diagnose the problem, but since we have already crashed,
|
something is definitely wrong and this may fail.
|
|
Server version: 10.5.9-MariaDB
|
key_buffer_size=134217728
|
read_buffer_size=131072
|
max_used_connections=2
|
max_threads=65537
|
thread_count=2
|
It is possible that mysqld could use up to
|
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 136467 K bytes of memory
|
Hope that's ok; if not, decrease some variables in the equation.
|
|
Thread pointer: 0x25c638b9318
|
Attempting backtrace. You can use the following information to find out
|
where mysqld died. If you see no messages after this, something went
|
terribly wrong...
|
server.dll!JOIN::reinit()[sql_select.cc:4067]
|
server.dll!st_select_lex_unit::optimize()[sql_union.cc:2099]
|
server.dll!st_select_lex_unit::exec()[sql_union.cc:2157]
|
server.dll!mysql_union()[sql_union.cc:41]
|
server.dll!handle_select()[sql_select.cc:433]
|
server.dll!execute_sqlcom_select()[sql_parse.cc:6282]
|
server.dll!mysql_execute_command()[sql_parse.cc:3978]
|
server.dll!sp_instr_stmt::exec_core()[sp_head.cc:3770]
|
server.dll!sp_lex_keeper::reset_lex_and_exec_core()[sp_head.cc:3495]
|
server.dll!sp_instr_stmt::execute()[sp_head.cc:3674]
|
server.dll!sp_head::execute()[sp_head.cc:1437]
|
server.dll!sp_head::execute_procedure()[sp_head.cc:2449]
|
server.dll!do_execute_sp()[sql_parse.cc:3088]
|
server.dll!Sql_cmd_call::execute()[sql_parse.cc:3334]
|
server.dll!mysql_execute_command()[sql_parse.cc:6036]
|
server.dll!mysql_parse()[sql_parse.cc:8067]
|
server.dll!dispatch_command()[sql_parse.cc:1892]
|
server.dll!do_command()[sql_parse.cc:1370]
|
server.dll!threadpool_process_request()[threadpool_common.cc:363]
|
server.dll!tp_callback()[threadpool_common.cc:194]
|
ntdll.dll!TpReleaseWait()
|
ntdll.dll!RtlInitializeResource()
|
KERNEL32.DLL!BaseThreadInitThunk()
|
ntdll.dll!RtlUserThreadStart()
|
|
Trying to get some variables.
|
Some pointers may be invalid and cause the dump to abort.
|
Query (0x25c982d6480): WITH CheckTableEngines AS (
|
Thank You,
Suresh
- relates to
-
MDEV-26108
Crash with query referencing twice CTE that uses embedded recursive CTE
-
-
Closed
{"report":{"fcp":1129.2000000476837,"ttfb":432.89999997615814,"pageVisibility":"visible","entityId":97774,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"d4c06ba9-d8fe-4cfc-8e70-6b2f4b5e91ed","navigationType":0,"readyForUser":1283.8999999761581,"redirectCount":0,"resourceLoadedEnd":658.3999999761581,"resourceLoadedStart":438.89999997615814,"resourceTiming":[{"duration":9.899999976158142,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":438.89999997615814,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":438.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":448.7999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":10.200000047683716,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/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":439.2999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":439.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":449.5,"responseStart":0,"secureConnectionStart":0},{"duration":206.29999995231628,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":439.5,"connectEnd":439.5,"connectStart":439.5,"domainLookupEnd":439.5,"domainLookupStart":439.5,"fetchStart":439.5,"redirectEnd":0,"redirectStart":0,"requestStart":585.7999999523163,"responseEnd":645.7999999523163,"responseStart":606.7000000476837,"secureConnectionStart":439.5},{"duration":218.69999992847443,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/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":439.7000000476837,"connectEnd":439.7000000476837,"connectStart":439.7000000476837,"domainLookupEnd":439.7000000476837,"domainLookupStart":439.7000000476837,"fetchStart":439.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":584.5,"responseEnd":658.3999999761581,"responseStart":599.8999999761581,"secureConnectionStart":439.7000000476837},{"duration":158.20000004768372,"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":439.89999997615814,"connectEnd":439.89999997615814,"connectStart":439.89999997615814,"domainLookupEnd":439.89999997615814,"domainLookupStart":439.89999997615814,"fetchStart":439.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":584.3999999761581,"responseEnd":598.1000000238419,"responseStart":597.3999999761581,"secureConnectionStart":439.89999997615814},{"duration":177.69999992847443,"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":440.10000002384186,"connectEnd":440.10000002384186,"connectStart":440.10000002384186,"domainLookupEnd":440.10000002384186,"domainLookupStart":440.10000002384186,"fetchStart":440.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":586.8999999761581,"responseEnd":617.7999999523163,"responseStart":617.3999999761581,"secureConnectionStart":440.10000002384186},{"duration":155.60000002384186,"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":440.39999997615814,"connectEnd":440.39999997615814,"connectStart":440.39999997615814,"domainLookupEnd":440.39999997615814,"domainLookupStart":440.39999997615814,"fetchStart":440.39999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":583.7000000476837,"responseEnd":596,"responseStart":595.2999999523163,"secureConnectionStart":440.39999997615814},{"duration":28.100000023841858,"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":440.60000002384186,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":440.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":468.7000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":161.30000007152557,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":440.7999999523163,"connectEnd":440.7999999523163,"connectStart":440.7999999523163,"domainLookupEnd":440.7999999523163,"domainLookupStart":440.7999999523163,"fetchStart":440.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":584.8999999761581,"responseEnd":602.1000000238419,"responseStart":601.1000000238419,"secureConnectionStart":440.7999999523163},{"duration":29.5,"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":440.89999997615814,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":440.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":470.39999997615814,"responseStart":0,"secureConnectionStart":0},{"duration":176.19999992847443,"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":441.10000002384186,"connectEnd":441.10000002384186,"connectStart":441.10000002384186,"domainLookupEnd":441.10000002384186,"domainLookupStart":441.10000002384186,"fetchStart":441.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":587.3999999761581,"responseEnd":617.2999999523163,"responseStart":616.6000000238419,"secureConnectionStart":441.10000002384186},{"duration":154.20000004768372,"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":451.89999997615814,"connectEnd":451.89999997615814,"connectStart":451.89999997615814,"domainLookupEnd":451.89999997615814,"domainLookupStart":451.89999997615814,"fetchStart":451.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":585.2999999523163,"responseEnd":606.1000000238419,"responseStart":604.2999999523163,"secureConnectionStart":451.89999997615814},{"duration":157.70000004768372,"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":462.39999997615814,"connectEnd":462.39999997615814,"connectStart":462.39999997615814,"domainLookupEnd":462.39999997615814,"domainLookupStart":462.39999997615814,"fetchStart":462.39999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":586.3999999761581,"responseEnd":620.1000000238419,"responseStart":619.5,"secureConnectionStart":462.39999997615814},{"duration":314.39999997615814,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":855,"connectEnd":1134.8999999761581,"connectStart":1134.8999999761581,"domainLookupEnd":1134.8999999761581,"domainLookupStart":1134.8999999761581,"fetchStart":855,"redirectEnd":0,"redirectStart":0,"requestStart":1135.2999999523163,"responseEnd":1169.3999999761581,"responseStart":1168.7000000476837,"secureConnectionStart":1134.8999999761581}],"fetchStart":0,"domainLookupStart":67,"domainLookupEnd":192,"connectStart":193,"connectEnd":217,"secureConnectionStart":201,"requestStart":217,"responseStart":433,"responseEnd":462,"domLoading":437,"domInteractive":1446,"domContentLoadedEventStart":1446,"domContentLoadedEventEnd":1506,"domComplete":2842,"loadEventStart":2842,"loadEventEnd":2843,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1393.2999999523163},{"name":"bigPipe.sidebar-id.end","time":1394.1000000238419},{"name":"bigPipe.activity-panel-pipe-id.start","time":1394.2999999523163},{"name":"bigPipe.activity-panel-pipe-id.end","time":1397.8999999761581},{"name":"activityTabFullyLoaded","time":1527.2000000476837}],"measures":[],"correlationId":"139a974cc3c98","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":138,"dbReadsTimeInMs":13,"dbConnsTimeInMs":53,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
call sp();
call sp();
10.4/10.5 crashes (debug/non-debug), 10.3 returns result as expected, but 10.2 returns the error:
'call sp()' failed: 1457: Failed to load routine test.sp. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6)
repeatable with Myisam/Innodb/Memory
10.4
210310 13:05:48 [ERROR] mysqld got signal 11 ;
Server version: 10.4.19-MariaDB-debug-log
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12730)[0x7f8926a51730]
sql/sql_select.cc:4082(JOIN::reinit())[0x55a9ccea757c]
sql/sql_union.cc:1449(st_select_lex_unit::optimize())[0x55a9cd089edf]
sql/sql_union.cc:1507(st_select_lex_unit::exec())[0x55a9cd08aa64]
sql/sql_union.cc:41(mysql_union(THD*, LEX*, select_result*, st_select_lex_unit*, unsigned long))[0x55a9cd07b8f4]
sql/sql_select.cc:400(handle_select(THD*, LEX*, select_result*, unsigned long))[0x55a9cce7f289]
sql/sql_parse.cc:6444(execute_sqlcom_select(THD*, TABLE_LIST*))[0x55a9ccdf29e4]
sql/sql_parse.cc:3963(mysql_execute_command(THD*))[0x55a9ccde06e2]
sql/sp_head.cc:3687(sp_instr_stmt::exec_core(THD*, unsigned int*))[0x55a9ccbac150]
sql/sp_head.cc:3419(sp_lex_keeper::reset_lex_and_exec_core(THD*, unsigned int*, bool, sp_instr*))[0x55a9ccbaa970]
sql/sp_head.cc:3593(sp_instr_stmt::execute(THD*, unsigned int*))[0x55a9ccbab8ff]
sql/sp_head.cc:1364(sp_head::execute(THD*, bool))[0x55a9ccb9d481]
sql/sp_head.cc:2370(sp_head::execute_procedure(THD*, List<Item>*))[0x55a9ccba3418]
sql/sql_parse.cc:3052(do_execute_sp(THD*, sp_head*))[0x55a9ccdd9e5f]
sql/sql_parse.cc:3294(Sql_cmd_call::execute(THD*))[0x55a9ccddb96b]
sql/sql_parse.cc:6187(mysql_execute_command(THD*))[0x55a9ccdf03df]
sql/sql_parse.cc:7985(mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool))[0x55a9ccdfbaf7]
sql/sql_parse.cc:1858(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x55a9ccdd2d43]
sql/sql_parse.cc:1373(do_command(THD*))[0x55a9ccdcf7c2]
sql/sql_connect.cc:1412(do_handle_one_connection(CONNECT*))[0x55a9cd1b0181]
sql/sql_connect.cc:1317(handle_one_connection)[0x55a9cd1afa23]
perfschema/pfs.cc:1871(pfs_spawn_thread)[0x55a9ce7f4c45]
nptl/pthread_create.c:487(start_thread)[0x7f8926a46fa3]
x86_64/clone.S:97(clone)[0x7f892604d4cf]
Query (0x625000122190): WITH cte1 AS (SELECT COUNT(*), @@max_connections FROM information_schema.processlist),
cte AS (
WITH
tb1 AS (SELECT MAX(id) id FROM t1),
tb2 AS (SELECT tm FROM tb1 JOIN t1 USING (id)),
tb3 AS (SELECT tb2.* FROM tb2)
SELECT 1 value, 2 message FROM tb3)
SELECT value FROM cte UNION ALL SELECT message FROM cte
also with ps:
sql/sql_select.cc:4082(JOIN::reinit())[0x5617672bee84]
sql/sql_union.cc:1449(st_select_lex_unit::optimize())[0x5617674a9cef]
sql/sql_union.cc:1507(st_select_lex_unit::exec())[0x5617674aa8a8]
sql/sql_union.cc:41(mysql_union(THD*, LEX*, select_result*, st_select_lex_unit*, unsigned long))[0x56176749b42a]
sql/sql_select.cc:400(handle_select(THD*, LEX*, select_result*, unsigned long))[0x56176729668d]
sql/sql_parse.cc:6444(execute_sqlcom_select(THD*, TABLE_LIST*))[0x561767206597]
sql/sql_parse.cc:3963(mysql_execute_command(THD*))[0x5617671f429b]
sql/sql_prepare.cc:4996(Prepared_statement::execute(String*, bool))[0x561767262d3b]
sql/sql_prepare.cc:4465(Prepared_statement::execute_loop(String*, bool, unsigned char*, unsigned char*))[0x56176725e1fb]
sql/sql_prepare.cc:3567(mysql_sql_stmt_execute(THD*))[0x56176725810a]
sql/sql_parse.cc:3980(mysql_execute_command(THD*))[0x5617671f42e0]
sql/sql_parse.cc:7985(mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool))[0x56176720fa2f]
sql/sql_parse.cc:1858(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x5617671e660a]
sql/sql_parse.cc:1373(do_command(THD*))[0x5617671e30b9]
sql/sql_connect.cc:1412(do_handle_one_connection(CONNECT*))[0x5617675d5f88]
sql/sql_connect.cc:1317(handle_one_connection)[0x5617675d582c]
perfschema/pfs.cc:1871(pfs_spawn_thread)[0x561768c96bfb]
nptl/pthread_create.c:478(start_thread)[0x7f9d20f84609]
x86_64/clone.S:97(__GI___clone)[0x7f9d20740293]