Skip to content

qemu: fix segfault on macOS 15.0-15.3 #221539

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

botantony
Copy link
Contributor

  • Have you followed the guidelines for contributing?
  • Have you ensured that your commits follow the commit style guide?
  • Have you checked that there aren't other open pull requests for the same formula update/change?
  • Have you built your formula locally with HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • Is your test running fine brew test <formula>, where <formula> is the name of the formula you're submitting?
  • Does your build pass brew audit --strict <formula> (after doing HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>)? If this is a new formula, does it pass brew audit --new <formula>?

Closes #221154

@github-actions github-actions bot added the meson label Apr 26, 2025
# https://github.com/Homebrew/homebrew-core/issues/221154
if OS.mac? && MacOS.version == :sequoia
inreplace "meson.build", "config_host_data.set('HAVE_STRCHRNUL', cc.has_function('strchrnul'))\n", ""
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be raised upstream?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if upstream can fix this issue. This is a Homebrew-specific issue that occurs because we build bottles for the latest macOS version. If we had separate runners for 15.0, 15.1, and other macOS versions this wouldn't happen.

The only way how QEMU maintainers could "fix" the issue is to explicitly remove strchrnul support on macOS Sequoia but it feels more like a workaround (and why would they do it if there's already cc.has_function('strchrnul') function that works well?)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See https://mesonbuild.com/Compiler-properties.html#does-a-function-exist

Note that, on macOS programs can be compiled targeting older macOS versions than the one that the program is compiled on. It can't be assumed that the OS version that is compiled on matches the OS version that the binary will run on.

Therefore when detecting function availability with compiler.has_function(), it is important to specify the correct header in the prefix argument.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have written an issue and suggested a fix to qemu: https://gitlab.com/qemu-project/qemu/-/issues/2935

@SMillerDev
Copy link
Member

I don't really think we should be shipping patches for minor versions of supported macOS releases. If you want it to work you can just update your device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Segmentation fault in qemu on macOS 15.0-15.3
3 participants