-
-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Basic protobuf usage segfaults #221740
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
Comments
Now that I'm out of the extremely restrictive issue template, I can finally describe what the issue actually is. The protobuf package, since a couple weeks ago, has an issue where it causes a segmentation fault even for trivial applications. It seems relevant to this bug on their issue tracker: protocolbuffers/protobuf#21447 I suspect that something about the way which Homebrew builds protobuf might trigger the issue, since if it was universal, they would otherwise have caught the issue in their tests in CI. Though I want to investigate further. |
I just checked out protobuf commit b407e8416e3893036aee5af9a12bd9b6a0e2b2e6 (the one tagged
And when I link against the resulting libprotobuf.dylib, my dummy application is able to parse the protobuf file without issues. I wonder if it's just a compiler version thing? I'm using "Apple clang version 17.0.0 (clang-1700.0.13.3)", the protobuf package might have been built with an older clang? |
29.3 is old enough that it would have been built with Apple Clang 16. The protobuf package has not been updated since January so if it only happened in the last couple weeks you say, the new compiler may be a possible cause. With that said, there usually isn't binary compatibility issues between compiler versions without there being an underlying bug somewhere (potentially even in the compiler), unless an Xcode release note states a breaking change otherwise. |
I just reinstalled protobuf from source with Why would this cause a problem? 🤷. But at least building from source is a workaround, and this issue will probably just fix itself whenever a protobuf package version compiled with Clang 17 is released. |
I've dispatched a build for new bottles: https://github.com/Homebrew/homebrew-core/actions/runs/14772098332 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Uh oh!
There was an error while loading. Please reload this page.
brew gist-logs <formula>
link ORbrew config
ANDbrew doctor
outputVerification
brew doctor
output saysYour system is ready to brew.
and am still able to reproduce my issue.brew update
and am still able to reproduce my issue.brew doctor
and that did not fix my problem.As you can see from by
brew doctor
output, I have the Vulkan SDK installed, and I have icu4c@76 installed because it's a dependency of a ton of packages. These things seem unrelated to the issue I'm describing here, so I will not uninstall the Vulkan SDK or icu4c@76 (+ dependents) just to make the output ofbrew doctor
clean, unless someone specifically asks for it.What were you trying to do (and why)?
I tried to use the Homebrew-packaged
protobuf
library to deserialize a serialized string.What happened (include all command output)?
It caused a segmentation fault.
What did you expect to happen?
It to not cause a segmentation fault.
Step-by-step reproduction instructions (by running
brew
commands)brew install protobuf
testmessage.proto
:main.cc
:protoc --cpp_out=. testmessage.proto
clang++ -std=c++20 -o main main.cc testmessage.pb.cc $(pkg-config --libs --cflags protobuf)
./main
You should see a segmentation fault error.
The text was updated successfully, but these errors were encountered: