[PATCH 3/3] Short BT deduplication false positives workaround

Martin Milata mmilata at redhat.com
Fri May 10 14:07:30 UTC 2013


Whenever backtraces that are shorter or equal than two frames are
checked for duplicity, fall back to full comparison. This should prevent
the current behaviour that two one-frame backtraces are always
duplicates regardless of the frame content.

Fixes abrt/btparser#6.

Signed-off-by: Martin Milata <mmilata at redhat.com>
---
 src/daemon/abrt-handle-event.c | 15 ++++++++++++++-
 src/include/satyr-compat.h     |  7 +++++++
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/src/daemon/abrt-handle-event.c b/src/daemon/abrt-handle-event.c
index 92e2c8f..521a7e1 100644
--- a/src/daemon/abrt-handle-event.c
+++ b/src/daemon/abrt-handle-event.c
@@ -42,13 +42,26 @@ static int core_backtrace_is_duplicate(struct sr_core_stacktrace *bt1,
     struct sr_core_thread *thread1 = sr_core_stacktrace_find_crash_thread(bt1);
     struct sr_core_thread *thread2 = sr_core_stacktrace_find_crash_thread(bt2);
 
-    if (sr_core_thread_get_frame_count(thread2) <= 0)
+    int length1 = sr_core_thread_get_frame_count(thread1);
+    int length2 = sr_core_thread_get_frame_count(thread2);
+
+    if (length2 <= 0)
     {
         VERB1 log("Core backtrace has zero frames, considering it not duplicate");
         result = 0;
         goto end;
     }
 
+    /* This is an ugly workaround for https://github.com/abrt/btparser/issues/6 */
+#ifndef USE_SATYR
+    if (length1 <= 2 || length2 <= 2)
+    {
+        VERB1 log("Backtraces too short, falling back on full comparison");
+        result = (sr_core_thread_cmp(thread1, thread2) == 0);
+        goto end;
+    }
+#endif
+
     float distance = sr_distance_core(SR_DISTANCE_DAMERAU_LEVENSHTEIN,
                                       thread1, thread2);
 
diff --git a/src/include/satyr-compat.h b/src/include/satyr-compat.h
index ad05dbd..23f6bb7 100644
--- a/src/include/satyr-compat.h
+++ b/src/include/satyr-compat.h
@@ -96,6 +96,13 @@ sr_core_thread_get_frame_count(struct sr_core_thread *thread)
     return btp_thread_get_frame_count(thread);
 }
 
+int
+sr_core_thread_cmp(struct sr_core_thread *thread1,
+                   struct sr_core_thread *thread2)
+{
+    return btp_thread_cmp(thread1, thread2);
+}
+
 float
 sr_distance_core(enum sr_distance_type distance_type,
                  struct sr_core_thread *thread1,
-- 
1.7.11.7



More information about the Crash-catcher mailing list