Bug 2330793

Summary: qemu-aarch64-static SIGSEGV when trying to run uname
Product: [Fedora] Fedora Reporter: Paul Holzinger <pholzing>
Component: qemuAssignee: Richard W.M. Jones <rjones>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: berrange, cfergeau, crobinso, mcascell, pbonzini, philmd, rjones, suraj.ghimire7, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
URL: https://api.cirrus-ci.com/v1/artifact/task/5027689322512384/html/int-podman-rawhide-root-host-sqlite.log.html#t--Podman-run-podman-run-from-manifest-list--1
Whiteboard:
Fixed In Version: qemu-9.2.0-0.6.rc3.fc42 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-12-11 15:31:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
coredump file none

Description Paul Holzinger 2024-12-06 14:20:08 UTC
We are trying to run an aarch64 uname binary via podman but this started to fail all of the sudden.

rpm -q qemu-user-static
qemu-user-static-9.2.0-0.3.rc1.fc42.x86_64
This worked fine with qemu-user-static-9.1.1-2.fc42.x86_64 so this is a regression.

Reproducible: Always

Steps to Reproduce:
1. podman run --rm --arch arm64 registry.fedoraproject.org/fedora uname -a

Actual Results:  
exit code 139 and you see the coredump from qemu-aarch64-static in the kernel logs and coredumpctl list 

Expected Results:  
It should work and print the uname output

Comment 1 Paul Holzinger 2024-12-06 14:22:16 UTC
Created attachment 2061472 [details]
coredump file

Comment 2 Daniel Berrangé 2024-12-06 17:19:42 UTC
This is looking like one of those bugs from hell

I can reproduce the problem, and it doesn't even need podman involved

Simply

  $ dnf install qemu-user-aarch64-static
  $ qemu-aarch64-static
  Segmentation fault (core dumped)

The stack trace shows

  Program received signal SIGSEGV, Segmentation fault.
  0x00007ffff7b61e3e in resolve_g_str_is_ascii ()
  (gdb) bt
  #0  0x00007ffff7b61e3e in resolve_g_str_is_ascii ()
  #1  0x00007ffff7c19107 in _dl_relocate_static_pie ()
  #2  0x00007ffff7b9a026 in __libc_start_main_impl ()
  #3  0x00007ffff780bb05 in _start ()

IOW, we've not even got as far as executing any QEMU code.

I can confirm that the old RPM build qemu-user-static-9.1.1-2.fc42.x86_64 works fine, but if you take that src.rpm and build it on current Fedora, it crashes and burns again.

IOW, the cause is *NOT* the QEMU 9.2.0 release update, it is a package in the build environment that has changed.

After trying many things I've narrowed it down to

 glib2-static-2.83.0-2.fc42

If you build QEMU against that, we get kabooom at startup, build against glib2-static-2.82.2-1.fc42 and life is good.

Comment 3 Daniel Berrangé 2024-12-06 18:02:15 UTC
glib 2.83.0  added an 'ifunc' for playing games with its string functions which was completely fubar with static builds of anything. I'll opened an MR with the revert from glib upstream

https://src.fedoraproject.org/rpms/glib2/pull-request/19

We'll need to re-build QEMU once fixed glib is built

Comment 4 Richard W.M. Jones 2024-12-11 11:50:23 UTC
glib2 fix: https://koji.fedoraproject.org/koji/taskinfo?taskID=126715029

As this is a -static package, I assume qemu will need to be bumped and rebuilt
after glib2 fix appears in Rawhide?

Comment 5 Daniel Berrangé 2024-12-11 11:53:36 UTC
(In reply to Richard W.M. Jones from comment #4)
> glib2 fix: https://koji.fedoraproject.org/koji/taskinfo?taskID=126715029
> 
> As this is a -static package, I assume qemu will need to be bumped and
> rebuilt
> after glib2 fix appears in Rawhide?

Yes, a QEMU rebuild will be required.

Comment 7 Fedora Update System 2024-12-11 13:39:42 UTC
FEDORA-2024-1ac3f57df8 (qemu-9.2.0-0.6.rc3.fc42) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-1ac3f57df8

Comment 8 Fedora Update System 2024-12-11 15:31:45 UTC
FEDORA-2024-1ac3f57df8 (qemu-9.2.0-0.6.rc3.fc42) has been pushed to the Fedora 42 stable repository.
If problem still persists, please make note of it in this bug report.