If you have trouble getting a core, an easy way should be to attach to existing lmtp process:
- telnet localhost <lmtp port> quit
- gdb -p
pidof lmtp
cont- make it crash
- gdb: bt full
Not sure I'm doing this correctly. Core Dumps seem to be disabled in my vanilla Kernel. Running 'gdb' also seems not to produce the result wanted. As long as GDB is attached it does not crash the 'lmtp' process, only when I quit the debugger.
Feb 28 16:51:18 spectre dovecot: lmtp(17782): Disconnect from 188.138.0.199: Client quit
[16:50] root spectre:~# gdb -p 17782 GNU gdb 6.8-debian Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Attaching to process 17782 Reading symbols from /usr/lib/dovecot/lmtp...(no debugging symbols found)...done. Reading symbols from /usr/lib/dovecot/libdovecot-storage.so.0...(no debugging symbols found)...done. Loaded symbols for /usr/lib/dovecot/libdovecot-storage.so.0 Reading symbols from /usr/lib/dovecot/libdovecot.so.0...(no debugging symbols found)...done. Loaded symbols for /usr/lib/dovecot/libdovecot.so.0 Reading symbols from /lib/libdl.so.2...(no debugging symbols found)...done. Loaded symbols for /lib/libdl.so.2 Reading symbols from /lib/librt.so.1...(no debugging symbols found)...done. Loaded symbols for /lib/librt.so.1 Reading symbols from /lib/libc.so.6...(no debugging symbols found)...done. Loaded symbols for /lib/libc.so.6 Reading symbols from /lib/ld-linux-x86-64.so.2... (no debugging symbols found)...done. Loaded symbols for /lib64/ld-linux-x86-64.so.2 Reading symbols from /lib/libpthread.so.0...(no debugging symbols found)...done. [Thread debugging using libthread_db enabled] [New Thread 0x7f30067dd6e0 (LWP 17782)] Loaded symbols for /lib/libpthread.so.0 Reading symbols from /lib/libnss_files.so.2...(no debugging symbols found)...done. Loaded symbols for /lib/libnss_files.so.2 Reading symbols from /usr/lib/dovecot/modules/lib10_quota_plugin.so...(no debugging symbols found)...done. Loaded symbols for /usr/lib/dovecot/modules/lib10_quota_plugin.so Reading symbols from /usr/lib/dovecot/modules/lib90_sieve_plugin.so...(no debugging symbols found)...done. Loaded symbols for /usr/lib/dovecot/modules/lib90_sieve_plugin.so Reading symbols from /usr/lib/dovecot/libdovecot-sieve.so.0...(no debugging symbols found)...done. Loaded symbols for /usr/lib/dovecot/libdovecot-sieve.so.0
(no debugging symbols found) 0x00007f3005a07b23 in epoll_wait () from /lib/libc.so.6 (gdb) cont Continuing.
Program received signal SIGINT, Interrupt. [Switching to Thread 0x7f30067dd6e0 (LWP 17782)] 0x00007f3005a07b23 in epoll_wait () from /lib/libc.so.6
(gdb) bt full #0 0x00007f3005a07b23 in epoll_wait () from /lib/libc.so.6 No symbol table info available. #1 0x00007f30060d9abb in io_loop_handler_run () from /usr/lib/dovecot/libdovecot.so.0 No symbol table info available. #2 0x00007f30060d8ca8 in io_loop_run () from /usr/lib/dovecot/libdovecot.so.0 No symbol table info available. #3 0x00007f30060c8eb3 in master_service_run () from /usr/lib/dovecot/libdovecot.so.0 No symbol table info available. #4 0x0000000000405b02 in main () No symbol table info available.
==> /var/log/dovecot.info <== Feb 28 16:58:30 spectre dovecot: master: service(lmtp): child 17782 killed with signal 11 (core not dumped)