Status: New
Owner: liuj...@google.com
Labels: Type-Defect Priority-Medium

New issue 370 by ek.k...@gmail.com: static initialization problem with dlopen
http://code.google.com/p/protobuf/issues/detail?id=370

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/descriptor_database.cc:57] File already exists in database: foo/foo.proto libprotobuf FATAL google/protobuf/descriptor.cc:862] 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/cpp_file.cc to use non-static version of 'bool already_here' like in the attached file, the problem seems to be solved.


Attachments:
        cpp_file.cc.diff  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 protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

Reply via email to