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..0225b1acf885ea74fda7411b91b65cc9e77b347f --- /dev/null +++ b/backport-fix-for-sys-to-properly-display-the-PANIC-m.patch @@ -0,0 +1,66 @@ +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 +--- + 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 72cb9bfbff57ca6b7414a6c3eace76ed0c87763e..8ce11e91eef52f1935a30f7c6d05e4efb5922f40 100644 --- a/crash.spec +++ b/crash.spec @@ -1,6 +1,6 @@ Name: crash Version: 8.0.5 -Release: 8 +Release: 9 Summary: Linux kernel crash utility. License: GPLv3 URL: https://crash-utility.github.io @@ -14,6 +14,9 @@ Patch3: 0003-crash-8.0.4-add-support-for-loongarch64.patch Patch4: 0004-arm64-fix-a-potential-segfault-when-unwind-frame.patch Patch5: 0005-arm64-fix-SDEI-stack-frame-unwind-while-UNW_4_14-is-.patch Patch9001: huawei-fix-ps-error-when-mm_struct.rss_stat-is-lazy-initial.patch +%ifarch riscv64 +Patch6: backport-fix-for-sys-to-properly-display-the-PANIC-m.patch +%endif BuildRequires: ncurses-devel zlib-devel lzo-devel snappy-devel texinfo libzstd-devel BuildRequires: gcc gcc-c++ bison m4 @@ -59,6 +62,9 @@ created by manufacturer-specific firmware. %patch 4 -p1 %patch 5 -p1 %patch 9001 -p1 +%ifarch riscv64 +%patch 6 -p1 +%endif %build cp %{SOURCE1} . @@ -93,6 +99,9 @@ install -D -m 0644 defs.h %{buildroot}%{_includedir}/%{name}/defs.h %{_mandir}/man8/crash.8* %changelog +* Mon Jul 14 2025 liuzhilin - 8.0.5-9 +- backport Fix for 'sys' to properly display the PANIC message patch. + * Wed Jun 04 2025 wangxiao - 8.0.5-8 - use patch command to apply patches for consistency in context