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