As the size of core dump files by default mostly equals the process size producing core dumps can become an issue on systems with memory buffers, esp. large innodb_buffer_pool_size.
There needs to be enough file system space to store such large core dumps, and with multi gigabyte files it also takes a non-trivial amount of time to write these, so delaying process restart quite a bit.
And then there's also a security aspect to it: as the core dump contains the complete innodb buffer pool it contains a substantial amount, or even all, of the actual user data in the database.
At the same time actual buffer contents are rarely needed when doing a post mortem analysis (usually we only need stack frames and a few pieces of local data).
So I'm proposing a server option to exclude certain buffers from core dumps by marking them as DONOTDUMP with the madvise() system call.
Attachments
Issue Links
causes
MDEV-18946munmap of 1 byte during shutdown is EINVAL
I checked QC part looks OK, but I do not know how that madwise works, and failed test on github makes me doubting about allowing that changes
Oleksandr Byelkin
added a comment - I checked QC part looks OK, but I do not know how that madwise works, and failed test on github makes me doubting about allowing that changes
It should not affect mysqld at runtime at all, it is only evaluated when actually writing a core dump:
From the madvise(2) man page:
MADV_DONTDUMP (since Linux 3.4)
Exclude from a core dump those pages in the range specified by
addr and length. This is useful in applications that have
large areas of memory that are known not to be useful in a
core dump. The effect of MADV_DONTDUMP takes precedence over
the bit mask that is set via the /proc/[pid]/coredump_filter
file (see core(5)).
Hartmut Holzgraefe
added a comment - It should not affect mysqld at runtime at all, it is only evaluated when actually writing a core dump:
From the madvise(2) man page:
MADV_DONTDUMP (since Linux 3.4)
Exclude from a core dump those pages in the range specified by
addr and length. This is useful in applications that have
large areas of memory that are known not to be useful in a
core dump. The effect of MADV_DONTDUMP takes precedence over
the bit mask that is set via the /proc/ [pid] /coredump_filter
file (see core(5)).
The messages in the MariaDB server error log can be ignored, and they should disappear after upgrading the kernel.
Marko Mäkelä
added a comment - kpenza reported in the maria-discuss list that this change may cause error messages to be displayed on startup and shutdown:
Sep 25 10:40:53 srv1 mysqld: 2018-09-25 10:40:53 0 [Warning] InnoDB: Failed to set memory to DODUMP: Invalid argument ptr 0x2aaac5400000 size 2097152
…
Sep 25 10:41:19 srv1 mysqld: 2018-09-25 10:41:19 0 [Warning] InnoDB: Failed to set memory to DODUMP: Invalid argument ptr 0x2aaac3400000 size 33554432
The reason for this turned out to be a Linux kernel bug, for which danblack contributed a fix for the Linux 4.19 kernel :
mm: madvise(MADV_DODUMP): allow hugetlbfs pages
This was also included in the backport queue for older kernels .
The messages in the MariaDB server error log can be ignored, and they should disappear after upgrading the kernel.
The kernel fix has been released in 4.19 and stable kernels 4.18.14, 4.14.76, 4.9.133, 4.4.161, and 3.18.124, and will be in 3.16.62. Redhat has confirmed it will be in their kernels (probably out already).
Without this fix, the impact is that a core dump may not contain all the information.
Daniel Black
added a comment - Notes for anyone else that comes across this:
The kernel fix has been released in 4.19 and stable kernels 4.18.14, 4.14.76, 4.9.133, 4.4.161, and 3.18.124, and will be in 3.16.62. Redhat has confirmed it will be in their kernels (probably out already).
Without this fix, the impact is that a core dump may not contain all the information.
People
Oleksandr Byelkin
Hartmut Holzgraefe
Votes:
4Vote for this issue
Watchers:
12Start 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":1124.6999998092651,"ttfb":243,"pageVisibility":"visible","entityId":58108,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"1b27d399-8bdd-4f01-b735-d447031437c5","navigationType":0,"readyForUser":1353.5999999046326,"redirectCount":0,"resourceLoadedEnd":1423.8999996185303,"resourceLoadedStart":251.89999961853027,"resourceTiming":[{"duration":88.2000002861023,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":251.89999961853027,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":251.89999961853027,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":340.09999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":88.40000009536743,"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":252.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":252.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":340.5,"responseStart":0,"secureConnectionStart":0},{"duration":418.2000002861023,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":252.2999997138977,"connectEnd":556.3999996185303,"connectStart":556.3999996185303,"domainLookupEnd":556.3999996185303,"domainLookupStart":556.3999996185303,"fetchStart":252.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":556.6999998092651,"responseEnd":670.5,"responseStart":571.6999998092651,"secureConnectionStart":556.3999996185303},{"duration":572.5,"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":252.5,"connectEnd":252.5,"connectStart":252.5,"domainLookupEnd":252.5,"domainLookupStart":252.5,"fetchStart":252.5,"redirectEnd":0,"redirectStart":0,"requestStart":601.5,"responseEnd":825,"responseStart":620.1999998092651,"secureConnectionStart":252.5},{"duration":372,"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":252.69999980926514,"connectEnd":252.69999980926514,"connectStart":252.69999980926514,"domainLookupEnd":252.69999980926514,"domainLookupStart":252.69999980926514,"fetchStart":252.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":603.6999998092651,"responseEnd":624.6999998092651,"responseStart":623.3999996185303,"secureConnectionStart":252.69999980926514},{"duration":375.2000002861023,"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":252.89999961853027,"connectEnd":252.89999961853027,"connectStart":252.89999961853027,"domainLookupEnd":252.89999961853027,"domainLookupStart":252.89999961853027,"fetchStart":252.89999961853027,"redirectEnd":0,"redirectStart":0,"requestStart":603.8999996185303,"responseEnd":628.0999999046326,"responseStart":624.7999997138977,"secureConnectionStart":252.89999961853027},{"duration":375.2999997138977,"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":253,"connectEnd":253,"connectStart":253,"domainLookupEnd":253,"domainLookupStart":253,"fetchStart":253,"redirectEnd":0,"redirectStart":0,"requestStart":608.5999999046326,"responseEnd":628.2999997138977,"responseStart":625.5,"secureConnectionStart":253},{"duration":349.2999997138977,"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":256.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":256.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":605.3999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":372.2000002861023,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":256.3999996185303,"connectEnd":256.3999996185303,"connectStart":256.3999996185303,"domainLookupEnd":256.3999996185303,"domainLookupStart":256.3999996185303,"fetchStart":256.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":608.6999998092651,"responseEnd":628.5999999046326,"responseStart":626.1999998092651,"secureConnectionStart":256.3999996185303},{"duration":348.09999990463257,"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":257.7999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":257.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":605.8999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":371.19999980926514,"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":258.5,"connectEnd":258.5,"connectStart":258.5,"domainLookupEnd":258.5,"domainLookupStart":258.5,"fetchStart":258.5,"redirectEnd":0,"redirectStart":0,"requestStart":610.5999999046326,"responseEnd":629.6999998092651,"responseStart":628.6999998092651,"secureConnectionStart":258.5},{"duration":844.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":263.8999996185303,"connectEnd":263.8999996185303,"connectStart":263.8999996185303,"domainLookupEnd":263.8999996185303,"domainLookupStart":263.8999996185303,"fetchStart":263.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":908.5999999046326,"responseEnd":1108.3999996185303,"responseStart":1105.0999999046326,"secureConnectionStart":263.8999996185303},{"duration":1160,"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":263.8999996185303,"connectEnd":263.8999996185303,"connectStart":263.8999996185303,"domainLookupEnd":263.8999996185303,"domainLookupStart":263.8999996185303,"fetchStart":263.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":1410.5,"responseEnd":1423.8999996185303,"responseStart":1423.3999996185303,"secureConnectionStart":263.8999996185303},{"duration":291.40000009536743,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":810.7999997138977,"connectEnd":810.7999997138977,"connectStart":810.7999997138977,"domainLookupEnd":810.7999997138977,"domainLookupStart":810.7999997138977,"fetchStart":810.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":1027.0999999046326,"responseEnd":1102.1999998092651,"responseStart":1100.2999997138977,"secureConnectionStart":810.7999997138977},{"duration":367.30000019073486,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1117.7999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1117.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1485.0999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":338.19999980926514,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1141.6999998092651,"connectEnd":1141.6999998092651,"connectStart":1141.6999998092651,"domainLookupEnd":1141.6999998092651,"domainLookupStart":1141.6999998092651,"fetchStart":1141.6999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":1442.2999997138977,"responseEnd":1479.8999996185303,"responseStart":1479.0999999046326,"secureConnectionStart":1141.6999998092651}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":65,"responseStart":243,"responseEnd":254,"domLoading":247,"domInteractive":1530,"domContentLoadedEventStart":1531,"domContentLoadedEventEnd":1589,"domComplete":2171,"loadEventStart":2171,"loadEventEnd":2171,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1505.5999999046326},{"name":"bigPipe.sidebar-id.end","time":1506.3999996185303},{"name":"bigPipe.activity-panel-pipe-id.start","time":1506.5999999046326},{"name":"bigPipe.activity-panel-pipe-id.end","time":1508.5999999046326},{"name":"activityTabFullyLoaded","time":1609.5}],"measures":[],"correlationId":"2a296342e811d","effectiveType":"4g","downlink":9.6,"rtt":0,"serverDuration":104,"dbReadsTimeInMs":16,"dbConnsTimeInMs":25,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
I checked QC part looks OK, but I do not know how that madwise works, and failed test on github makes me doubting about allowing that changes