rhkdump / kdump-utils

Kernel crash dump collection utilities
GNU General Public License v2.0
4 stars 9 forks source link

kexec-tools 2.0.28-4.fc40 fails on Aarch64 with kernel 6.8.11 #22

Open jbtrystram opened 4 days ago

jbtrystram commented 4 days ago
[2024-07-04T12:46:18.559Z] Upgraded:
[2024-07-04T12:46:18.559Z]   kexec-tools 2.0.28-4.fc40 -> 2.0.28-10.fc40
[2024-07-04T12:46:18.559Z] Added:
[2024-07-04T12:46:18.559Z]   kdump-utils-1.0.42-10.fc40.aarch64
[2024-07-04T12:46:18.559Z]   makedumpfile-1.7.5-11.fc40.aarch64

journal.txt

Attached is the full journal log with debug enabled for kdump

pfliu commented 4 days ago

elf_arm64_probe: Not an ELF executable. image_arm64_probe: Bad arm64 image header. pez_arm64_probe: PROBE. pez_prepare: decompressed size 17913695 pez_prepare: done pez_arm64_probe: Bad arm64 image header. Cannot determine the file type of /boot/vmlinuz-6.9.7-200.fc40.aarch64

pfliu commented 4 days ago

Using the upstream kexec-tools 4fd0553 (HEAD -> main, origin/master, origin/main, origin/build-test, origin/HEAD) x86-linux-setup.c: Use POSIX basename API

It works. So there is something wrong with Fedora 40 kexec-tools

./kexec -d -s -p /boot/vmlinuz-6.9.7-200.fc40.aarch64 --initrd=/boot/initramfs-6.9.7-200.fc40.aarch64.img --reuse-cmdline kernel symbol _text vaddr = ffffb6bbb2060000 kernel symbol _stext vaddr = ffffb6bbb2070000 kernel symbol __init_begin vaddr = ffffb6bbb4440000 arch_process_options:178: command_line: root=/dev/mapper/sysvg-root ro console=tty1 console=ttyS0,115200n8 rd.lvm.lv=sysvg/root console=tty0 arch_process_options:180: initrd: /boot/initramfs-6.9.7-200.fc40.aarch64.img arch_process_options:182: dtb: (null) arch_process_options:185: console: (null) Try gzip decompression. Try LZMA decompression. elf_arm64_probe: Not an ELF executable. image_arm64_probe: Bad arm64 image header. pez_arm64_probe: PROBE. Try gzip decompression. pez_prepare: decompressed size 66453504

pfliu commented 9 hours ago

With default installation, kexec-tools-2.0.28-10 can not load vmlinuz-6.9.7-200.fc40.aarch64.

I tried to rebuild the package from scratch. dnf download --source kexec-tools rpmbuild -bb SPECS/kexec-tools.spec rpm -ivh --force /root/rpmbuild/RPMS/aarch64/kexec-tools-2.0.28-10.fc40.aarch64.rpm

And it turned out working: kexec -d -s -l /boot/vmlinuz-6.9.7-200.fc40.aarch64 --initrd=/boot/initramfs-6.9.7-200.fc40.aarch64.img --reuse-cmdline arch_process_options:178: command_line: root=UUID=56e3908e-1be7-4bac-9513-af2d1ce7d527 ro rootflags=subvol=root arch_process_options:180: initrd: /boot/initramfs-6.9.7-200.fc40.aarch64.img arch_process_options:182: dtb: (null) arch_process_options:185: console: (null) Try gzip decompression. Try LZMA decompression. elf_arm64_probe: Not an ELF executable. image_arm64_probe: Bad arm64 image header. pez_arm64_probe: PROBE. Try gzip decompression. pez_prepare: decompressed size 66453504 pez_prepare: done

[root@ampere-mtsnow-altramax-07 ~]# rpm -qa | grep kexec-tools kexec-tools-debugsource-2.0.28-10.fc40.aarch64 kexec-tools-debuginfo-2.0.28-10.fc40.aarch64 kexec-tools-2.0.28-10.fc40.aarch64

daveyoung commented 9 hours ago

As Coiby mentioned in slack chat, it seems the default built kexec missing some libraries. eg. on my x86 laptop I got: [kexec-tools]$ ldd /sbin/kexec linux-vdso.so.1 (0x00007f4ff5cf3000) liblzma.so.5 => /lib64/liblzma.so.5 (0x00007f4ff5b83000) libz.so.1 => /lib64/libz.so.1 (0x00007f4ff5b62000) libc.so.6 => /lib64/libc.so.6 (0x00007f4ff5975000) /lib64/ld-linux-x86-64.so.2 (0x00007f4ff5cf4000)

But on an arm vm I got: [root@fedora ~]# ldd /sbin/kexec linux-vdso.so.1 (0x0000ffff8cfa1000) libc.so.6 => /lib64/libc.so.6 (0x0000ffff8cd10000) /lib/ld-linux-aarch64.so.1 (0x0000ffff8cf54000)

So probably need to explicitly add Build requires for the compression lib. Can you manually remove the libz and then build the rpm, if it fails to load then it should be like this.

pfliu commented 8 hours ago

As Coiby mentioned in slack chat, it seems the default built kexec missing some libraries. eg. on my x86 laptop I got: [kexec-tools]$ ldd /sbin/kexec linux-vdso.so.1 (0x00007f4ff5cf3000) liblzma.so.5 => /lib64/liblzma.so.5 (0x00007f4ff5b83000) libz.so.1 => /lib64/libz.so.1 (0x00007f4ff5b62000) libc.so.6 => /lib64/libc.so.6 (0x00007f4ff5975000) /lib64/ld-linux-x86-64.so.2 (0x00007f4ff5cf4000)

But on an arm vm I got: [root@fedora ~]# ldd /sbin/kexec linux-vdso.so.1 (0x0000ffff8cfa1000) libc.so.6 => /lib64/libc.so.6 (0x0000ffff8cd10000) /lib/ld-linux-aarch64.so.1 (0x0000ffff8cf54000)

So probably need to explicitly add Build requires for the compression lib. Can you manually remove the libz and then build the rpm, if it fails to load then it should be like this.

It should be the root cause: The default one: ldd /usr/sbin/kexec linux-vdso.so.1 (0x0000ffff86b1d000) libc.so.6 => /lib64/libc.so.6 (0x0000ffff86890000) /lib/ld-linux-aarch64.so.1 (0x0000ffff86ad0000)

The one built from the same source rpm ldd /sbin/kexec linux-vdso.so.1 (0x0000ffff80849000) liblzma.so.5 => /lib64/liblzma.so.5 (0x0000ffff80740000) libz.so.1 => /lib64/libz.so.1 (0x0000ffff806e0000) libc.so.6 => /lib64/libc.so.6 (0x0000ffff80500000) /lib/ld-linux-aarch64.so.1 (0x0000ffff807fc000)

pfliu commented 8 hours ago

I think we should add Requires(pre): zlib in kexec-tools.spec, which is in centos stream 9.

daveyoung commented 8 hours ago

On Tue, 9 Jul 2024 at 11:25, pfliu @.***> wrote:

I think we should add Requires(pre): zlib in kexec-tools.spec, which is in centos stream 9.

I suspect it should be added to BuildRequires There are below in spec log, but not sure why it was not there now:

  • Fri Jul 07 2006 Neil Horman @.***> 1.101-27.fc6
  • Buildrequire zlib-devel

— Reply to this email directly, view it on GitHub https://github.com/rhkdump/kdump-utils/issues/22#issuecomment-2216340762, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABOAKTNXNBFQWX2T4MTHRPDZLNJZNAVCNFSM6AAAAABKLYK4YOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJWGM2DANZWGI . You are receiving this because you commented.Message ID: @.***>

daveyoung commented 8 hours ago

On Tue, 9 Jul 2024 at 11:28, Dave Young @.***> wrote:

On Tue, 9 Jul 2024 at 11:25, pfliu @.***> wrote:

I think we should add Requires(pre): zlib in kexec-tools.spec, which is in centos stream 9.

I suspect it should be added to BuildRequires There are below in spec log, but not sure why it was not there now:

  • Fri Jul 07 2006 Neil Horman @.***> 1.101-27.fc6
  • Buildrequire zlib-devel

Anyway this should be done in the "kexec-tools" package, it is not the scope of kdump-utils now.

— Reply to this email directly, view it on GitHub https://github.com/rhkdump/kdump-utils/issues/22#issuecomment-2216340762, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABOAKTNXNBFQWX2T4MTHRPDZLNJZNAVCNFSM6AAAAABKLYK4YOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJWGM2DANZWGI . You are receiving this because you commented.Message ID: @.***>

pfliu commented 8 hours ago

It is removed by the following commit

commit b3620b0dbc3e0fb9a92ab5faf34ac3b4e7bb7bd9 Author: Coiby Xu coxu@redhat.com Date: Tue Apr 9 09:25:48 2024 +0800

makedumpfile: remove explicit-lib-dependency zlib

Fix the following error found by rpmlint,
    makedumpfile.x86_64: E: explicit-lib-dependency zlib
    You must let rpm find the library dependencies by itself. Do not put unneeded
    explicit Requires: tags.

Signed-off-by: Coiby Xu <coxu@redhat.com>
Reviewed-by: Philipp Rudo <prudo@redhat.com>
Reviewed-by: Dave Young <dyoung@redhat.com>

diff --git a/kexec-tools.spec b/kexec-tools.spec index 32fddaf..254d88a 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -71,7 +71,6 @@ License: GPL-2.0-only URL: https://github.com/makedumpfile/makedumpfile

Conflicts: kexec-tools < 2.0.28-5 -Requires(pre): zlib BuildRequires: make

daveyoung commented 8 hours ago

On Tue, 9 Jul 2024 at 11:32, pfliu @.***> wrote:

It is removed by the following commit

commit b3620b0 Author: Coiby Xu @.*** Date: Tue Apr 9 09:25:48 2024 +0800

makedumpfile: remove explicit-lib-dependency zlib

Fix the following error found by rpmlint, makedumpfile.x86_64: E: explicit-lib-dependency zlib You must let rpm find the library dependencies by itself. Do not put unneeded explicit Requires: tags.

Signed-off-by: Coiby Xu @.> Reviewed-by: Philipp Rudo @.> Reviewed-by: Dave Young @.***>

diff --git a/kexec-tools.spec b/kexec-tools.spec index 32fddaf..254d88a 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -71,7 +71,6 @@ License: GPL-2.0-only URL: https://github.com/makedumpfile/makedumpfile

Conflicts: kexec-tools < 2.0.28-5 -Requires(pre): zlib

Hi Pinfan, hmm, probably you can try, but I still think it is not Requires, it should be BuildRequires so this commit should not cause things to break.

BuildRequires: make

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

pfliu commented 8 hours ago

On Tue, 9 Jul 2024 at 11:32, pfliu @.> wrote: It is removed by the following commit commit b3620b0 Author: Coiby Xu @. Date: Tue Apr 9 09:25:48 2024 +0800 makedumpfile: remove explicit-lib-dependency zlib Fix the following error found by rpmlint, makedumpfile.x86_64: E: explicit-lib-dependency zlib You must let rpm find the library dependencies by itself. Do not put unneeded explicit Requires: tags. Signed-off-by: Coiby Xu @.> Reviewed-by: Philipp Rudo @.> Reviewed-by: Dave Young @.> diff --git a/kexec-tools.spec b/kexec-tools.spec index 32fddaf..254d88a 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -71,7 +71,6 @@ License: GPL-2.0-only URL: https://github.com/makedumpfile/makedumpfile Conflicts: kexec-tools < 2.0.28-5 -Requires(pre): zlib Hi Pinfan, hmm, probably you can try, but I still think it is not Requires, it should be BuildRequires so this commit should not cause things to break. BuildRequires: make — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.>

I guess in the spec, we should explicitly "configure --with-zlib --with-lzma", so that the rpm can detect the dependency