Bug #41715 core-file-size parameter is ignored on some os
Submitted: 23 Dec 2008 14:39 Modified: 28 Sep 2010 14:21
Reporter: Oli Sennhauser Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server Severity:S4 (Feature request)
Version:any OS:Any
Assigned to: CPU Architecture:Any

[23 Dec 2008 14:39] Oli Sennhauser
Description:
When solving mysqld crashes core dump files are a big help. The parameter

[mysqld_safe]
core-file-size=unlimited

sets the ulimit of the core files in mysqld_safe from ZERO (= no core files) to some value.

Many Linux kernels (for example debian) will not dump core files if the process is not running as the same user who started it. This is often the case (most of mysql users are starting the mysqld_safe as root and switching to mysql).

So one has either to change the user the database is starting (root -> mysql) or the database has to be run as root (security!)

Many opportunities to get proper core files in this case got lost.

How to repeat:
start database with parameter above an kill mysqld process for example with -11.

Suggested fix:
It would be nice if the core-file-size parameter is passed to the mysqld process instead of being executed by the mysqld_safe.

This would IMHO solve this problem.

"A  process  can set its soft RLIMIT_CORE resource limit to place an upper limit on the size of the core dump file that will be produced if it receives a "core dump" signal; see getrlimit(2) for details."
[25 Dec 2009 17:47] Valeriy Kravchuk
Doesn't the following trick

sysctl -w fs.suid_dumpable=2

solve the problem of dumping core for programs like mysqld started in the way you had described?
[28 Dec 2009 8:02] Oli Sennhauser
Hi Valeriy,

Yes it does. See also here:

  http://www.shinguz.ch/MySQL/mysql_hunting_the_core.html

In my opinion changing kernel parameters is the wrong approach. It affects all applications running on your server and changes the default behaviour.

IMHO passing the parameters correctly would be the right approach.

Oli
[26 Jan 2010 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[28 Sep 2010 14:21] Susanne Ebrecht
Many thanks for a reasonable feature request.