[ABRT PATCH] abrt-handle-event: don't crash on duplicate detection, rhbz#1001894

Richard Marko rmarko at redhat.com
Mon Sep 2 14:09:57 UTC 2013


This prevents abrt-handle-event from crashing when
satyr is unable to get crash thread of one of the
backtraces (e.g. when processing failure results in
core_backtrace file with no threads at all).

Signed-off-by: Richard Marko <rmarko at redhat.com>
---
 src/daemon/abrt-handle-event.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/daemon/abrt-handle-event.c b/src/daemon/abrt-handle-event.c
index e104cb7..fc0e0ea 100644
--- a/src/daemon/abrt-handle-event.c
+++ b/src/daemon/abrt-handle-event.c
@@ -62,6 +62,15 @@ static int core_backtrace_is_duplicate(struct sr_stacktrace *bt1,
     struct sr_thread *thread1 = sr_stacktrace_find_crash_thread(bt1);
     struct sr_thread *thread2 = sr_stacktrace_find_crash_thread(bt2);
 
+    /* sr_stacktrace_find_crash_thread may return NULL if core backtrace is not generated properly
+     * which probably means there's a bug somewhere in satyr
+     */
+    if (thread1 == NULL || thread2 == NULL)
+    {
+        VERB1 log("Unable to find crash thread of one of the backtraces, considering it not duplicate");
+        return 0;
+    }
+
     int length2 = sr_thread_frame_count(thread2);
 
     if (length2 <= 0)
-- 
1.8.3.1



More information about the Crash-catcher mailing list