cargo on ppc64 fails: invalid instruction: *EDIT*: on ntpdate as well
Host environment
- Operating system: Gentoo linux
- OS/kernel version:Linux 6.5.5release+ #11 SMP Mon Sep 25 11:37:52 CEST 2023 x86_64 AMD 100-000000011-11 AuthenticAMD GNU/Linux
- Architecture: amd64
- QEMU flavor: qemu-system-ppc64
- QEMU version: 8.1.0
- QEMU command line:
qemu-system-ppc64 -nodefaults -nographic -machine ppce500 -cpu e6500 -accel tcg -m 8G,slots=8,maxmem=125G -smp 8 -kernel /repos/janpieter/linux/bcachefs/ktest-out/kernel.ppc64/vmlinuz -append root=/dev/vda rw log_buf_len=8M mitigations=off ktest.dir=/repos/janpieter/ktest ktest.env=/tmp/build-test-kernel-mSd0CbURRv/env kgdboc=ttyS0,115200 nokaslr console=hvc0 kasan.fault=panic -device virtio-serial -chardev stdio,id=console -device virtconsole,chardev=console -serial unix:/repos/janpieter/linux/bcachefs/ktest-out/vm/kgdb,server,nowait -monitor unix:/repos/janpieter/linux/bcachefs/ktest-out/vm/mon,server,nowait -gdb unix:/repos/janpieter/linux/bcachefs/ktest-out/vm/gdb,server,nowait -device virtio-rng-pci -virtfs local,path=/,mount_tag=host,security_model=none,multidevs=remap -nic user,model=virtio,hostfwd=tcp:127.0.0.1:62457-:22 -drive if=none,format=raw,id=disk0,file=/var/lib/ktest/root.ppc64,snapshot=on -device virtio-blk-pci,drive=disk0 -drive if=none,format=raw,id=disk1,file=/repos/janpieter/linux/bcachefs/ktest-out/vm/dev-1,cache=unsafe -device virtio-blk-pci,drive=disk1 -drive if=none,format=raw,id=disk2,file=/repos/janpieter/linux/bcachefs/ktest-out/vm/dev-2,cache=unsafe -device virtio-blk-pci,drive=disk2
Emulated/Virtualized environment
- Operating system: Debian PPC64 (SID)
- OS/kernel version: linux 6.5.0
- Architecture: PPC64
Description of problem
Machine boots, but when compiling a rust library, the following issue appears:
cargo build --release --manifest-path rust-src/Cargo.toml
cargo[376]: illegal instruction (4) at 12e0933c0 nip 12e0933c0 lr 12dd7c768 code 1 in cargo[12dc10000+956000]
cargo[376]: code: 00000000 00000000 00000000 7c0802a6 f8010010 f821ff11 fba100d8 60000000
cargo[376]: code: fbc100e0 8862cd50 28030000 418200d4 <104214c4> 38810070 3bc00000 7c4021ce
make: *** [Makefile:133: rust-src/target/release/libbcachefs_rust.a] Illegal instruction (core dumped)
make: *** Waiting for unfinished jobs....
ar[375]: illegal instruction (4) at 3fff9b2a4dac nip 3fff9b2a4dac lr 3fff9b2a4da4 code 1 in libLLVM-16.so.1[3fff99f10000+792f000]
ar[375]: code: f87d0028 7fa3eb78 b29d0090 f89d0020 4810a8c1 60000000 7f83e378 7fa4eb78
ar[375]: code: 7fc5f378 49bfd3e1 e8410028 60000000 <104214c4> 38810070 fb610080 eba29fe0
make: *** [Makefile:129: libbcachefs.a] Illegal instruction (core dumped)
make: *** Deleting file 'libbcachefs.a'
the core dump files of cargo and ar are attached
I have no clue whether this is a rustc or qemu bug, so please let me know if this issue should be forwarded to rust devs
EDIT: as this happens with ntpdate as well, I think it's an emulator issue:
ntpdig[1179]: illegal instruction (4) at 102382c4 nip 102382c4 lr 102382a8 code 1 in python3.11[10000000+63e000]
ntpdig[1179]: code: 3d22ffdd c8094448 fc1e0000 41c2022c 4bde9b5d e8410028 3d42ffdd 39200000
ntpdig[1179]: code: c80a4450 91230000 fc1e0000 41c001a4 <ffe0f02c> fc1ff800 41c30280 3d22ffdd
Steps to reproduce
- create a debian ppc64 root image using debian sid & debootstrap
- install rust using rustup
- compile bcachefs-tools in ppc64
2b. Install ntpdate using apt-get ntpdate 3b. run ntpdate
Additional information
Core dump command:
cat /proc/sys/kernel/core_pattern
|/bin/cp --sparse=always /dev/stdin /host//repos/janpieter/linux/bcachefs/ktest-out/core.%e.PID%p.SIG%s.TIME%t
core.ar.PID374.SIG4.TIME1696070088.xz AR core dump
core.ar.PID375.SIG4.TIME1696070088.xz AR core dump
core.cargo.PID375.SIG4.TIME1696070087.xz cargo core dump
core.cargo.PID376.SIG4.TIME1696070087.xz cargo core dump
core.ntpdig.PID1171.SIG4.TIME1696070657.xz ntpdig core dump
Edited by jpsollie