For some large queries Item_cond::remove_eq_conds() calls itself recursively end eventually runs out of stack. See attached schema and query files for repro.
The possible workaround would be to add this code to the beginning of the function:
if (check_stack_overrun(thd, STACK_MIN_SIZE, NULL))
{
*cond_value= Item::COND_FALSE;
return (COND*) 0;
}
After such change mysqld will emit error instead of crashing:
ERROR 1436 (HY000): Thread stack overrun: 283200 bytes used of a 299008 byte stack, and 16000 bytes needed. Use 'mysqld --thread_stack=#' to specify a bigger stack
Would be nice to check all recursive function calls across the source base and make sure we have stack overflow guards there.
mentioned in
Page Failed to load
Page Failed to load
Page Failed to load
Page Failed to load
Page Failed to load
Page Loading...
Page Loading...
Page Loading...
Page Loading...
Page Loading...
Show 5 more links (5 mentioned in)
{"report":{"fcp":717.2999997138977,"ttfb":170.09999990463257,"pageVisibility":"visible","entityId":127939,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"9cefd3bf-735f-437c-a504-42d82c54d15b","navigationType":0,"readyForUser":801.9000000953674,"redirectCount":0,"resourceLoadedEnd":471.59999990463257,"resourceLoadedStart":179.7999997138977,"resourceTiming":[{"duration":12.200000286102295,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bsh/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":179.7999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":179.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":192,"responseStart":0,"secureConnectionStart":0},{"duration":13.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bsh/820016/12ta74/eb142f92e4bd16bd1ef8b08c1b9d5d56/_/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":180,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":180,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":193.5,"responseStart":0,"secureConnectionStart":0},{"duration":145.30000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/c54b129276d75dc2a3460e1d78f37913-CDN/lu2bsh/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":180.19999980926514,"connectEnd":194,"connectStart":194,"domainLookupEnd":194,"domainLookupStart":194,"fetchStart":180.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":194.5,"responseEnd":325.5,"responseStart":205.59999990463257,"secureConnectionStart":194},{"duration":278.30000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/f867843cd2fdb209d4d1d4f760f86346-CDN/lu2bsh/820016/12ta74/eb142f92e4bd16bd1ef8b08c1b9d5d56/_/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":180.69999980926514,"connectEnd":180.69999980926514,"connectStart":180.69999980926514,"domainLookupEnd":180.69999980926514,"domainLookupStart":180.69999980926514,"fetchStart":180.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":195.40000009536743,"responseEnd":459,"responseStart":214.5,"secureConnectionStart":180.69999980926514},{"duration":36.700000286102295,"initiatorType":"script","name":"https://jira.mariadb.org/s/ffdb17665775c5b4d6f097f3974ee359-CDN/lu2bsh/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":180.7999997138977,"connectEnd":180.7999997138977,"connectStart":180.7999997138977,"domainLookupEnd":180.7999997138977,"domainLookupStart":180.7999997138977,"fetchStart":180.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":195.59999990463257,"responseEnd":217.5,"responseStart":216.40000009536743,"secureConnectionStart":180.7999997138977},{"duration":47.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bsh/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":180.90000009536743,"connectEnd":180.90000009536743,"connectStart":180.90000009536743,"domainLookupEnd":180.90000009536743,"domainLookupStart":180.90000009536743,"fetchStart":180.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":198.5,"responseEnd":228.59999990463257,"responseStart":224.59999990463257,"secureConnectionStart":180.90000009536743},{"duration":48.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bsh/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":180.90000009536743,"connectEnd":180.90000009536743,"connectStart":180.90000009536743,"domainLookupEnd":180.90000009536743,"domainLookupStart":180.90000009536743,"fetchStart":180.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":199.2999997138977,"responseEnd":229,"responseStart":225.19999980926514,"secureConnectionStart":180.90000009536743},{"duration":17.09999990463257,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bsh/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":181,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":181,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":198.09999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":48.5,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":181.09999990463257,"connectEnd":181.09999990463257,"connectStart":181.09999990463257,"domainLookupEnd":181.09999990463257,"domainLookupStart":181.09999990463257,"fetchStart":181.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":200.40000009536743,"responseEnd":229.59999990463257,"responseStart":226.5,"secureConnectionStart":181.09999990463257},{"duration":17.90000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bsh/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":181.19999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":181.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":199.09999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":47.89999961853027,"initiatorType":"script","name":"https://jira.mariadb.org/s/81b5d7c27af3ebc078cc4a36383678ba-CDN/lu2bsh/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":181.40000009536743,"connectEnd":181.40000009536743,"connectStart":181.40000009536743,"domainLookupEnd":181.40000009536743,"domainLookupStart":181.40000009536743,"fetchStart":181.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":201.19999980926514,"responseEnd":229.2999997138977,"responseStart":226,"secureConnectionStart":181.40000009536743},{"duration":283.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bsh/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":187.90000009536743,"connectEnd":187.90000009536743,"connectStart":187.90000009536743,"domainLookupEnd":187.90000009536743,"domainLookupStart":187.90000009536743,"fetchStart":187.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":352.5,"responseEnd":471.40000009536743,"responseStart":464.2999997138977,"secureConnectionStart":187.90000009536743},{"duration":283.30000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bsh/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":188.2999997138977,"connectEnd":188.2999997138977,"connectStart":188.2999997138977,"domainLookupEnd":188.2999997138977,"domainLookupStart":188.2999997138977,"fetchStart":188.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":353.09999990463257,"responseEnd":471.59999990463257,"responseStart":464.7999997138977,"secureConnectionStart":188.2999997138977},{"duration":138.7000002861023,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":467.19999980926514,"connectEnd":467.19999980926514,"connectStart":467.19999980926514,"domainLookupEnd":467.19999980926514,"domainLookupStart":467.19999980926514,"fetchStart":467.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":575.7999997138977,"responseEnd":605.9000000953674,"responseStart":605.1999998092651,"secureConnectionStart":467.19999980926514}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":34,"responseStart":170,"responseEnd":188,"domLoading":173,"domInteractive":857,"domContentLoadedEventStart":857,"domContentLoadedEventEnd":903,"domComplete":1516,"loadEventStart":1516,"loadEventEnd":1517,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":838.4000000953674},{"name":"bigPipe.sidebar-id.end","time":839},{"name":"bigPipe.activity-panel-pipe-id.start","time":839.2999997138977},{"name":"bigPipe.activity-panel-pipe-id.end","time":840.2999997138977},{"name":"activityTabFullyLoaded","time":958.7999997138977}],"measures":[],"correlationId":"910ced03f982e8","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":77,"dbReadsTimeInMs":10,"dbConnsTimeInMs":17,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
I have a patch that already was reviewed by Monty that I can push to 10.4:
https://lists.mariadb.org/hyperkitty/list/commits@lists.mariadb.org/thread/XUVC4SZOBJL7X2YOVTS6KD7BZB3MM42M/
Or bar, if you want to take it that's fine as well.