diff options
author | Aaron Plattner <aplattner@nvidia.com> | 2021-05-27 16:58:56 -0700 |
---|---|---|
committer | Olivier Fourdan <ofourdan@redhat.com> | 2022-07-01 10:02:16 +0200 |
commit | 891ea8f74d2bfae4e1edc082544fedee3220d3da (patch) | |
tree | 9db1bbdc2ffe5a9b2f5f0311b543852713221400 | |
parent | daaa9f056602e43b132f9e6e035cc54b6a1c96a3 (diff) |
os: print <signal handler called> if unw_is_signal_frame()
libunwind has a function to query whether the cursor points to a signal frame.
Use this to print
1: <signal handler called>
like GDB does, rather than printing something less useful such as
1: /usr/lib/libpthread.so.0 (funlockfile+0x60) [0x7f679838b870]
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
(cherry picked from commit a73641937a9e0df3a5d32f0dac7114d971abcd21)
-rw-r--r-- | os/backtrace.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/os/backtrace.c b/os/backtrace.c index 99d776950..bf7ee68e2 100644 --- a/os/backtrace.c +++ b/os/backtrace.c @@ -97,9 +97,14 @@ xorg_backtrace(void) else filename = "?"; - ErrorFSigSafe("%u: %s (%s%s+0x%x) [%p]\n", i++, filename, procname, - ret == -UNW_ENOMEM ? "..." : "", (int)off, - (void *)(uintptr_t)(ip)); + + if (unw_is_signal_frame(&cursor)) { + ErrorFSigSafe("%u: <signal handler called>\n", i++); + } else { + ErrorFSigSafe("%u: %s (%s%s+0x%x) [%p]\n", i++, filename, procname, + ret == -UNW_ENOMEM ? "..." : "", (int)off, + (void *)(uintptr_t)(ip)); + } ret = unw_step(&cursor); if (ret < 0) |