Discussion:
[ABRT PATCH] abrt-handle-event: don't crash on duplicate detection, rhbz#1001894
Richard Marko
2013-09-02 14:09:57 UTC
Permalink
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)
--
1.8.3.1
Jakub Filak
2013-09-09 07:32:05 UTC
Permalink
Hmm, I've already sent a patch fixing this particular bug
https://lists.fedorahosted.org/pipermail/crash-catcher/2013-August/005276.html
Post by Richard Marko
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).
---
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)
Richard Marko
2013-09-09 13:50:36 UTC
Permalink
Missed that one.. Pushed your patches, please ignore this one.
Post by Jakub Filak
Hmm, I've already sent a patch fixing this particular bug
https://lists.fedorahosted.org/pipermail/crash-catcher/2013-August/005276.html
Post by Richard Marko
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).
---
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)
--
Richard Marko
Loading...