summaryrefslogtreecommitdiff
path: root/src/journal/coredump.c
diff options
context:
space:
mode:
authorUmut Tezduyar Lindskog <umut.tezduyar@axis.com>2014-07-08 16:16:14 +0200
committerLennart Poettering <lennart@poettering.net>2014-08-15 03:10:20 +0200
commit4d229b318af339c7a4711f3812335cb3ae6fb5aa (patch)
treedadf39a88e9ea51c34c200a17292d5c33c64ad29 /src/journal/coredump.c
parentd0a3fb7556d77c44c2bc38a560e99d4ad0abcf33 (diff)
coredump: display libdw fail string on stack trace fail
- systemd[1]: hello.service: main process exited, code= dumped, status=3/QUIT - systemd-coredump[2541]: Failed to generate stack trace: Unwinding not supported for this architecture - systemd-coredump[2541]: Process 1024 (hello) of user 154 dumped core.
Diffstat (limited to 'src/journal/coredump.c')
-rw-r--r--src/journal/coredump.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/journal/coredump.c b/src/journal/coredump.c
index db51098d9c..79f51d1590 100644
--- a/src/journal/coredump.c
+++ b/src/journal/coredump.c
@@ -26,6 +26,11 @@
#include <sys/types.h>
#include <sys/xattr.h>
+#ifdef HAVE_ELFUTILS
+# include <dwarf.h>
+# include <elfutils/libdwfl.h>
+#endif
+
#include "systemd/sd-journal.h"
#include "systemd/sd-login.h"
@@ -686,6 +691,8 @@ int main(int argc, char* argv[]) {
r = coredump_make_stack_trace(coredump_fd, exe, &stacktrace);
if (r >= 0)
core_message = strjoin("MESSAGE=Process ", info[INFO_PID], " (", comm, ") of user ", info[INFO_UID], " dumped core.\n\n", stacktrace, NULL);
+ else if (r == -EINVAL)
+ log_warning("Failed to generate stack trace: %s", dwfl_errmsg(dwfl_errno()));
else
log_warning("Failed to generate stack trace: %s", strerror(-r));
}