Skip to content
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

C++ protobufs can't be safely used in a mix of NDEBUG and !NDEBUG code #3322

Closed
htuch opened this issue Jul 6, 2017 · 0 comments
Closed

Comments

@htuch
Copy link
Contributor

htuch commented Jul 6, 2017

Due to code such as https://github.com/google/protobuf/blob/e3c807d4e752b477b707f5d021264faf9b127304/src/google/protobuf/map.h#L868, it's not in general safe to use a protobuf in one C++ module that is built with NDEBUG with code in another that is built without NDEBUG. E.g. passing an in-memory proto between the modules via a function call. This results in hard to discover corruptions of the mapped field hash table.

While this is acceptable in a monorepo, in general OSS where C++ dependencies are sourced from prebuilt libraries, this seems like a bad situation. Can we remove this in OSS protobuf?

htuch added a commit to htuch/envoy that referenced this issue Jul 7, 2017
Needed as a workaround for protocolbuffers/protobuf#3322. I'm going to work on an
upstream fix once I unblock current dependencies on the merge of
envoyproxy#1202.

This increases image size from 2.3GB to 2.9GB. While it might be possible to only rebuild
protobuf/lightstep, it's significantly more complicated throwaway build hacking to get there.
htuch added a commit to htuch/protobuf that referenced this issue Jul 7, 2017
htuch added a commit to envoyproxy/envoy that referenced this issue Jul 7, 2017
Needed as a workaround for protocolbuffers/protobuf#3322. I'm going to work on an
upstream fix once I unblock current dependencies on the merge of
#1202.

This increases image size from 2.3GB to 2.9GB. While it might be possible to only rebuild
protobuf/lightstep, it's significantly more complicated throwaway build hacking to get there.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant