Debian Codegraph @

doc/html/_sources/imap/reference/faqs/o-coredump.rst.txt

raw
1 .. _faqs-o-coredump:
2
3 How to enable core dumps
4 ------------------------
5
6 In case of abnormal program termination, Cyrus automatically writes core dumps in the subdirectory cores in the configdirectory. However, for security reasons most Linux systems disable core dumps for processes that changed ownership, and Cyrus will silently abort the save attempt.
7
8 To make sure that core dumps are enabled for debugging, please:
9
10 Make sure that cores contain the PID of the process.
11
12 .. code-block:: bash
13
14 # echo 1 >/proc/sys/kernel/core_uses_pid
15
16 As a security feature, Linux won't generate cores for processes which have changed ownership. This prevents any of the Cyrus processes in your test ever dumping core, so you want to turn that feature off.
17
18 .. code-block:: bash
19
20 # echo 1 >/proc/sys/fs/suid_dumpable
21
22 Finally, some Linux systems might require to unlimit the size of core dumps.
23
24 .. code-block:: bash
25
26 # ulimit -c unlimited
27
28 Then you can fire up gdb:
29
30 .. code-block:: bash
31
32 gdb /usr/local/cyrus/lmtpd /tmp/core.XXX  (use proper locations)
33
34 At the (gdb) prompt run the backtrace command (``bt``).
35
36 .. warning::
37
38 These parameters are disabled for a reason and should only be used for debugging. We do not recommend to regularly enable setuid cores and unlimited core sizes on production systems.