If OOM (out of memory) happens inside create_virtual_tmp_table(), the server can crash.
There are two problems:
1. If OOM happens inside multi_alloc_root in Virtual_tmp_table::init, then the member TABLE::s is left to be a NULL pointer. The destructor calls destruct_fields() without a test that TABLE::s was really allocated. It should test that s is not NULL before calling destruct_fields.
2. The class Virtual_tmp_table overrides the operator new to allocate itself on mem_root, but it does not override the operator delete, which is mapped to the system function free() by default. As a result free() is called for something which was never allocated with the system function malloc(). The class Virtual_tmp_table should override operator delete.
The problem was introduced by the patch for MDEV-9238 in 10.2.0.
- relates to
-
MDEV-9238
Wrap create_virtual_tmp_table() into a class, split into different steps
-
-
Closed
{"report":{"fcp":1061.2999997138977,"ttfb":313.2999997138977,"pageVisibility":"visible","entityId":60799,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"ba8cb34f-683c-4499-bafa-501d2a72cbe6","navigationType":0,"readyForUser":1139.5999999046326,"redirectCount":0,"resourceLoadedEnd":1429.7999997138977,"resourceLoadedStart":318.5,"resourceTiming":[{"duration":257.7999997138977,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":318.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":318.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":576.2999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":257.90000009536743,"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":318.7999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":318.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":576.6999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":267.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":318.8999996185303,"connectEnd":318.8999996185303,"connectStart":318.8999996185303,"domainLookupEnd":318.8999996185303,"domainLookupStart":318.8999996185303,"fetchStart":318.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":318.8999996185303,"responseEnd":586.2999997138977,"responseStart":586.2999997138977,"secureConnectionStart":318.8999996185303},{"duration":341.59999990463257,"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":319.09999990463257,"connectEnd":319.09999990463257,"connectStart":319.09999990463257,"domainLookupEnd":319.09999990463257,"domainLookupStart":319.09999990463257,"fetchStart":319.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":319.09999990463257,"responseEnd":660.6999998092651,"responseStart":660.6999998092651,"secureConnectionStart":319.09999990463257},{"duration":345.2000002861023,"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":319.3999996185303,"connectEnd":319.3999996185303,"connectStart":319.3999996185303,"domainLookupEnd":319.3999996185303,"domainLookupStart":319.3999996185303,"fetchStart":319.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":319.3999996185303,"responseEnd":664.5999999046326,"responseStart":664.5999999046326,"secureConnectionStart":319.3999996185303},{"duration":345.59999990463257,"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":319.5,"connectEnd":319.5,"connectStart":319.5,"domainLookupEnd":319.5,"domainLookupStart":319.5,"fetchStart":319.5,"redirectEnd":0,"redirectStart":0,"requestStart":319.5,"responseEnd":665.0999999046326,"responseStart":665.0999999046326,"secureConnectionStart":319.5},{"duration":345.59999990463257,"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":319.7999997138977,"connectEnd":319.7999997138977,"connectStart":319.7999997138977,"domainLookupEnd":319.7999997138977,"domainLookupStart":319.7999997138977,"fetchStart":319.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":319.7999997138977,"responseEnd":665.3999996185303,"responseStart":665.3999996185303,"secureConnectionStart":319.7999997138977},{"duration":414.30000019073486,"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":319.8999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":319.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":734.1999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":345.7999997138977,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":320.09999990463257,"connectEnd":320.09999990463257,"connectStart":320.09999990463257,"domainLookupEnd":320.09999990463257,"domainLookupStart":320.09999990463257,"fetchStart":320.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":320.09999990463257,"responseEnd":665.8999996185303,"responseStart":665.8999996185303,"secureConnectionStart":320.09999990463257},{"duration":414,"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":320.2999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":320.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":734.2999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":346,"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":320.5,"connectEnd":320.5,"connectStart":320.5,"domainLookupEnd":320.5,"domainLookupStart":320.5,"fetchStart":320.5,"redirectEnd":0,"redirectStart":0,"requestStart":320.5,"responseEnd":666.5,"responseStart":666.5,"secureConnectionStart":320.5},{"duration":753.4000000953674,"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":325.7999997138977,"connectEnd":325.7999997138977,"connectStart":325.7999997138977,"domainLookupEnd":325.7999997138977,"domainLookupStart":325.7999997138977,"fetchStart":325.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":325.7999997138977,"responseEnd":1079.1999998092651,"responseStart":1079.1999998092651,"secureConnectionStart":325.7999997138977},{"duration":1103.7999997138977,"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":326,"connectEnd":326,"connectStart":326,"domainLookupEnd":326,"domainLookupStart":326,"fetchStart":326,"redirectEnd":0,"redirectStart":0,"requestStart":326,"responseEnd":1429.7999997138977,"responseStart":1429.7999997138977,"secureConnectionStart":326},{"duration":333.3999996185303,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":746.5,"connectEnd":746.5,"connectStart":746.5,"domainLookupEnd":746.5,"domainLookupStart":746.5,"fetchStart":746.5,"redirectEnd":0,"redirectStart":0,"requestStart":746.5,"responseEnd":1079.8999996185303,"responseStart":1079.8999996185303,"secureConnectionStart":746.5},{"duration":378.59999990463257,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1055.0999999046326,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1055.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1433.6999998092651,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":156,"responseStart":313,"responseEnd":320,"domLoading":317,"domInteractive":1452,"domContentLoadedEventStart":1452,"domContentLoadedEventEnd":1493,"domComplete":2518,"loadEventStart":2518,"loadEventEnd":2520,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1434.5999999046326},{"name":"bigPipe.sidebar-id.end","time":1435.5},{"name":"bigPipe.activity-panel-pipe-id.start","time":1435.6999998092651},{"name":"bigPipe.activity-panel-pipe-id.end","time":1438.8999996185303},{"name":"activityTabFullyLoaded","time":1537.2999997138977}],"measures":[],"correlationId":"c5ddd1539f78db","effectiveType":"4g","downlink":9.6,"rtt":0,"serverDuration":90,"dbReadsTimeInMs":10,"dbConnsTimeInMs":20,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}