summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Plattner <aplattner@nvidia.com>2021-05-27 16:58:56 -0700
committerOlivier Fourdan <ofourdan@redhat.com>2022-07-01 10:02:16 +0200
commit891ea8f74d2bfae4e1edc082544fedee3220d3da (patch)
tree9db1bbdc2ffe5a9b2f5f0311b543852713221400
parentdaaa9f056602e43b132f9e6e035cc54b6a1c96a3 (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.c11
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)