My setup is a fcos 39 VM running on a macbook (macOS) with a m1 CPU. The VM is running in QEMU. This was all created/started using `podman machine`. With qemu-x86_64-static from qemu-8.1.3-1.fc39, I can no longer run on the m1 the x86_64 binary created by https://github.com/containers/PodmanHello If I try with qemu-x86_64-static from qemu-7.2.7-1.fc38 then this works. If I build the binary manually on a fc39 x86 system with `gcc -O2 -static -o podman_hello_world podman_hello_world.c`, then I can also run it successfully with qemu-8.1.3-1.fc39. It's only the static binary built inside the alpine container which cannot be run on the M1. Misc tests I ran: # ./qemu-x86_64-static-8.1.3 podman_hello_world.alpine qemu-x86_64-static-8.1.3: /var/roothome/podman_hello_world.alpine: Unable to find a guest_base to satisfy all guest address mapping requirements 0000000000000000-0000000000000fff 0000000000400000-00000000004047ef # ./qemu-x86_64-static-7.2.7 podman_hello_world.alpine !... Hello Podman World ...! [...] # ./qemu-x86_64-static-8.1.3 podman_hello_world.fc39 !... Hello Podman World ...! [...] Reproducible: Always
Created attachment 2007328 [details] x86_64 binary I can no longer run in an aarch64 VM
The issue is still present with qemu-8.2.0-0.3.rc2.fc40
I wanted to reproduce this with upstream QEMU built from source but was not successful. Note that I'm using an x86_64 Linux host, not a m1 Mac. The alpine binary runs successfully on v8.1.3 and commit ffd454c67e38 (qemu.git/master on 8/1/2024). Maybe the issue is related to aarch64 hosts.
I also could not reproduce on x86_64 machines. I just tried it on fc39 installed on non-Apple aarch64 hardware, and I'm seeing the same issue: # rpm -qf /usr/bin/qemu-x86_64-static qemu-user-static-x86-8.1.3-1.fc39.aarch64 # qemu-x86_64-static ./podman_hello_world.alpine qemu-x86_64-static: /root/podman_hello_world.alpine: Unable to find a guest_base to satisfy all guest address mapping requirements 0000000000000000-0000000000000fff 0000000000400000-00000000004047ef
I've opened an upstream bug, since this kind of thing usually requires TCG maintainer expert opinion to diagnose: https://gitlab.com/qemu-project/qemu/-/issues/2082 Please CC yourself to that bug and continue diagnosis there. We'll backport to Fedora if any bug is identified upstream.
After reading https://gitlab.com/qemu-project/qemu/-/issues/1953 and https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1053101, I built a test qemu fedora package with --enable-pie (the .spec disables it) and this solved (worked around?) the issue
Scratch build is at https://koji.fedoraproject.org/koji/taskinfo?taskID=112603010
After reading https://gitlab.com/qemu-project/qemu/-/issues/1953 and https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1053101, I built a test qemu fedora package with --enable-pie (the .spec disables it) and this solved (worked around?) the issue Urgh, pie should *not* be disabled. Can you submit a PR with the fix for the spec.
This was fixed in https://src.fedoraproject.org/rpms/qemu/pull-request/59 (and the follow-up https://src.fedoraproject.org/rpms/qemu/pull-request/60). This is available in f40 and newer, would be nice to get this in f39 as well as this is what podman-machine images are built from.
FEDORA-2024-5f3a01426a (qemu-8.1.3-5.fc39) has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2024-5f3a01426a
FEDORA-2024-5f3a01426a has been pushed to the Fedora 39 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-5f3a01426a` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-5f3a01426a See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2024-5f3a01426a (qemu-8.1.3-5.fc39) has been pushed to the Fedora 39 stable repository. If problem still persists, please make note of it in this bug report.
It does not fix the problem, at least for `qemu-i386-static`. ``` teohhanhui@Han-MacBook-Air:~$ ~/Downloads/disk\ tools/chkntfs qemu-i386-static: /home/teohhanhui/Downloads/disk tools/chkufsd: Unable to find a guest_base to satisfy all guest address mapping requirements 00000000-ffffffff teohhanhui@Han-MacBook-Air:~$ rpm -qf $(command -v qemu-i386-static) qemu-user-static-x86-8.1.3-5.fc39.aarch64 ``` Setting `QEMU_GUEST_BASE=0x14000` as mentioned here works though: https://social.treehouse.systems/@mstephenson6/112299009772931025 ``` teohhanhui@Han-MacBook-Air:~$ QEMU_GUEST_BASE=0x14000 ~/Downloads/disk\ tools/chkntfs Check ufsd volume for error Usage: chkufsd device [-f] -fs:ntfs force to treat volume as ntfs. -fs:hfs force to treat volume as hfs+/hfsj. -fs:exfat force to treat volume as exfat/texfat. -fs:fat force to treat volume as fat32/fat16. -f fix errors on the disk. -a auto check. Full check if volume is dirty -b:size Override the default block (sector) size. Default settings are strongly recommended for general use. One can use 512, 1024, 2048, 4096. -m:size memory limit -h display this help --short check the minimum --safe do not try to fix errors; only clear 'dirty' flag if there are no errors --help display this help --showminors show minor errors --no-orphans do not restore real orphan files --trace turn on UFSD trace --verbose explain what is being done --nopercents do not print percents --version show version and exit E.g. chkufsd /dev/hdb1 ```