diff --git a/backport-fix-for-sys-to-properly-display-the-PANIC-m.patch b/backport-fix-for-sys-to-properly-display-the-PANIC-m.patch new file mode 100644 index 0000000000000000000000000000000000000000..4806c89af3ea19778a846ca7ccbfa3cc17ac961a --- /dev/null +++ b/backport-fix-for-sys-to-properly-display-the-PANIC-m.patch @@ -0,0 +1,69 @@ +From db0077614aaeda6d0ed557f2b91d3349d5fe430f Mon Sep 17 00:00:00 2001 +From: Austin Kim +Date: Tue, 29 Oct 2024 17:32:07 +0900 +Subject: [PATCH] Fix for 'sys' to properly display the PANIC message + +Using 'sys' command, we can view the panic message with general system +information. If we run RISCV64-based vmcore, PANIC message is not properly +displayed. + +The reason is that the string "Unable to handle kernel" is not +completely matched with the panic_msg[]. The corresponding kernel commit +is 21733cb518471. + +Without the patch: + crash> sys + KERNEL: vmlinux [TAINTED] + DUMPFILE: vmcore + CPUS: 4 + DATE: Thu Aug 22 16:13:08 KST 2024 + UPTIME: 00:33:25 + LOAD AVERAGE: 0.07, 0.07, 0.02 + TASKS: 385 + NODENAME: starfive + RELEASE: 6.6.20+ + VERSION: #13 SMP Mon Aug 19 12:58:52 KST 2024 + MACHINE: riscv64 (unknown Mhz) + MEMORY: 4 GB + PANIC: "" + +With the patch: + crash> sys + KERNEL: vmlinux [TAINTED] + DUMPFILE: vmcore + CPUS: 4 + DATE: Thu Aug 22 16:13:08 KST 2024 + UPTIME: 00:33:25 + LOAD AVERAGE: 0.07, 0.07, 0.02 + TASKS: 385 + NODENAME: starfive + RELEASE: 6.6.20+ + VERSION: #13 SMP Mon Aug 19 12:58:52 KST 2024 + MACHINE: riscv64 (unknown Mhz) + MEMORY: 4 GB + PANIC: "Unable to handle kernel access to user memory without uaccess routines at virtual address 0000000000000000" + +Signed-off-by: Austin Kim + +Reference: https://github.com/crash-utility/crash/commit/db0077614aaeda6d0ed557f2b91d3349d5fe430f +Conflict: NA +--- + task.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/task.c b/task.c +index c131cc32..33de7da2 100644 +--- a/task.c ++++ b/task.c +@@ -6392,6 +6392,11 @@ get_panicmsg(char *buf) + get_symbol_data("sysrq_pressed", sizeof(int), &msg_found); + break; + } ++ ++ /* ++ * Try to search panic string in panic keywords ++ */ ++ search_panic_task_by_keywords(buf, &msg_found); + } + + found: diff --git a/crash.spec b/crash.spec index e61333a32082d6bfd35315698c8b533034e3e326..f314c5b868ad3c332ef788a9c250173408ffed27 100644 --- a/crash.spec +++ b/crash.spec @@ -1,6 +1,6 @@ Name: crash Version: 8.0.4 -Release: 15 +Release: 16 Summary: Linux kernel crash utility. License: GPLv3 URL: https://crash-utility.github.io @@ -16,6 +16,7 @@ Patch5: 0005-gdb-ignore-Wenum-constexpr-conversion-in-enum-flags.patch Patch6: 0006-arm64-fix-a-potential-segfault-when-unwind-frame.patch Patch7: 0007-arm64-fix-SDEI-stack-frame-unwind-while-UNW_4_14-is-.patch Patch8: 0008-Fix-segmentation-fault-in-value_search_module_6_4.patch +Patch9: backport-fix-for-sys-to-properly-display-the-PANIC-m.patch Patch9001: huawei-fix-ps-error-when-mm_struct.rss_stat-is-lazy-initial.patch BuildRequires: ncurses-devel zlib-devel lzo-devel snappy-devel texinfo libzstd-devel @@ -65,6 +66,7 @@ created by manufacturer-specific firmware. %patch 6 -p1 %patch 7 -p1 %patch 8 -p1 +%patch 9 -p1 %patch 9001 -p1 %build @@ -100,6 +102,9 @@ install -D -m 0644 defs.h %{buildroot}%{_includedir}/%{name}/defs.h %{_mandir}/man8/crash.8* %changelog +* Fri Aug 01 2025 wangxiao - 8.0.4-16 +- backport fix for 'sys' to properly display the PANIC message patch + * Fri Jun 13 2025 wangxiao - 8.0.4-15 - remove the arch judgment, include all patches in the src package - use patch command to apply patches for consistency in context