Based on the error message I think you have the right diagnosis of the
problem. There are a couple ways you could try to fix it:
1. Move the generated protobuf code into its own dylib so that the original
two dylibs don't include it themselves.
2. Alternatively, if you don't rely on protobuf reflection then you
can set option
optimize_for = LITE_RUNTIME; in the .proto file. That will remove
reflection support, and as a side effect the generated protos will not
register themselves in the process-wide descriptor pool (which is where the
crash came from). I think you would still have to be careful to avoid ODR
violations, so you might need to carefully set up the dylibs to hide their
generated protobuf symbols.
On Thu, Jul 25, 2019 at 10:11 AM { peetonn } <[email protected]> wrote:
> I'm getting a runtime error:
>
> *[libprotobuf ERROR google/protobuf/descriptor_database.cc:58] File
> already exists in database: content-meta-info.proto*
>
> *[libprotobuf FATAL google/protobuf/descriptor.cc:1358] CHECK failed:
> GeneratedDatabase()->Add(encoded_file_descriptor, size): *
>
> *libc++abi.dylib: terminating with uncaught exception of type
> google::protobuf::FatalException: CHECK failed:
> GeneratedDatabase()->Add(encoded_file_descriptor, size): *
>
> Which, I believe, happens because my macOS plugin code links against two
> .dylibs which use protobuf and, apparently, use same protobuf objects. (Is
> this assumption correct? How can I check it?)
>
> How one shall debug and fix this error (given dylibs are third-party)?
>
> Thanks,
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/protobuf/274860bb-6027-4324-9674-4ac9d21d1ca2%40googlegroups.com
> <https://groups.google.com/d/msgid/protobuf/274860bb-6027-4324-9674-4ac9d21d1ca2%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
--
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/protobuf/CADqAXr42uNzdQ-KAS_WPq6HbJPJCRMUVD6a%3DBO-8DyT5BrMQgg%40mail.gmail.com.