about summary refs log tree commit diff
path: root/sysdeps/generic/segfault.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/generic/segfault.c')
-rw-r--r--sysdeps/generic/segfault.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sysdeps/generic/segfault.c b/sysdeps/generic/segfault.c
index 090f91a657..0d4be93837 100644
--- a/sysdeps/generic/segfault.c
+++ b/sysdeps/generic/segfault.c
@@ -136,6 +136,10 @@ catch_segfault (int signal, SIGCONTEXT ctx)
       current = current->next;
     }
 
+  /* If the last return address was NULL, assume that it doesn't count.  */
+  if (arr[cnt-1] == NULL)
+    cnt--;
+
   /* Now generate nicely formatted output.  */
   __backtrace_symbols_fd (arr, cnt, fd);