homebrew-core
homebrew-core copied to clipboard
virt-manager broken on M1 Sonoma (14.2.1)
brew gist-logs <formula> link OR brew config AND brew doctor output
https://gist.github.com/SalimTerryLi/a1a53dc3fa29bc1eae5c2062036abfe6
Verification
- [X] My "
brew doctoroutput" saysYour system is ready to brew.and am still able to reproduce my issue. - [X] I ran
brew updateand am still able to reproduce my issue. - [X] I have resolved all warnings from
brew doctorand that did not fix my problem. - [X] I searched for recent similar issues at https://github.com/Homebrew/homebrew-core/issues?q=is%3Aissue and found no duplicates.
What were you trying to do (and why)?
Launching virt-manager from Terminal
What happened (include all command output)?
Nothing from commandline output, but Pop up window says Python quit unexpectedly, with details appended into gist
What did you expect to happen?
virt-manager should be launched successfully
Step-by-step reproduction instructions (by running brew commands)
brew update
brew install virt-manager
virt-manager
I am able to replicate this bug.
$ brew config
HOMEBREW_VERSION: 4.2.4-22-g533002b
ORIGIN: https://github.com/Homebrew/brew
HEAD: 533002ba11d231b26a89841966e68f5d02bfe4ab
Last commit: 4 hours ago
Core tap HEAD: 7c886352045f3faef5c8e47a5e3381610cc0401e
Core tap last commit: 47 minutes ago
Core tap JSON: 15 Jan 23:32 UTC
Core cask tap HEAD: dd0abb2e2c38ef6ccb0969db4c25f03fd2130008
Core cask tap last commit: 2 hours ago
Core cask tap JSON: 15 Jan 23:32 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.QvpZ1X7gG7/org.xquartz:0
HOMEBREW_EDITOR: /usr/bin/vim
HOMEBREW_GITHUB_API_TOKEN: set
HOMEBREW_MAKE_JOBS: 10
HOMEBREW_SORBET_RUNTIME: set
Homebrew Ruby: 3.1.4 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/bin/ruby
CPU: 10-core 64-bit arm_firestorm_icestorm
Clang: 15.0.0 build 1500
Git: 2.39.3 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 8.4.0 => /usr/bin/curl
macOS: 14.2.1-arm64
CLT: 15.1.0.0.1.1700200546
Xcode: 15.2
Rosetta 2: false
I am able to replicate this bug.
Just occasionally find it works with --debug flag appended, as well as --no-fork is. Something wrong with fork-exec procedure for sure. Anyone with older version of MacOS (<=13) can confirm if it is still working?
Things get better if I:
- move those lines out of file scope into function level and achieved on-demand lazy import
- fork() ASAP before importing those modules
IMO it is an upstream implementation issue that (may only) affects macOS
Thanks for the hint... the --debug flag makes it work for me as a workaround.
Works for me with --no-fork but it would be nice if it could be fixed :smiley:
IMO it is an upstream implementation issue that (may only) affects macOS
Can you report this upstream? Mentioning issue here won't help since Homebrew is also hitting same issue which is why we don't have a Sonoma bottle yet: https://github.com/Homebrew/homebrew-core/blob/4c776b6294b8e33ba9e23b516bba88f9fded0dc5/Formula/v/virt-manager.rb#L12-L17
Can you report this upstream?
Willing to do that later (or if anyone has interest), but I'm not experienced in macOS and I haven't understood the real back trace of the crash. From my perspective it can be workaround-ed with such coding technique but I'm not really understanding why it happens, thus may not lead to the correct solution...
I'm sure upstream will be able to help you get the right information
I think the following can reproduce the issue:
import libvirt; import os; os.fork(); from gi.repository import Gtk
The upstream has some odd workaround for Gtk but it seems that libvirt may be triggering another fork issue on Sonoma.
Anyway, someone from virt-manager is probably better at analyzing what is happening.
Note: os.fork() has all sorts of warnings on its usage (https://docs.python.org/3/library/os.html#os.fork) which could be related.
I'm also hitting this. When I run virt-manager I get:
$ virt-manager
[08:49:24][wk@host:~]$ objc[18316]: +[NSPlaceholderMutableString initialize] may have been in progress in another thread when fork() was called.
objc[18316]: +[NSPlaceholderMutableString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
Followed by a crash. --debug makes it start OK.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
It's not just on M1, I'm getting the same issue on an Intel MBP. Is there already an issue reported upstream?
just ran across this issue, can confirm --debug --no-fork seems to work for the moment
There is an upstream issue: virt-manager/virt-manager#620. I'm closing this issue as there's nothing actionable on Homebrew's side at the moment and there's a workaround available.