Link against libcwd to add file-name/line-number information to the backtrace and remove the dependency on -rdynamic
Or better, use addr2line to obtain that information when showing the backtrace when catched within Daemon (addr2line -fsiCe argv[0]
)
Add signal handlers for the bad signals which writes a backtrace to stderr and terminates. This should probably write out a raw backtrace without de-mangling or line-numbers since we don't want to mess with dynamic memory when the heap might be corrupted ... Another handler for e.g. SIGUSR2 is nice to show a debug backtrace on demand