Bug 2330793 - qemu-aarch64-static SIGSEGV when trying to run uname
Summary: qemu-aarch64-static SIGSEGV when trying to run uname
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: qemu
Version: rawhide
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact: Fedora Extras Quality Assurance
URL: https://api.cirrus-ci.com/v1/artifact...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-12-06 14:20 UTC by Paul Holzinger
Modified: 2024-12-11 15:31 UTC (History)
9 users (show)

Fixed In Version: qemu-9.2.0-0.6.rc3.fc42
Clone Of:
Environment:
Last Closed: 2024-12-11 15:31:45 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
coredump file (54.77 KB, application/octet-stream)
2024-12-06 14:22 UTC, Paul Holzinger
no flags Details

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.


Note You need to log in before you can comment on or make changes to this bug.