Revert "qemu 8.0.4"#139409
Conversation
|
is it just a patch thing rather than a complete release revert? |
Ideally we should just have a patch, but the issue is still unanalyzed and critical for most QEMU users on macOS, so it would be nice to just revert the complete release. |
|
I also noticed that QEMU v8.0.4 still works with So this might be a regression on the Homebrew side, not on QEMU side. |
|
Generally, reverting a version bump doesn't go well (the entire versioning/update mechanism is only designed to increment). There is a mechanism available to "force" a "downgrade" but it's usually reserved for tricking the versioning system to accept upstream "long-term"/permanent changes, e.g. project changes its versioning scheme, not for a hotfix on a single version. Agree we should look further into why it may work when built from source but not bottled. |
|
It looks like re-attaching the $ codesign -d --entitlements - --xml /usr/local/Cellar/qemu/8.0.3/bin/qemu-system-x86_64
Executable=/usr/local/Cellar/qemu/8.0.3/bin/qemu-system-x86_64
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "https://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict><key>com.apple.security.hypervisor</key><true/></dict></plist>
$ codesign -d --entitlements - --xml /usr/local/Cellar/qemu/8.0.4/bin/qemu-system-x86_64
Executable=/usr/local/Cellar/qemu/8.0.4/bin/qemu-system-x86_64
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "https://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict><key>com.apple.security.hypervisor</key><true/></dict></plist>
$ /usr/local/Cellar/qemu/8.0.4/bin/qemu-system-x86_64 -accel hvf
qemu-system-x86_64: -accel hvf: Unknown Error
Abort trap: 6
$ cat >entitlements.xml <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.hypervisor</key>
<true/>
</dict>
</plist>
EOF
$ codesign -s - --entitlements entitlements.xml --force /usr/local/Cellar/qemu/8.0.4/bin/qemu-system-x86_64
/usr/local/Cellar/qemu/8.0.4/bin/qemu-system-x86_64: replacing existing signature
$ /usr/local/Cellar/qemu/8.0.4/bin/qemu-system-x86_64 -accel hvf
(shows iPXE screen, as expected)A weird thing is that |
|
It's possible some that some code changed in https://github.com/Homebrew/brew regarding codesign/entitlements in the bottle generation process in the time between the 8.0.3 and 8.0.4. |
|
Can you obtain a crash log? "Unknown error" is of little use on its own. |
$ lldb qemu-system-x86_64
(lldb) target create "qemu-system-x86_64"
Current executable set to 'qemu-system-x86_64' (x86_64).
(lldb) process handle SIGUSR2 -s false -p true
NAME PASS STOP NOTIFY
=========== ======= ======= =======
SIGUSR2 true false not set
(lldb) run -accel hvf
Process 31391 launched: '/usr/local/bin/qemu-system-x86_64' (x86_64)
Process 31391 stopped and restarted: thread 1 received signal: SIGUSR2
qemu-system-x86_64: -accel hvf: Unknown Error
Process 31391 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
frame #0: 0x00007ff8036a7202 libsystem_kernel.dylib`__pthread_kill + 10
libsystem_kernel.dylib`:
-> 0x7ff8036a7202 <+10>: jae 0x7ff8036a720c ; <+20>
0x7ff8036a7204 <+12>: movq %rax, %rdi
0x7ff8036a7207 <+15>: jmp 0x7ff8036a0ceb ; cerror_nocancel
0x7ff8036a720c <+20>: retq
Target 0: (qemu-system-x86_64) stopped.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
* frame #0: 0x00007ff8036a7202 libsystem_kernel.dylib`__pthread_kill + 10
frame #1: 0x00007ff8036deee6 libsystem_pthread.dylib`pthread_kill + 263
frame #2: 0x00007ff803605b45 libsystem_c.dylib`abort + 123
frame #3: 0x00000001004d1a38 qemu-system-x86_64`assert_hvf_ok.cold.1 + 16
frame #4: 0x000000010033e331 qemu-system-x86_64`assert_hvf_ok + 101
frame #5: 0x000000010033e45f qemu-system-x86_64`hvf_accel_init + 22
frame #6: 0x0000000100204392 qemu-system-x86_64`accel_init_machine + 82
frame #7: 0x00000001001bd416 qemu-system-x86_64`do_configure_accelerator + 201
frame #8: 0x0000000100497183 qemu-system-x86_64`qemu_opts_foreach + 91
frame #9: 0x00000001001bac76 qemu-system-x86_64`qemu_init + 11335
frame #10: 0x00000001003472e7 qemu-system-x86_64`main + 9
frame #11: 0x00007ff80338541f dyld`start + 1903
(lldb) |
|
I tried with |
|
Does We don't really support codesigning on Intel, so I'm guessing something's perhaps changed to invalidate it. |
|
Yes, the sign seems broken: |
|
We could potentially modify https://github.com/Homebrew/brew/blob/7044f50f889f8ec7d8656ac176e960e53bee1a0a/Library/Homebrew/extend/os/mac/keg.rb#L29 to apply on Intel on the specific conditions that an existing signature has been invalidated (we won't codesign everything like on arm64). |
Thanks for taking a look, could you modify that file and rebuild the bottle? |
|
One interesting thing I noticed, the following sequence on my local machine (Intel, Monterey) produces a binary that doesn't have its signature broken: So not sure what the CI is doing differently that causes its bottles to not work when installed on my machine. |
$ file /usr/local/Cellar/lima/0.17.1/bin/limactl
/usr/local/Cellar/lima/0.17.1/bin/limactl: Mach-O 64-bit executable x86_64
$ codesign -d --entitlements - --xml /usr/local/Cellar/lima/0.17.1/bin/limactl
Executable=/usr/local/Cellar/lima/0.17.1/bin/limactl
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "https://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict><key>com.apple.security.network.client</key><true/><key>com.apple.security.network.server</key><true/><key>com.apple.security.virtualization</key><true/></dict></plist>
$ codesign --verify /usr/local/Cellar/lima/0.17.1/bin/limactl
(no output)Lima v0.17.1 was bottled just 16 hours ago but it seems still properly signed 🤔 Wondering if the QEMU v8.0.4 signature was just lost due to a transient error? |
|
Would it be possible to trigger the bot to rebuild QEMU v8.0.4 bottle and see if it works? |
|
I do hope we can find some resolution soon, even if it's a short-term one. This problem causes all lima and colima installs to fail OOTB, so the support load will continue to increase rapidly as the whole world discovers this problem. |
|
Maybe Homebrew/brew#15864 will help, I'm kicking off a rebuild |
|
Thanks, the issue is solved in |
@AkihiroSuda Your workaround of re-attaching entitlement fixed this problem for me and thank you for the workaround. Hopefully, this will be resolved in the 8.1 version down the road. Thanks again! |
The issue is already fixed in the "rebuild 1" of v8.0.4: |
Reverts #139356 , as the release seems broken