-
Notifications
You must be signed in to change notification settings - Fork 15.6k
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
Python equality operator segfaults for non-set messages (21.2) #10208
Comments
I cannot reproduce the crash: $ cat crash.py |
The
|
Okay I finally have a test case that successfully crashes. Working on a fix now. |
protocolbuffers/protobuf#10208 PiperOrigin-RevId: 459604709
- Fix upb_Arena to correctly handle a NULL alloc pointer - Fix upb_Encode() to use the arena API instead of the alloc API Reference: protocolbuffers/protobuf#10208 PiperOrigin-RevId: 459604709
also fix upb_Encode() to use the arena API instead of the alloc API Reference: protocolbuffers/protobuf#10208 PiperOrigin-RevId: 459604709
Reference: protocolbuffers/protobuf#10208 PiperOrigin-RevId: 460623221
I've just pushed a fix so I am closing this ticket. Please let us know if you continue to see problems. Thank you for pointing this out. |
Reference: protocolbuffers/protobuf#10208 PiperOrigin-RevId: 460623221
What version of protobuf and what language are you using?
Version: 21.2
Language: Python
What operating system (Linux, Windows, ...) and version?
Linux / Windows / macOS all affected
What runtime / compiler are you using (e.g., python version or gcc version)
Python 3.9 / 3.10 both affected
What did you do?
Steps to reproduce the behavior:
protoc --python_out=. x.proto
python crash.py
What did you expect to see
Python should not crash
What did you see instead?
Python crashes with a segmentation fault
Stack trace from gdb:
The bug seems to be in upb's python bindings:
PyUpb_Message_IsEqual
is called which callsPyUpb_Message_GetIfReified
for the messages but does not handle null return values and callsupb_Message_IsEqual
with a null pointer which also does not handle that case.The text was updated successfully, but these errors were encountered: