When the server starts up it looks in --tmpdir for leftover .FRM files from temporary tables (eg. from a prior crash). After the latest release, if any such .frm files are found and opened successfully, the server will crash on nullpointer access and will not be able to start until the .frm files have been manually removed from --tmpdir or the server downgraded to an earlier release without the problem.
The bug is introduced with this patch from MDEV-35840:
commit 78157c4765f2c086fabe183d51d7734ecffdbdd8
Author: Yuchen Pei <ycp@mariadb.com>
Date: Tue Jan 14 17:47:08 2025 +1100
MDEV-35840 Eliminate -warray-bounds triggered by TABLE_SHARE::db_type()
The share.db_type() is set by the call to open_table_def(), so after the patch the ht will always be NULL and the code will crash whenever open_table_def() returns 0.
This regression is quite severe as it leaves the server in a state where it cannot be started and with no indication to the user what is needed to resolve the problem. So the fix will need to go into 10.5.
Attachments
Issue Links
is caused by
MDEV-35840gcc 12/13: -Warray-bounds when dereferencing value returned from TABLE_SHARE::db_type()
ycp It's not a buildbot failure, it was our own servers running the Buildbot infrastructure this happened.
There is a MariaDB slave from the Buildbot master database (used for cross-reference maybe), it crashed due to OOM, and then it could not start again because of this bug.
Kristian Nielsen
added a comment - ycp It's not a buildbot failure, it was our own servers running the Buildbot infrastructure this happened.
There is a MariaDB slave from the Buildbot master database (used for cross-reference maybe), it crashed due to OOM, and then it could not start again because of this bug.
There is a zulip discussion about the incidence:
https://mariadb.zulipchat.com/#narrow/channel/118759-general/topic/MariaDB.2010.2E11.2E11.20not.20recovering.20from.20crash
Normally temporary tables does not have a .frm file, only storage engine files in /tmp
I found at least one case where a .frm file is created.
When creating a temporary table with federatedx that uses discovery, then a .frm table will be created in /tmp and the problem described in this ticket will happen.
When the table definition is provided, no tmp table is created:
MariaDB [test2]> create temporary table foo (a int) engine=federated connection='server_one';
Michael Widenius
added a comment - Normally temporary tables does not have a .frm file, only storage engine files in /tmp
I found at least one case where a .frm file is created.
When creating a temporary table with federatedx that uses discovery, then a .frm table will be created in /tmp and the problem described in this ticket will happen.
For example:
CREATE temporary TABLE foo3 ENGINE=FEDERATED CONNECTION='mysql://monty@storm:3307/test/foo';
When the table definition is provided, no tmp table is created:
MariaDB [test2] > create temporary table foo (a int) engine=federated connection='server_one';
It fits, the setup for the multi-CI cross-reference in the foundation buildbot is rather complicated, and it does involve a federated table.
Elena Stepanova
added a comment - It fits, the setup for the multi-CI cross-reference in the foundation buildbot is rather complicated, and it does involve a federated table.
I tried monty's scenario in the testcase federated.federatedx (see below) but it does not crash either. The first ls outputs a #sql....frm file as expected, but inside mysql_rm_tmp_tables() during the server restart, the tmpdir already appears to be empty, so it could have been removed in a cleanup in the server shutdown. Or it could be some extra setup of this specific test.
INSERT INTO federated.t1 (id, name) VALUES (1, 'foo');
INSERT INTO federated.t1 (id, name) VALUES (2, 'fee');
INSERT INTO federated.t1 (id, `group`) VALUES (3, 42);
Yuchen Pei
added a comment - - edited I tried monty 's scenario in the testcase federated.federatedx (see below) but it does not crash either. The first ls outputs a #sql....frm file as expected, but inside mysql_rm_tmp_tables() during the server restart, the tmpdir already appears to be empty, so it could have been removed in a cleanup in the server shutdown. Or it could be some extra setup of this specific test.
modified mysql-test/suite/federated/federatedx.test
@@ -84,16 +84,15 @@ DROP TABLE IF EXISTS federated.t1;
# # correct connection, same named tables
--replace_result $SLAVE_MYPORT SLAVE_PORT
-eval CREATE TABLE federated.t1 (
- `id` int(20) NOT NULL,
- `group` int NOT NULL default 0,
- `a\\\\b` InT NOT NULL default 0,
- `a\\\\` int NOT NULL default 0,
- `name` varchar(32) NOT NULL default ''
- )
+eval CREATE TEMPORARY TABLE federated.t1
ENGINE="FEDERATED" DEFAULT CHARSET=latin1
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1';
+let $MYSQLD_TMPDIR=`SELECT @@tmpdir`;
+exec ls $MYSQLD_TMPDIR;
+--source include/restart_mysqld.inc
+exec ls $MYSQLD_TMPDIR;
+
INSERT INTO federated.t1 (id, name) VALUES (1, 'foo');
INSERT INTO federated.t1 (id, name) VALUES (2, 'fee');
INSERT INTO federated.t1 (id, `group`) VALUES (3, 42);
People
Yuchen Pei
Kristian Nielsen
Votes:
0Vote for this issue
Watchers:
5Start watching this issue
Dates
Created:
Updated:
Resolved:
Git Integration
Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.
{"report":{"fcp":1164,"ttfb":358.60000002384186,"pageVisibility":"visible","entityId":132942,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"cbcfd860-ab55-4438-bd24-3dc6e98c5671","navigationType":0,"readyForUser":1257.1000000238419,"redirectCount":0,"resourceLoadedEnd":1432.2999999523163,"resourceLoadedStart":405.7999999523163,"resourceTiming":[{"duration":200.30000007152557,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":405.7999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":405.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":606.1000000238419,"responseStart":0,"secureConnectionStart":0},{"duration":200.5,"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":406.10000002384186,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":406.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":606.6000000238419,"responseStart":0,"secureConnectionStart":0},{"duration":210.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":406.2999999523163,"connectEnd":406.2999999523163,"connectStart":406.2999999523163,"domainLookupEnd":406.2999999523163,"domainLookupStart":406.2999999523163,"fetchStart":406.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":406.2999999523163,"responseEnd":617.2000000476837,"responseStart":617.2000000476837,"secureConnectionStart":406.2999999523163},{"duration":298.2999999523163,"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":406.60000002384186,"connectEnd":406.60000002384186,"connectStart":406.60000002384186,"domainLookupEnd":406.60000002384186,"domainLookupStart":406.60000002384186,"fetchStart":406.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":406.60000002384186,"responseEnd":704.8999999761581,"responseStart":704.8999999761581,"secureConnectionStart":406.60000002384186},{"duration":302.10000002384186,"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":406.7999999523163,"connectEnd":406.7999999523163,"connectStart":406.7999999523163,"domainLookupEnd":406.7999999523163,"domainLookupStart":406.7999999523163,"fetchStart":406.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":406.7999999523163,"responseEnd":708.8999999761581,"responseStart":708.8999999761581,"secureConnectionStart":406.7999999523163},{"duration":306.10000002384186,"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":406.89999997615814,"connectEnd":406.89999997615814,"connectStart":406.89999997615814,"domainLookupEnd":406.89999997615814,"domainLookupStart":406.89999997615814,"fetchStart":406.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":406.89999997615814,"responseEnd":713,"responseStart":713,"secureConnectionStart":406.89999997615814},{"duration":306.89999997615814,"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":407.10000002384186,"connectEnd":407.10000002384186,"connectStart":407.10000002384186,"domainLookupEnd":407.10000002384186,"domainLookupStart":407.10000002384186,"fetchStart":407.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":407.10000002384186,"responseEnd":714,"responseStart":714,"secureConnectionStart":407.10000002384186},{"duration":380.5,"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":407.2999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":407.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":787.7999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":307.5,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":407.5,"connectEnd":407.5,"connectStart":407.5,"domainLookupEnd":407.5,"domainLookupStart":407.5,"fetchStart":407.5,"redirectEnd":0,"redirectStart":0,"requestStart":407.5,"responseEnd":715,"responseStart":715,"secureConnectionStart":407.5},{"duration":380.2999999523163,"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":407.7000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":407.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":788,"responseStart":0,"secureConnectionStart":0},{"duration":308.40000009536743,"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":407.7999999523163,"connectEnd":407.7999999523163,"connectStart":407.7999999523163,"domainLookupEnd":407.7999999523163,"domainLookupStart":407.7999999523163,"fetchStart":407.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":407.7999999523163,"responseEnd":716.2000000476837,"responseStart":716.2000000476837,"secureConnectionStart":407.7999999523163},{"duration":1014.5,"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":408.7000000476837,"connectEnd":408.7000000476837,"connectStart":408.7000000476837,"domainLookupEnd":408.7000000476837,"domainLookupStart":408.7000000476837,"fetchStart":408.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":408.7000000476837,"responseEnd":1423.2000000476837,"responseStart":1423.2000000476837,"secureConnectionStart":408.7000000476837},{"duration":1023.3999999761581,"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":408.89999997615814,"connectEnd":408.89999997615814,"connectStart":408.89999997615814,"domainLookupEnd":408.89999997615814,"domainLookupStart":408.89999997615814,"fetchStart":408.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":408.89999997615814,"responseEnd":1432.2999999523163,"responseStart":1432.2999999523163,"secureConnectionStart":408.89999997615814},{"duration":621.6999999284744,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":802.6000000238419,"connectEnd":802.6000000238419,"connectStart":802.6000000238419,"domainLookupEnd":802.6000000238419,"domainLookupStart":802.6000000238419,"fetchStart":802.6000000238419,"redirectEnd":0,"redirectStart":0,"requestStart":802.6000000238419,"responseEnd":1424.2999999523163,"responseStart":1424.2999999523163,"secureConnectionStart":802.6000000238419},{"duration":345.5,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1153.7999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1153.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1499.2999999523163,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":187,"responseStart":358,"responseEnd":369,"domLoading":402,"domInteractive":1502,"domContentLoadedEventStart":1502,"domContentLoadedEventEnd":1550,"domComplete":2001,"loadEventStart":2001,"loadEventEnd":2002,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1463.7000000476837},{"name":"bigPipe.sidebar-id.end","time":1464.6000000238419},{"name":"bigPipe.activity-panel-pipe-id.start","time":1464.7999999523163},{"name":"bigPipe.activity-panel-pipe-id.end","time":1468.2000000476837},{"name":"activityTabFullyLoaded","time":1568.7000000476837}],"measures":[],"correlationId":"3e59562c7d7463","effectiveType":"4g","downlink":9.4,"rtt":0,"serverDuration":109,"dbReadsTimeInMs":15,"dbConnsTimeInMs":25,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Thanks for the review - pushed 0fa141ebb4639c5c6c4b5d990f448a932fd095a8 to 10.5