Status: New
Labels: Type-Defect Priority-Medium

New issue 370 by static initialization problem with dlopen

What steps will reproduce the problem?
1. create an application which contains foo/foo.pb.o (compiled with protoc from protobuf-2.4.1)
2. create a shared library with contains foo/foo.pb.o
3. run the application and then the application is going to dlopen() the shared library

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/] File already exists in database: foo/foo.proto libprotobuf FATAL google/protobuf/] CHECK failed: generated_database_->Add(encoded_file_descriptor, size): terminate called after throwing an instance of 'google::protobuf::FatalException' what(): CHECK failed: generated_database_->Add(encoded_file_descriptor, size):

What version of the product are you using?
Protobuf 2.4.1
On what operating system?
Debian wheezy

Please provide any additional information below.
If I changed src/google/protobuf/compiler/cpp/ to use non-static version of 'bool already_here' like in the attached file, the problem seems to be solved.

Attachments:  1.1 KB

You received this message because you are subscribed to the Google Groups "Protocol 
Buffers" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to