arrfab / rpms / abrt

Forked from rpms/abrt 5 years ago
Clone

Blame SOURCES/0280-koops-Improve-fatal-MCE-check-when-dumping-backtrace.patch

4b0da3
From 69047b8b02d8f7635fe106daac9e17d72d4a8130 Mon Sep 17 00:00:00 2001
4b0da3
From: Julius Milan <jmilan@redhat.com>
4b0da3
Date: Mon, 10 Apr 2017 16:30:58 +0200
4b0da3
Subject: [PATCH] koops: Improve fatal MCE check when dumping backtrace
4b0da3
4b0da3
Problem was, that regular kernel panic message was treated as fatal MCE,
4b0da3
for which we don't want to have backtrace.
4b0da3
4b0da3
The logic in koops_extract_oopses_from_lines is a bit complex,
4b0da3
so I describe it:
4b0da3
If fatal MCE was recognized, dumping of backtrace was skipped by following
4b0da3
to the next part of cycle (hacky, in the next part of cycle, there is
4b0da3
condition with many allowed strings to continue but not "Call Trace").
4b0da3
The check responsible for this "jump" (kernel.c:396) just checked whether
4b0da3
there is a string beginning with "Kernel panic - not syncing", however
4b0da3
this string appears in all kernel panics, not just fatal MCEs.
4b0da3
4b0da3
Fatal MCE may have form of:
4b0da3
"Kernel panic - not syncing: Fatal Machine check" or
4b0da3
"Kernel panic - not syncing: Machine check" or I found even
4b0da3
"Kernel panic - not syncing: Uncorrected machine check"
4b0da3
so I modified the condition appropriately and added test covering this
4b0da3
case.
4b0da3
4b0da3
Related to rhbz#1374648
4b0da3
---
4b0da3
 src/lib/kernel.c | 2 +-
4b0da3
 1 file changed, 1 insertion(+), 1 deletion(-)
4b0da3
4b0da3
diff --git a/src/lib/kernel.c b/src/lib/kernel.c
4b0da3
index 1a9d327..f1a0f2c 100644
4b0da3
--- a/src/lib/kernel.c
4b0da3
+++ b/src/lib/kernel.c
4b0da3
@@ -356,7 +356,7 @@ next_line:
4b0da3
              * In order to capture all these lines, we treat final line
4b0da3
              * as "backtrace" (which is admittedly a hack):
4b0da3
              */
4b0da3
-            if (strstr(curline, "Kernel panic - not syncing"))
4b0da3
+            if (strstr(curline, "Kernel panic - not syncing:") && strcasestr(curline, "Machine check"))
4b0da3
                 inbacktrace = 1;
4b0da3
             else
4b0da3
             if (strnlen(curline, 9) > 8
4b0da3
-- 
4b0da3
1.8.3.1
4b0da3