rgerhards wrote:dlang wrote:I never get a chance to do anything like this. I do "rsyslogd -c3 -d" and a bunch of text scrolls by, with the segfault error at the bottom.
This is to be done AFTER the segault. Once it aborts, you get a core file (if not, set ulimit -c 99999999999). That core file should reside in the root directory. Then call gdb:
gdb /path/to/rsyslogd
core /core.whatever
bt
threads
{manually do}
thread n
bt
{for each thread you see}
threads doesn't work as a command (sorry, I don't have experiance with gdb)
This GDB was configured as "x86_64-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".
Reading symbols from /usr/lib/libz.so.1...done.
Loaded symbols for /usr/lib/libz.so.1
Reading symbols from /lib/libpthread.so.0...done.
Loaded symbols for /lib/libpthread.so.0
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /lib/librt.so.1...done.
Loaded symbols for /lib/librt.so.1
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux-x86-64.so.2...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Reading symbols from /usr/local/lib/rsyslog/lmnet.so...done.
Loaded symbols for /usr/local/lib/rsyslog/lmnet.so
Reading symbols from /lib/libnss_files.so.2...done.
Loaded symbols for /lib/libnss_files.so.2
Reading symbols from /usr/local/lib/rsyslog/immark.so...done.
Loaded symbols for /usr/local/lib/rsyslog/immark.so
Reading symbols from /usr/local/lib/rsyslog/imuxsock.so...done.
Loaded symbols for /usr/local/lib/rsyslog/imuxsock.so
Reading symbols from /usr/local/lib/rsyslog/imudp.so...done.
Loaded symbols for /usr/local/lib/rsyslog/imudp.so
Reading symbols from /usr/local/lib/rsyslog/imklog.so...done.
Loaded symbols for /usr/local/lib/rsyslog/imklog.so
Reading symbols from /lib/libnss_compat.so.2...done.
Loaded symbols for /lib/libnss_compat.so.2
Reading symbols from /lib/libnsl.so.1...done.
Loaded symbols for /lib/libnsl.so.1
Reading symbols from /lib/libnss_nis.so.2...done.
Loaded symbols for /lib/libnss_nis.so.2
Failed to read a valid object file image from memory.
Core was generated by `tools/rsyslogd -c3 -d'.
Program terminated with signal 6, Aborted.
#0 0x00007fb6849d807b in raise () from /lib/libc.so.6
(gdb) bt
#0 0x00007fb6849d807b in raise () from /lib/libc.so.6
#1 0x00007fb6849d984e in abort () from /lib/libc.so.6
#2 0x000000000041b079 in sigsegvHdlr (signum=11) at debug.c:759
#3 <signal handler called>
#4 0x0000000000418d67 in getCurrTime (t=0x7fb683f00a90, ttSeconds=0x7fb6843901ca) at datetime.c:92
#5 0x00007fb68438e44f in enqMsg (msg=0x7fff8d130f30 "imklog 3.21.5, log source = /proc/kmsg started.",
pszTag=0x7fb6843901c2 "kernel:", iFacility=0, iSeverity=<value optimized out>) at imklog.c:109
#6 0x00007fb68438e623 in imklogLogIntMsg (priority=6, fmt=<value optimized out>) at imklog.c:171
#7 0x00007fb68438e75e in klogWillRun () at linux.c:154
#8 0x000000000040b3fc in init () at syslogd.c:2230
#9 0x000000000040bc48 in mainThread () at syslogd.c:2854
#10 0x000000000040ce02 in realMain (argc=<value optimized out>, argv=0x7fff8d133dd8) at syslogd.c:3506
#11 0x00007fb6849c54ca in __libc_start_main () from /lib/libc.so.6
#12 0x000000000040931a in _start () at ../sysdeps/x86_64/elf/start.S:113
(gdb) threads
Undefined command: "threads". Try "help".
(gdb) help
List of classes of commands:
aliases -- Aliases of other commands
breakpoints -- Making program stop at certain points
data -- Examining data
files -- Specifying and examining files
internals -- Maintenance commands
obscure -- Obscure features
running -- Running the program
stack -- Examining the stack
status -- Status inquiries
support -- Support facilities
tracepoints -- Tracing of program execution without stopping the program
user-defined -- User-defined commands
Type "help" followed by a class name for a list of commands in that class.
Type "help" followed by command name for full documentation.
Command name abbreviations are allowed if unambiguous.


