Re: [PATCH] symbols: redetermine the end of kernel range for in_ksymbol_range
by lijiang
On Wed, Feb 26, 2025 at 12:53 PM <devel-request(a)lists.crash-utility.osci.io>
wrote:
> Date: Wed, 26 Feb 2025 17:51:21 +1300
> From: Tao Liu <ltao(a)redhat.com>
> Subject: [Crash-utility] [PATCH] symbols: redetermine the end of
> kernel range for in_ksymbol_range
> To: devel(a)lists.crash-utility.osci.io
> Cc: k-hagio-ab(a)nec.com, Tao Liu <ltao(a)redhat.com>
> Message-ID: <20250226045121.16717-1-ltao(a)redhat.com>
> Content-Type: text/plain; charset="US-ASCII"; x-default=true
>
> For in_ksymbol_range(), it determine the kernel range by
> st->symtable[0].value
> as the start and st->symtable[st->symcnt-1].value as the end, this
> however, implies the last element is in the kernel range. In most
> cases it was correct, but it is no longer valid with the kernel commit [1].
>
> The xen_elfnote_phys32_entry_value introduced by [1], is beyound the kernel
> range(doesn't belong to any kernel section), thus doesn't get relocated
> by relocate(). So in order to have a correct in_ksymbol_range(), we need
> to eliminate those symbols.
>
>
Applied:
https://github.com/crash-utility/crash/commit/25828e83d5f8990598dde584092...
Thanks
Lianbo
> Without the patch:
> crash> sym schedule
> ffffffff973ffb30 (T) schedule /root/linux-6.14-rc3/kernel/sched/core.c:
> 6848
> crash> sym 0xffffffff973ffb30
> sym: invalid address: 0xffffffff973ffb30
>
> With the patch:
> crash> sym schedule
> ffffffff973ffb30 (T) schedule /root/linux-6.14-rc3/kernel/sched/core.c:
> 6848
> crash> sym 0xffffffff973ffb30
> ffffffff973ffb30 (T) schedule /root/linux-6.14-rc3/kernel/sched/core.c:
> 6848
>
> [1]:
> https://github.com/torvalds/linux/commit/223abe96ac0d227b22d48ab447dd9384...
>
> Signed-off-by: Tao Liu <ltao(a)redhat.com>
> ---
> v2 -> v1: In fact the gnu_qsort() does sort the symbols with no
> problem, unlike the root cause described in v1. It's because
> xen_elfnote_phys32_entry_value doesn't belong to any kernel
> section, so the
> symval >= st->first_section_start && symval <=
> st->last_section_end
> check will not success in relocate(), so the symbol is not
> relocated.
> But I'm not sure if xen_elfnote_phys32_entry_value should be
> relocated or not, it looks to be an absoluate symbol to me,
> but the code comment is not very clear...
> v1 patch:
> https://www.mail-archive.com/devel@lists.crash-utility.osci.io/msg01373.html
> v1 discussion:
> https://www.mail-archive.com/devel@lists.crash-utility.osci.io/msg01378.html
> ---
> ---
> symbols.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/symbols.c b/symbols.c
> index 6385d02..edbafa4 100644
> --- a/symbols.c
> +++ b/symbols.c
> @@ -5443,8 +5443,14 @@ old_module:
> int
> in_ksymbol_range(ulong value)
> {
> + int i;
> + for (i = st->symcnt-1; i >= 0; i--) {
> + if (!strstr(st->symtable[i].name, "xen_elfnote"))
> + break;
> + }
> +
> if ((value >= st->symtable[0].value) &&
> - (value <= st->symtable[st->symcnt-1].value)) {
> + (value <= st->symtable[i].value)) {
> if ((st->flags & PERCPU_SYMS) && (value <
> st->first_ksymbol))
> return FALSE;
> else
> --
> 2.47.0
>
4 weeks, 1 day
[PATCH v2 0/4] Add cross compilation and CI build
by Lianbo Jiang
The patchset will add cross compilation and CI build
for crash-utility, includes four patches:
[1] [PATCH 1/4] sparc64: fix build failure
[2] [PATCH 2/4] gdb:disable building gdbserver in crash-utility
This will speed up crash building and save time, also avoid
some compilation issues, the [3] and [4] will benefit from
this one.
[3] [PATCH 3/4] Add cross compilation support
E.g: cross build crash-utility for aarch64 on X86_64
make CROSS_COMPILE=aarch64-linux-gnu- -j`nproc`
or
make CROSS_COMPILE=aarch64-linux-gnu- -j`nproc` warn
Note: there are still some limitations for cross
compilation because some dependency libs that are not
cross-compiled, for example: snappy, lzo, zstd
[4] [PATCH 4/4] Add ci-build.yml
Add a CI build and enable it on multiple arches, which can
check for compilation issues and also reduce some maintaince
workload.
Please refer to the result of CI build:
https://github.com/lian-bo/crash/actions/runs/13895225118
v1->v2:
[PATCH 0-3]: No changes, just rebased on gdb-16.2
[PATCH 4]: The gdb-16.2 has the dependency of gmp and mpfr libs, so need
to cross compile them before cross compile crash-utility.
Lianbo Jiang (3):
sparc64: fix build failure
gdb:disable building gdbserver in crash-utility
Add cross compilation support
lian-bo (1):
Add ci-build.yml
.github/workflows/ci-build.yml | 93 ++++++++++++++++++++++++++++++++++
Makefile | 50 +++++++++++++++++-
README | 5 ++
configure.c | 6 +++
defs.h | 2 +-
gdb-16.2.patch | 12 +++++
help.c | 5 ++
7 files changed, 170 insertions(+), 3 deletions(-)
create mode 100644 .github/workflows/ci-build.yml
--
2.47.1
1 month, 1 week
[PATCH] .gitignore: add gdb-16.2 directory
by Lianbo Jiang
Signed-off-by: Lianbo Jiang <lijiang(a)redhat.com>
---
.gitignore | 1 +
1 file changed, 1 insertion(+)
diff --git a/.gitignore b/.gitignore
index f391c5d340f9..6b8bd6dd3cae 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,6 +12,7 @@ crash.spec
gdb.files
gdb-7.6/
gdb-10.2/
+gdb-16.2/
extensions/defs.h
extensions/*.so
extensions/eppic
--
2.47.1
1 month, 1 week
[PATCH 0/4] Add cross compilation and CI build
by Lianbo Jiang
The patchset will add cross compilation and CI build
for crash-utility, includes four patches:
[1] [PATCH 1/4] sparc64: fix build failure
[2] [PATCH 2/4] gdb:disable building gdbserver in crash-utility
This will speed up crash building and save time, also avoid
some compilation issues, the [3] and [4] will benefit from
this one.
[3] [PATCH 3/4] Add cross compilation support
E.g: cross build crash-utility for aarch64 on X86_64
make CROSS_COMPILE=aarch64-linux-gnu- -j`nproc`
or
make CROSS_COMPILE=aarch64-linux-gnu- -j`nproc` warn
Note: there are still some limitations for cross
compilation because some dependency libs that are not
cross-compiled, for example: snappy, lzo, zstd
[4] [PATCH 4/4] Add ci-build.yml
Add a CI build and enable it on multiple arches, which can
check for compilation issues and also reduce some maintaince
workload.
Please refer to the result of CI build:
https://github.com/lian-bo/crash/actions/runs/13413391349
Lianbo Jiang (4):
sparc64: fix build failure
gdb:disable building gdbserver in crash-utility
Add cross compilation support
Add ci-build.yml
.github/workflows/ci-build.yml | 71 ++++++++++++++++++++++++++++++++++
Makefile | 50 +++++++++++++++++++++++-
README | 5 +++
configure.c | 6 +++
defs.h | 2 +-
gdb-10.2.patch | 12 ++++++
help.c | 5 +++
7 files changed, 148 insertions(+), 3 deletions(-)
create mode 100644 .github/workflows/ci-build.yml
--
2.47.1
1 month, 1 week
[PATCH] Add email notification for github issues and PRs
by Tao Liu
There are people who use github to create issues and PRs for bug
reporting and patch submitting, but there is no notifications to crash
maintainers as well as the mailing list, which as a result, leaving the
issues and PRs unhandled.
This patch will add an email notification action for github repo, when
new issues and PRs created or received comments, it will send email for
notification.
The format of the email notification is as follows:
Title: <Issue or PR title>
Description: <Issue or PR description>
Link: <Url to the issue or PR>
========
<Url to the comment or patch if any>
<Content of the comment or patch if any>
Please note:
1) Currently the email notification won't be sent to crash
mailing list, but only the maintainers, in case the notification is not
mature and pollute the mailing list. We can enable it later when it is
good enough.
2) The notification won't receive any reply, so
reply to the notification for comments and patch review is not
supported.
Signed-off-by: Tao Liu <ltao(a)redhat.com>
---
.github/workflows/email_notify.yml | 45 ++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)
create mode 100644 .github/workflows/email_notify.yml
diff --git a/.github/workflows/email_notify.yml b/.github/workflows/email_notify.yml
new file mode 100644
index 0000000..475361b
--- /dev/null
+++ b/.github/workflows/email_notify.yml
@@ -0,0 +1,45 @@
+name: Notify Issues and PRs
+on:
+ issues:
+ types: [opened]
+ issue_comment:
+ types: [created]
+ pull_request:
+ branches: ["master"]
+ types: [opened, reopened]
+
+jobs:
+ notify:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Generate Email
+ run: |
+ TITLE="${{ github.event.issue.title || github.event.pull_request.title }}"
+ LINK="${{ github.event.issue.html_url || github.event.pull_request.html_url }}"
+ DESC="${{ github.event.issue.body || github.event.pull_request.body }}"
+ PT_URL="${{ github.event.pull_request.patch_url }}"
+ COMT="${{ github.event.comment.body }}"
+ COMT_URL="${{ github.event.comment.html_url }}"
+ EVENT_ACT="${{ github.event.action }}"
+ echo "Title: $TITLE" > /tmp/body.txt
+ echo "Description: $DESC" >> /tmp/body.txt
+ echo "Link: $LINK" >> /tmp/body.txt
+ [[ -n "$PT_URL" ]] && echo "========" >> /tmp/body.txt \
+ && echo "Patch: $PT_URL" >> /tmp/body.txt \
+ && curl -L "$PT_URL" >> /tmp/body.txt
+ [[ -n "$COMT" ]] && echo "========" >> /tmp/body.txt \
+ && echo "Comment: $COMT_URL" >> /tmp/body.txt \
+ && echo "Comment: $COMT" >> /tmp/body.txt
+ [[ "$EVENT_ACT" == "created" ]] && echo "Comment on Issue/PR: $TITLE" > /tmp/subj.txt \
+ || echo "New Issue/PR: $TITLE" > /tmp/subj.txt
+ - name: Send Email
+ uses: dawidd6/action-send-mail@v3
+ with:
+ server_address: smtp.gmail.com
+ server_port: 465
+ username: ${{ secrets.EMAIL_USER }}
+ password: ${{ secrets.EMAIL_PASS }}
+ subject: file:///tmp/subj.txt
+ body: file:///tmp/body.txt
+ to: "ltao(a)redhat.com, lijiang(a)redhat.com"
+ from: "Crash Github Bot - NO REPLY"
--
2.47.0
1 month, 1 week
Re: Error/warning seen with crash tool 8.0.6
by lijiang
On Tue, Mar 11, 2025 at 10:18 AM <devel-request(a)lists.crash-utility.osci.io>
wrote:
> Date: Fri, 7 Mar 2025 09:46:34 +0530
> From: Harshvardhan Jha <harshvardhan.j.jha(a)oracle.com>
> Subject: [Crash-utility] Error/warning seen with crash tool 8.0.6
> To: devel(a)lists.crash-utility.osci.io
> Message-ID: <4bfe6246-a0cd-4ff0-8d17-164a486f74cd(a)oracle.com>
> Content-Type: text/plain; charset=UTF-8
>
> Hi there,
>
> I am seeing this error while trying to run crash 8.0.6 kernel on ARM
> 6.14 kernel:
> BFD:
> /usr/lib/debug/lib/modules/6.14.0-rc5.master.20250305.ol10.aarch64/vmlinux:
> unknown type [0x13] section `.relr.dyn'
>
> I suspect this is due to an outdated gdb as this issue was previously
> reported here also:
> https://github.com/crash-utility/crash/issues/182
Can you help double check with the latest crash(gdb-16.2)?
>
>
> I see that an update to gdb 16.2 is currently in review:
>
> https://lists.crash-utility.osci.io/archives/list/devel@lists.crash-utili...
This has been merged:
https://github.com/crash-utility/crash/commit/dfb2bb55e530db076e41cb0e41a...
Thanks
Lianbo
>
>
> I hope the update gets considered as it's long overdue.
>
> Thanks & Regards,
> Harshvardhan
>
1 month, 2 weeks
Re: Crash errors when using vtop command on the 6.14-rc1 kernel
by lijiang
On Tue, Mar 11, 2025 at 10:18 AM <devel-request(a)lists.crash-utility.osci.io>
wrote:
> Date: Fri, 14 Feb 2025 22:24:23 -0300
> From: Allele Security Intelligence <info(a)allelesecurity.com>
> Subject: [Crash-utility] Crash errors when using vtop command on the
> 6.14-rc1 kernel
> To: devel(a)lists.crash-utility.osci.io
> Message-ID:
> <CAC8mS_Td+SBwDDgJo4Aq0bxp41XadbVoqRbupi=
> tw8ap-VDB3w(a)mail.gmail.com>
> Content-Type: text/plain; charset="UTF-8"
>
> Hello all,
>
> I built the kernel 6.14-rc1 on Fedora 41 and the crash utility doesn't
> work as expected. Quickly investigating the issue, the commit below
> from last month changes a field in the struct dentry and it seems to
> be the reason for the errors I am seeing.
>
> dcache: back inline names with a struct-wrapped array of unsigned long
>
> https://github.com/torvalds/linux/commit/58cf9c383c5c686668082f83f7e0f3e0...
>
> The error is the following:
>
> crash> vtop -c 1224 0x41400000
> VIRTUAL PHYSICAL
> 41400000 51144000
>
> PGD: 24438000 => dfaf067
> PUD: dfaf008 => 109fd067
> PMD: 109fd050 => fc07067
> PTE: fc07000 => 8000000051144867
> PAGE: 51144000
>
> PTE PHYSICAL FLAGS
> 8000000051144867 51144000 (PRESENT|RW|USER|ACCESSED|DIRTY|NX)
>
> VMA START END FLAGS FILE
>
> vtop: invalid structure member offset: dentry_d_iname
> FILE: filesys.c LINE: 3242 FUNCTION: get_pathname_component()
>
>
Thank you for reporting this issue, this has been fixed:
https://github.com/crash-utility/crash/commit/2795136a515446b798ebbfa257c...
Thanks
Lianbo
> BFD: /usr/bin/crash: unknown type [0x13] section `.relr.dyn'
> [/usr/bin/crash] error trace: 556181a34180 => 556181a331c5 =>
> 556181a76b10 => 556181b4adab
> BFD: /usr/bin/crash: unknown type [0x13] section `.relr.dyn'
>
> vtop: invalid structure member offset: dentry_d_iname
> FILE: filesys.c LINE: 3242 FUNCTION: get_pathname_component()
>
> crash>
>
> I changed the field name and it seems to work now without errors, but
> I don't know the crash source code and didn't check the commit in
> details or even other ones applied to 6.14-rc1 to make sure there's
> not more problems for crash. I'd say there might be more changes to be
> done to really fix the potential issues. The command I was using and
> resulted in error works just fine now, but as I said, there might be
> more changes in order to really support the 6.14 kernel.
>
> $ sudo ./crash_modified/crash
> ~/work/kernels/packages/linux_upstream_6.14_rc1/vmlinux
>
> crash 8.0.6++
> Copyright (C) 2002-2025 Red Hat, Inc.
> Copyright (C) 2004, 2005, 2006, 2010 IBM Corporation
> Copyright (C) 1999-2006 Hewlett-Packard Co
> Copyright (C) 2005, 2006, 2011, 2012 Fujitsu Limited
> Copyright (C) 2006, 2007 VA Linux Systems Japan K.K.
> Copyright (C) 2005, 2011, 2020-2024 NEC Corporation
> Copyright (C) 1999, 2002, 2007 Silicon Graphics, Inc.
> Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, Inc.
> Copyright (C) 2015, 2021 VMware, Inc.
> This program is free software, covered by the GNU General Public License,
> and you are welcome to change it and/or distribute copies of it under
> certain conditions. Enter "help copying" to see the conditions.
> This program has absolutely no warranty. Enter "help warranty" for
> details.
>
> GNU gdb (GDB) 10.2
> Copyright (C) 2021 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <
> http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
> Type "show copying" and "show warranty" for details.
> This GDB was configured as "x86_64-pc-linux-gnu".
> Type "show configuration" for configuration details.
> Find the GDB manual and other documentation resources online at:
> <http://www.gnu.org/software/gdb/documentation/>.
>
> For help, type "help".
> Type "apropos word" to search for commands related to "word"...
>
> KERNEL:
> /home/user/work/kernels/packages/linux_upstream_6.14_rc1/vmlinux
> DUMPFILE: /proc/kcore
> CPUS: 4
> DATE: Wed Dec 31 21:00:00 -03 1969
> UPTIME: 07:44:59
> LOAD AVERAGE: 0.40, 0.11, 0.03
> TASKS: 306
> NODENAME: fedoraserver41research
> RELEASE: 6.14.0-rc1
> VERSION: #1 SMP PREEMPT_DYNAMIC Wed Feb 12 00:07:46 -03 2025
> MACHINE: x86_64 (2995 Mhz)
> MEMORY: 2 GB
> PID: 47350
> COMMAND: "crash"
> TASK: ffff88801eeb8000 [THREAD_INFO: ffff88801eeb8000]
> CPU: 3
> STATE: TASK_RUNNING (ACTIVE)
>
> crash> vtop -c 1224 0x41400000
> VIRTUAL PHYSICAL
> 41400000 51144000
>
> PGD: 24438000 => dfaf067
> PUD: dfaf008 => 109fd067
> PMD: 109fd050 => fc07067
> PTE: fc07000 => 8000000051144867
> PAGE: 51144000
>
> PTE PHYSICAL FLAGS
> 8000000051144867 51144000 (PRESENT|RW|USER|ACCESSED|DIRTY|NX)
>
> VMA START END FLAGS FILE
> ffff888006b52b00 41400000 42800000 8100073
>
> PAGE PHYSICAL MAPPING INDEX CNT FLAGS
> ffffea0001445100 51144000 ffff88801440f361 41400 1 fffffd0020828
> uptodate,lru,owner_2,swapbacked
> crash> vtop -c 1224 7f058fbc2000
> VIRTUAL PHYSICAL
> 7f058fbc2000 3f278000
>
> PGD: 244387f0 => 8955067
> PUD: 89550b0 => 997b067
> PMD: 997b3e8 => 9b69067
> PTE: 9b69e10 => 800000003f278025
> PAGE: 3f278000
>
> PTE PHYSICAL FLAGS
> 800000003f278025 3f278000 (PRESENT|USER|ACCESSED|NX)
>
> VMA START END FLAGS FILE
> ffff88800ea17b00 7f058fbc2000 7f058fbc3000 8000071 /usr/lib64/libc.so.6
>
> PAGE PHYSICAL MAPPING INDEX CNT FLAGS
> ffffea0000fc9e00 3f278000 ffff88800bf099c8 0 226 fffffe600426c
> referenced,uptodate,lru,workingset,private,head
> crash>
>
> The patch:
>
> $ git diff crash/filesys.c crash_modified/filesys.c
> diff --git a/crash/filesys.c b/crash_modified/filesys.c
> index 406ebb2..4759fa2 100644
> --- a/crash/filesys.c
> +++ b/crash_modified/filesys.c
> @@ -2050,7 +2050,7 @@ vfs_init(void)
> MEMBER_OFFSET_INIT(dentry_d_parent, "dentry", "d_parent");
> MEMBER_OFFSET_INIT(dentry_d_covers, "dentry", "d_covers");
> MEMBER_OFFSET_INIT(dentry_d_name, "dentry", "d_name");
> - MEMBER_OFFSET_INIT(dentry_d_iname, "dentry", "d_iname");
> + MEMBER_OFFSET_INIT(dentry_d_iname, "dentry", "d_shortname");
> MEMBER_OFFSET_INIT(dentry_d_sb, "dentry", "d_sb");
> MEMBER_OFFSET_INIT(inode_i_mode, "inode", "i_mode");
> MEMBER_OFFSET_INIT(inode_i_op, "inode", "i_op");
>
> Anyway, I am bringing this issue to the list so you people can
> properly implement support for the 6.14 kernel. Thank you!
>
> Anderson Nascimento
>
1 month, 2 weeks
Re: [PATCH v2 0/3] Update to gdb-16.2
by lijiang
On Thu, Feb 6, 2025 at 3:05 PM <devel-request(a)lists.crash-utility.osci.io>
wrote:
> Date: Thu, 6 Feb 2025 20:04:11 +1300
> From: Tao Liu <ltao(a)redhat.com>
> Subject: [Crash-utility] [PATCH v2 0/3] Update to gdb-16.2
> To: devel(a)lists.crash-utility.osci.io
> Cc: Tao Liu <ltao(a)redhat.com>
> Message-ID: <20250206070418.1038668-1-ltao(a)redhat.com>
> Content-Type: text/plain; charset="US-ASCII"; x-default=true
>
> v2 -> v1: Splite the "Fix several build failures" patchset, which is
> already merged btw, from gdb v16.2 upgrading.
>
Thank you for the update, Tao.
I will have a look next week.
Thanks
Lianbo
>
> Tao Liu (3):
> LoongArch64: Revert all previous LoongArch64 related commits
> Revert: Fix C99 compatibility issues in embedded copy of GDB
> Update to gdb-16.2
>
> Makefile | 10 +-
> README | 6 +-
> configure.c | 64 +-
> crash.8 | 2 +-
> crash_target.c | 6 +-
> defs.h | 174 +-
> diskdump.c | 24 +-
> gdb-10.2.patch | 16323 ------------------------------------------
> gdb-16.2.patch | 2254 ++++++
> gdb_interface.c | 14 +-
> help.c | 15 +-
> kernel.c | 6 +-
> lkcd_vmdump_v1.h | 2 +-
> lkcd_vmdump_v2_v3.h | 5 +-
> loongarch64.c | 1368 ----
> main.c | 3 +-
> netdump.c | 27 +-
> ramdump.c | 2 -
> symbols.c | 37 +-
> 19 files changed, 2322 insertions(+), 18020 deletions(-)
> delete mode 100644 gdb-10.2.patch
> create mode 100644 gdb-16.2.patch
> delete mode 100644 loongarch64.c
>
> --
> 2.47.0
>
1 month, 2 weeks