Labels: Type-Defect Priority-Medium
New issue 370 by ek.k...@gmail.com: static initialization problem with
What steps will reproduce the problem?
1. create an application which contains foo/foo.pb.o (compiled with protoc
2. create a shared library with contains foo/foo.pb.o
3. run the application and then the application is going to dlopen() the
What is the expected output?
Initialization of file descriptors with protobuf_AddDesc_* are just
invoked only at the startup of the application
Aborted What do you see instead?
Static initialization also occurs at the time of dlopen() and the
application crashes as follows.
libprotobuf ERROR google/protobuf/descriptor_database.cc:57] File already
exists in database: foo/foo.proto
libprotobuf FATAL google/protobuf/descriptor.cc:862] CHECK failed:
terminate called after throwing an instance
what(): CHECK failed: generated_database_->Add(encoded_file_descriptor,
What version of the product are you using?
On what operating system?
Please provide any additional information below.
If I changed src/google/protobuf/compiler/cpp/cpp_file.cc to use non-static
version of 'bool already_here' like in the attached file, the problem seems
to be solved.
cpp_file.cc.diff 1.1 KB
You received this message because you are subscribed to the Google Groups "Protocol
To post to this group, send email to email@example.com.
To unsubscribe from this group, send email to
For more options, visit this group at