Type:
Bug
Priority:
Critical
Resolution:
Fixed
Affects Version/s:
10.3.24 , 10.4.14 , 10.5.5 , 10.3(EOL) , 10.4(EOL) , 10.5 , 10.6 , 10.7(EOL) , 10.8(EOL)
One of our customer observed server crashes, when calling a function, which invokes two other functions, involving some tables and a view.
This behavior is observed at the 10.3.24, 10.4.14 and 10.5.5 (the latest releases). Also, important to note customer has provided the related functions, tables, views details, through which I can locally able to reproduce the issue at our latest releases.
Attached is the dump.sql having all related functions, tables, views. Also, attaching full error log(maria.err), all threads backtrace(mysqld_bt_all_threads.txt) output.
To reproduce:
* Install 10.3.24 or 10.4.14 or 10.5.5(latest release)
* restore the data - dump.sql
* At server.cnf put
lower_case_table_names=1
log-error=mariadb.err
core-file
* Start the server
* execute below SQL
select FN_SPM_CHK_BCD_PUBL_TEST('1', '20200910') as aaa
Error log output:
201007 8:56:58 [ERROR] mysqld got signal 11 ;
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.3.24-MariaDB-log
key_buffer_size=268435456
read_buffer_size=8388608
max_used_connections=1
max_threads=1002
thread_count=9
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 16701465 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
Thread pointer: 0x55af048a4038
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...
stack_bottom = 0x7f854c7b5d30 thread_stack 0x49000
/usr/sbin/mysqld(my_print_stacktrace+0x2e)[0x55af0134351e]
/usr/sbin/mysqld(handle_fatal_signal+0x30f)[0x55af00dd8a4f]
sigaction.c:0(__restore_rt)[0x7f8562e16630]
/usr/sbin/mysqld(_ZN7Item_sp7cleanupEv+0x1b)[0x55af00df644b]
/usr/sbin/mysqld(_ZN12Item_func_sp7cleanupEv+0x18)[0x55af00e426f8]
/usr/sbin/mysqld(_Z13cleanup_itemsP4Item+0x21)[0x55af00bec581]
/usr/sbin/mysqld(_ZN7sp_head7executeEP3THDb+0x8d0)[0x55af00b65f40]
/usr/sbin/mysqld(_ZN7sp_head16execute_functionEP3THDPP4ItemjP5FieldPP11sp_rcontextP11Query_arena+0x582)[0x55af00b67ac2]
/usr/sbin/mysqld(_ZN7Item_sp12execute_implEP3THDPP4Itemj+0x128)[0x55af00df6618]
/usr/sbin/mysqld(_ZN7Item_sp7executeEP3THDPbPP4Itemj+0x21)[0x55af00df6861]
/usr/sbin/mysqld(_ZN12Item_func_sp7val_intEv+0x11)[0x55af00e5a271]
/usr/sbin/mysqld(_ZNK12Type_handler14Item_send_tinyEP4ItemP8ProtocolP8st_value+0x19)[0x55af00d2db19]
/usr/sbin/mysqld(_ZN8Protocol19send_result_set_rowEP4ListI4ItemE+0x13f)[0x55af00b4826f]
/usr/sbin/mysqld(_ZN11select_send9send_dataER4ListI4ItemE+0x53)[0x55af00bb4073]
/usr/sbin/mysqld(_ZN4JOIN10exec_innerEv+0xa5c)[0x55af00c51b1c]
/usr/sbin/mysqld(_ZN4JOIN4execEv+0x33)[0x55af00c51d63]
/usr/sbin/mysqld(_Z12mysql_selectP3THDP10TABLE_LISTjR4ListI4ItemEPS4_jP8st_orderS9_S7_S9_yP13select_resultP18st_select_lex_unitP13st_select_lex+0x11a)[0x55af00c5026a]
/usr/sbin/mysqld(_Z13handle_selectP3THDP3LEXP13select_resultm+0x1cc)[0x55af00c50d7c]
/usr/sbin/mysqld(+0x4daf06)[0x55af00b00f06]
/usr/sbin/mysqld(_Z21mysql_execute_commandP3THD+0x63ba)[0x55af00bf98ca]
/usr/sbin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_statebb+0x36d)[0x55af00bfc63d]
/usr/sbin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcjbb+0xfe1)[0x55af00bfded1]
/usr/sbin/mysqld(_Z10do_commandP3THD+0x11b)[0x55af00c0016b]
/usr/sbin/mysqld(_Z24do_handle_one_connectionP7CONNECT+0x1d6)[0x55af00cd6a86]
/usr/sbin/mysqld(handle_one_connection+0x3d)[0x55af00cd6b9d]
pthread_create.c:0(start_thread)[0x7f8562e0eea5]
/lib64/libc.so.6(clone+0x6d)[0x7f85611af8dd]
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x55af048b1ac0): select FN_SPM_CHK_BCD_PUBL_TEST('1', '20200910') as aaa
Connection ID (thread ID): 11
Status: NOT_KILLED
{"report":{"fcp":973.5,"ttfb":373.90000009536743,"pageVisibility":"visible","entityId":92463,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"01364049-bef8-4f00-a692-ab0a90fe1242","navigationType":0,"readyForUser":1126.4000000953674,"redirectCount":0,"resourceLoadedEnd":1162.5999999046326,"resourceLoadedStart":382.40000009536743,"resourceTiming":[{"duration":76.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":382.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":382.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":458.90000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":77.30000019073486,"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":382.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":382.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":460,"responseStart":0,"secureConnectionStart":0},{"duration":136.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":383,"connectEnd":383,"connectStart":383,"domainLookupEnd":383,"domainLookupStart":383,"fetchStart":383,"redirectEnd":0,"redirectStart":0,"requestStart":383,"responseEnd":519.9000000953674,"responseStart":519.9000000953674,"secureConnectionStart":383},{"duration":233,"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":383.80000019073486,"connectEnd":383.80000019073486,"connectStart":383.80000019073486,"domainLookupEnd":383.80000019073486,"domainLookupStart":383.80000019073486,"fetchStart":383.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":383.80000019073486,"responseEnd":616.8000001907349,"responseStart":616.8000001907349,"secureConnectionStart":383.80000019073486},{"duration":236.80000019073486,"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":384.09999990463257,"connectEnd":384.09999990463257,"connectStart":384.09999990463257,"domainLookupEnd":384.09999990463257,"domainLookupStart":384.09999990463257,"fetchStart":384.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":384.09999990463257,"responseEnd":620.9000000953674,"responseStart":620.9000000953674,"secureConnectionStart":384.09999990463257},{"duration":237.10000038146973,"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":384.19999980926514,"connectEnd":384.19999980926514,"connectStart":384.19999980926514,"domainLookupEnd":384.19999980926514,"domainLookupStart":384.19999980926514,"fetchStart":384.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":384.19999980926514,"responseEnd":621.3000001907349,"responseStart":621.3000001907349,"secureConnectionStart":384.19999980926514},{"duration":237.39999961853027,"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":384.30000019073486,"connectEnd":384.30000019073486,"connectStart":384.30000019073486,"domainLookupEnd":384.30000019073486,"domainLookupStart":384.30000019073486,"fetchStart":384.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":384.30000019073486,"responseEnd":621.6999998092651,"responseStart":621.6999998092651,"secureConnectionStart":384.30000019073486},{"duration":278.19999980926514,"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":384.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":384.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":662.6999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":237.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":384.69999980926514,"connectEnd":384.69999980926514,"connectStart":384.69999980926514,"domainLookupEnd":384.69999980926514,"domainLookupStart":384.69999980926514,"fetchStart":384.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":384.69999980926514,"responseEnd":622.0999999046326,"responseStart":622.0999999046326,"secureConnectionStart":384.69999980926514},{"duration":277.90000009536743,"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":384.90000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":384.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":662.8000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":237.59999990463257,"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":385.09999990463257,"connectEnd":385.09999990463257,"connectStart":385.09999990463257,"domainLookupEnd":385.09999990463257,"domainLookupStart":385.09999990463257,"fetchStart":385.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":385.09999990463257,"responseEnd":622.6999998092651,"responseStart":622.6999998092651,"secureConnectionStart":385.09999990463257},{"duration":538.8000001907349,"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":396,"connectEnd":396,"connectStart":396,"domainLookupEnd":396,"domainLookupStart":396,"fetchStart":396,"redirectEnd":0,"redirectStart":0,"requestStart":396,"responseEnd":934.8000001907349,"responseStart":934.8000001907349,"secureConnectionStart":396},{"duration":549,"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":402.30000019073486,"connectEnd":402.30000019073486,"connectStart":402.30000019073486,"domainLookupEnd":402.30000019073486,"domainLookupStart":402.30000019073486,"fetchStart":402.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":402.30000019073486,"responseEnd":951.3000001907349,"responseStart":951.3000001907349,"secureConnectionStart":402.30000019073486},{"duration":260.40000009536743,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":674.6999998092651,"connectEnd":674.6999998092651,"connectStart":674.6999998092651,"domainLookupEnd":674.6999998092651,"domainLookupStart":674.6999998092651,"fetchStart":674.6999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":674.6999998092651,"responseEnd":935.0999999046326,"responseStart":935.0999999046326,"secureConnectionStart":674.6999998092651},{"duration":203.69999980926514,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":966.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":966.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1170.1999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":173.19999980926514,"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":989.4000000953674,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":989.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1162.5999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":113.2999997138977,"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":990.4000000953674,"connectEnd":990.4000000953674,"connectStart":990.4000000953674,"domainLookupEnd":990.4000000953674,"domainLookupStart":990.4000000953674,"fetchStart":990.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":990.4000000953674,"responseEnd":1103.6999998092651,"responseStart":1103.6999998092651,"secureConnectionStart":990.4000000953674},{"duration":117.7999997138977,"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":990.9000000953674,"connectEnd":990.9000000953674,"connectStart":990.9000000953674,"domainLookupEnd":990.9000000953674,"domainLookupStart":990.9000000953674,"fetchStart":990.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":990.9000000953674,"responseEnd":1108.6999998092651,"responseStart":1108.6999998092651,"secureConnectionStart":990.9000000953674}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":195,"responseStart":373,"responseEnd":402,"domLoading":377,"domInteractive":1215,"domContentLoadedEventStart":1215,"domContentLoadedEventEnd":1263,"domComplete":1512,"loadEventStart":1512,"loadEventEnd":1512,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1174.1999998092651},{"name":"bigPipe.sidebar-id.end","time":1174.9000000953674},{"name":"bigPipe.activity-panel-pipe-id.start","time":1175.0999999046326},{"name":"bigPipe.activity-panel-pipe-id.end","time":1177},{"name":"activityTabFullyLoaded","time":1283.4000000953674}],"measures":[],"correlationId":"1e5cf2225ebe6d","effectiveType":"4g","downlink":9.2,"rtt":0,"serverDuration":108,"dbReadsTimeInMs":15,"dbConnsTimeInMs":25,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Problem is with Item_sp (f3) created by make_view, which allocates result firld in runtime of f2 function and cleaned up when the runtime root is already freed.