Richard Marko
2013-09-02 14:09:57 UTC
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-H+wXaHxf7aLQT0dZR+***@public.gmane.org>
---
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)
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-H+wXaHxf7aLQT0dZR+***@public.gmane.org>
---
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
1.8.3.1