Compare commits

...
Author SHA1 Message Date
openeuler-ci-bot 5339677e07 !169 Fix for 'sys' to properly display the PANIC message
From: @lliuzhi 
Reviewed-by: @dillon_chen 
Signed-off-by: @dillon_chen
2025-07-16 02:52:20 +00:00
liuzhilin 1f5422d4e0 Fix for 'sys' to properly display the PANIC message 2025-07-16 10:13:42 +08:00
openeuler-ci-bot 212a160214 !162 use patch command to apply patches for consistency in context
From: @wangxiao65 
Reviewed-by: @wangbin224 
Signed-off-by: @wangbin224
2025-06-12 10:56:08 +00:00
wangxiao65 6b2a64b805 use patch command to apply patches for consistency in context 2025-06-10 08:50:27 +08:00
openeuler-ci-bot c796f06fd0 !161 fix ps error when mm_struct.rss_stat is not initialized
From: @mszjaas 
Reviewed-by: @dillon_chen 
Signed-off-by: @dillon_chen
2025-05-21 06:03:33 +00:00
zhangjian bc29223016 fix ps error when mm_struct.rss_stat is not initialized
Signed-off-by: zhangjian <zhangjian496@huawei.com>
2025-05-21 02:10:51 +00:00
3 changed files with 114 additions and 6 deletions
@@ -0,0 +1,66 @@
From db0077614aaeda6d0ed557f2b91d3349d5fe430f Mon Sep 17 00:00:00 2001
From: Austin Kim <austindh.kim@gmail.com>
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 <austindh.kim@gmail.com>
---
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:
+20 -6
View File
@@ -1,6 +1,6 @@
Name: crash
Version: 8.0.5
Release: 6
Release: 9
Summary: Linux kernel crash utility.
License: GPLv3
URL: https://crash-utility.github.io
@@ -9,14 +9,14 @@ Source1: http://ftp.gnu.org/gnu/gdb/gdb-10.2.tar.gz
Patch0: 0000-lzo_snappy.patch
Patch1: 0001-add-SDEI-stack-resolution.patch
## %ifarch sw_64
Patch2: 0002-crash-8.0.2-sw.patch
## %endif
## %ifarch loongarch64
Patch3: 0003-crash-8.0.4-add-support-for-loongarch64.patch
## %endif
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,7 +59,12 @@ created by manufacturer-specific firmware.
%patch 3 -p1
%endif
%autopatch -m4 -p1
%patch 4 -p1
%patch 5 -p1
%patch 9001 -p1
%ifarch riscv64
%patch 6 -p1
%endif
%build
cp %{SOURCE1} .
@@ -94,6 +99,15 @@ install -D -m 0644 defs.h %{buildroot}%{_includedir}/%{name}/defs.h
%{_mandir}/man8/crash.8*
%changelog
* Mon Jul 14 2025 liuzhilin <liuzhilin@kylinos.cn> - 8.0.5-9
- backport Fix for 'sys' to properly display the PANIC message patch.
* Wed Jun 04 2025 wangxiao <wangxiao184@h-partners.com> - 8.0.5-8
- use patch command to apply patches for consistency in context
* Wed May 21 2025 zhangjian <zhangjian496@huawei.com> - 8.0.5-7
- fix ps error when mm_struct.rss_stat is lazy initialized
* Wed Dec 04 2024 yangzhenyu <dev11101@linx-info.com> - 8.0.5-6
- remove the architecture judgment in the patches section;
- include all patches in the source package.
@@ -0,0 +1,28 @@
From 45052609f61d5d4ee8286d0d6098e53ea6b199a9 Mon Sep 17 00:00:00 2001
From: zhangjian <zhangjian496@huawei.com>
Date: Wed, 21 May 2025 02:08:12 +0000
Subject: [PATCH] tmp
---
tools.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tools.c b/tools.c
index 0f2db10..727a12c 100644
--- a/tools.c
+++ b/tools.c
@@ -6955,6 +6955,11 @@ percpu_counter_sum_positive(ulong fbc)
readmem(fbc + OFFSET(percpu_counter_counters), KVADDR, &addr,
sizeof(void *), "percpu_counter.counters", FAULT_ON_ERROR);
+ /* maybe mm_struct.rss_stat is lazy initialized */
+ if (!addr) {
+ return ret;
+ }
+
for (i = 0; i < kt->cpus; i++) {
readmem(addr + kt->__per_cpu_offset[i], KVADDR, &count,
sizeof(int), "percpu_counter.counters count", FAULT_ON_ERROR);
--
2.33.0