Skip to content

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

@htuch

Description

@htuch

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions