diff --git a/crash.spec b/crash.spec index 6bd14448a538104c595c2904b4786f3897eed448..73c3826dd411ac74097096b1e09a251d9cee90dc 100644 --- a/crash.spec +++ b/crash.spec @@ -1,6 +1,6 @@ Name: crash Version: 8.0.5 -Release: 6 +Release: 7 Summary: Linux kernel crash utility. License: GPLv3 URL: https://crash-utility.github.io @@ -17,6 +17,7 @@ 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 BuildRequires: ncurses-devel zlib-devel lzo-devel snappy-devel texinfo libzstd-devel BuildRequires: gcc gcc-c++ bison m4 @@ -94,6 +95,9 @@ install -D -m 0644 defs.h %{buildroot}%{_includedir}/%{name}/defs.h %{_mandir}/man8/crash.8* %changelog +* Wed May 21 2025 zhangjian - 8.0.5-7 +- fix ps error when mm_struct.rss_stat is lazy initialized + * Wed Dec 04 2024 yangzhenyu - 8.0.5-6 - remove the architecture judgment in the patches section; - include all patches in the source package. diff --git a/huawei-fix-ps-error-when-mm_struct.rss_stat-is-lazy-initial.patch b/huawei-fix-ps-error-when-mm_struct.rss_stat-is-lazy-initial.patch new file mode 100644 index 0000000000000000000000000000000000000000..e0f5d71c26ea384f42d350f1c23ee1dba6315442 --- /dev/null +++ b/huawei-fix-ps-error-when-mm_struct.rss_stat-is-lazy-initial.patch @@ -0,0 +1,28 @@ +From 45052609f61d5d4ee8286d0d6098e53ea6b199a9 Mon Sep 17 00:00:00 2001 +From: zhangjian +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 +