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

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