[Crash-utility] [PATCH] Fix warning about kernel version inconsistency during crash startup

Lianbo Jiang lijiang at redhat.com
Fri Jul 21 04:36:18 UTC 2023


Currently, the symbol ".rodata" may not be found in some vmlinux, and
the strings command will still be used to get the linux banner string,
but this gets two strings as below:

  # strings /usr/lib/debug/usr/lib/modules/6.5.0-0.rc2.17.fc39.x86_64/vmlinux |grep  "Linux version"
  Linux version 6.5.0-0.rc2.17.fc39.x86_64 (mockbuild at 23a79bad375e4c2c8c60f2d40df7df49) (gcc (GCC) 13.1.1 20230614 (Red Hat 13.1.1-4), GNU ld version 2.40-9.fc39) # SMP PREEMPT_DYNAMIC
  Linux version 6.5.0-0.rc2.17.fc39.x86_64 (mockbuild at 23a79bad375e4c2c8c60f2d40df7df49) (gcc (GCC) 13.1.1 20230614 (Red Hat 13.1.1-4), GNU ld version 2.40-9.fc39) #1 SMP PREEMPT_DYNAMIC Mon Jul 17 14:57:35 UTC 2023

In the verify_namelist(), the while-loop will only determine if the
above first string(linux banner) matches and break the loop. But
actually the above second string is correct one. Eventually, crash
startup with the following warning:

  # ./crash -s /usr/lib/debug/usr/lib/modules/6.5.0-0.rc2.17.fc39.x86_64/vmlinux /var/crash/127.0.0.1-2023-07-20-20\:50\:50/vmcore
  WARNING: kernel version inconsistency between vmlinux and dumpfile

  # ./crash -s
  WARNING: kernel version inconsistency between vmlinux and live memory

Let's always try to match the correct one, otherwise still prints a
warning as before.

Signed-off-by: Lianbo Jiang <lijiang at redhat.com>
---
 kernel.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/kernel.c b/kernel.c
index 546eed95eebd..9801812387bd 100644
--- a/kernel.c
+++ b/kernel.c
@@ -1375,8 +1375,6 @@ verify_namelist()
 				buffer3[i++] = *p1++;
 			buffer3[i] = NULLCHAR;
 		}
-
-		break;
         }
         pclose(pipe);
 
-- 
2.37.1



More information about the Crash-utility mailing list