Currently, the code relies on big stack buffers for temporary data.
This leads to stack overflow crashes.
In my case, on my system, the stack limit is 8192, whereas below, more is requested.
Example:
static bool page_is_corrupted(const byte *page, ulint page_no,
|
const xb_fil_cur_t *cursor,
|
const fil_space_t *space)
|
{
|
byte tmp_frame[UNIV_PAGE_SIZE_MAX];
|
byte tmp_page[UNIV_PAGE_SIZE_MAX];
|
|
Perhaps threadlocal static- or heap buffers should be used instead
{"report":{"fcp":798.3000001907349,"ttfb":216.90000009536743,"pageVisibility":"visible","entityId":130369,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"b5ca930a-ee9b-4e4b-938c-6f1c92a828e1","navigationType":0,"readyForUser":863.3000001907349,"redirectCount":0,"resourceLoadedEnd":912.8000001907349,"resourceLoadedStart":221.90000009536743,"resourceTiming":[{"duration":47.59999990463257,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":221.90000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":221.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":269.5,"responseStart":0,"secureConnectionStart":0},{"duration":47.700000047683716,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/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":222.20000004768372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":222.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":269.90000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":109.10000014305115,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":222.20000004768372,"connectEnd":222.20000004768372,"connectStart":222.20000004768372,"domainLookupEnd":222.20000004768372,"domainLookupStart":222.20000004768372,"fetchStart":222.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":222.20000004768372,"responseEnd":331.30000019073486,"responseStart":331.30000019073486,"secureConnectionStart":222.20000004768372},{"duration":174.29999995231628,"initiatorType":"script","name":"https://jira.mariadb.org/s/099b33461394b8015fc36c0a4b96e19f-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/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":222.40000009536743,"connectEnd":222.40000009536743,"connectStart":222.40000009536743,"domainLookupEnd":222.40000009536743,"domainLookupStart":222.40000009536743,"fetchStart":222.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":222.40000009536743,"responseEnd":396.7000000476837,"responseStart":396.7000000476837,"secureConnectionStart":222.40000009536743},{"duration":178,"initiatorType":"script","name":"https://jira.mariadb.org/s/94c15bff32baef80f4096a08aceae8bc-CDN/lu2bu7/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":222.5,"connectEnd":222.5,"connectStart":222.5,"domainLookupEnd":222.5,"domainLookupStart":222.5,"fetchStart":222.5,"redirectEnd":0,"redirectStart":0,"requestStart":222.5,"responseEnd":400.5,"responseStart":400.5,"secureConnectionStart":222.5},{"duration":178.39999985694885,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":222.60000014305115,"connectEnd":222.60000014305115,"connectStart":222.60000014305115,"domainLookupEnd":222.60000014305115,"domainLookupStart":222.60000014305115,"fetchStart":222.60000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":222.60000014305115,"responseEnd":401,"responseStart":401,"secureConnectionStart":222.60000014305115},{"duration":178.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":222.70000004768372,"connectEnd":222.70000004768372,"connectStart":222.70000004768372,"domainLookupEnd":222.70000004768372,"domainLookupStart":222.70000004768372,"fetchStart":222.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":222.70000004768372,"responseEnd":401.60000014305115,"responseStart":401.60000014305115,"secureConnectionStart":222.70000004768372},{"duration":179.19999980926514,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bu7/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":222.80000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":222.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":402,"responseStart":0,"secureConnectionStart":0},{"duration":179.19999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":222.80000019073486,"connectEnd":222.80000019073486,"connectStart":222.80000019073486,"domainLookupEnd":222.80000019073486,"domainLookupStart":222.80000019073486,"fetchStart":222.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":222.80000019073486,"responseEnd":402,"responseStart":402,"secureConnectionStart":222.80000019073486},{"duration":179.60000014305115,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bu7/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":223,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":223,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":402.60000014305115,"responseStart":0,"secureConnectionStart":0},{"duration":179.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/3339d87fa2538a859872f2df449bf8d0-CDN/lu2bu7/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":223.10000014305115,"connectEnd":223.10000014305115,"connectStart":223.10000014305115,"domainLookupEnd":223.10000014305115,"domainLookupStart":223.10000014305115,"fetchStart":223.10000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":223.10000014305115,"responseEnd":402.7000000476837,"responseStart":402.7000000476837,"secureConnectionStart":223.10000014305115},{"duration":483.7999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":228.70000004768372,"connectEnd":228.70000004768372,"connectStart":228.70000004768372,"domainLookupEnd":228.70000004768372,"domainLookupStart":228.70000004768372,"fetchStart":228.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":228.70000004768372,"responseEnd":712.5,"responseStart":712.5,"secureConnectionStart":228.70000004768372},{"duration":484.2999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":228.70000004768372,"connectEnd":228.70000004768372,"connectStart":228.70000004768372,"domainLookupEnd":228.70000004768372,"domainLookupStart":228.70000004768372,"fetchStart":228.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":228.70000004768372,"responseEnd":713,"responseStart":713,"secureConnectionStart":228.70000004768372},{"duration":143.59999990463257,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":547.4000000953674,"connectEnd":547.4000000953674,"connectStart":547.4000000953674,"domainLookupEnd":547.4000000953674,"domainLookupStart":547.4000000953674,"fetchStart":547.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":547.4000000953674,"responseEnd":691,"responseStart":691,"secureConnectionStart":547.4000000953674},{"duration":136.40000009536743,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":773.2000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":773.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":909.6000001430511,"responseStart":0,"secureConnectionStart":0},{"duration":135.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/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","startTime":776.9000000953674,"connectEnd":776.9000000953674,"connectStart":776.9000000953674,"domainLookupEnd":776.9000000953674,"domainLookupStart":776.9000000953674,"fetchStart":776.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":776.9000000953674,"responseEnd":912.8000001907349,"responseStart":912.8000001907349,"secureConnectionStart":776.9000000953674}],"fetchStart":1,"domainLookupStart":1,"domainLookupEnd":1,"connectStart":1,"connectEnd":1,"requestStart":82,"responseStart":217,"responseEnd":225,"domLoading":221,"domInteractive":921,"domContentLoadedEventStart":921,"domContentLoadedEventEnd":963,"domComplete":1177,"loadEventStart":1177,"loadEventEnd":1177,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":898.9000000953674},{"name":"bigPipe.sidebar-id.end","time":899.7000000476837},{"name":"bigPipe.activity-panel-pipe-id.start","time":899.9000000953674},{"name":"bigPipe.activity-panel-pipe-id.end","time":901.4000000953674},{"name":"activityTabFullyLoaded","time":981.3000001907349}],"measures":[],"correlationId":"4233607eddbd87","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":86,"dbReadsTimeInMs":17,"dbConnsTimeInMs":25,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Thank you. In 10.6 this excessive stack usage would actually be flagged at compilation time if PRAGMA_DISABLE_CHECK_STACK_FRAME hadn’t been added to disable this.
I agree that these buffers could be declared as static thread_local. Based on the debugger output (including some disassembly) that you provided I concluded that this is a stack overflow.