You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What version of protobuf and what language are you using?
Version: 2.6.1
Language: C++
What operating system (Linux, Windows, ...) and version?
Linux-like (Porting to some embedded board with ARM)
What runtime / compiler are you using (e.g., python version or gcc version)
gcc, g++ 6.5 (supporting cross-compiling for the OS above)
What did you do?
Application APP depends on libapp.so. libapp.so is built with protocol buffer static library libprotobuf.a which enables fPIC. Interface class is defined in libapp.so. APP calls public methods of that interface class.
At first, everything is fine. After that, as we need to shrink the size of app.so to accelerate the loading speed, it is required to build libapp.so with GCC option "-fvisibility=hidden".
To keep APP can still access the public methods of interface class in the libapp.so, I add "__attribute __((visibility("default")))" to the declarations of those public methods. The building succeeded.
But when APP is started, an exception of protocol buffer is thrown and APP is aborted. The error is as follow:
[libprotobuf ERROR XXXX/protobuf/descriptor_database.cc:57] File already exists in database: xxxx.proto
[libprotobuf FATAL XXXX/protobuf/descriptor.cc:1018] 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): Aborted.
The error is similar the the protobuf issue #863. But my problem is caused by the GCC symbol visibility option.
According to the error, it seems that the generated proto serializer was loaded twice. But only libapp.so includes the proto serializer.
What's the problem?
The text was updated successfully, but these errors were encountered:
@deannagarcia
I have occurred similar issue in 3.6.1
I build staic library call 'a.a' with hidden on and 'b.so' link with 'a.a'
executable 'c' link with b.so
What the actually diffenece between 3.6.1 and 4.22.0 which may solve the problem?
There are many differences between 3.6.1 and 4.22.0. Given that 3.6.1 was released 5 years ago it is outside our support window and we do not investigate issues. Please try using a newer version and create a new issue if you still see this.
What version of protobuf and what language are you using?
Version: 2.6.1
Language: C++
What operating system (Linux, Windows, ...) and version?
Linux-like (Porting to some embedded board with ARM)
What runtime / compiler are you using (e.g., python version or gcc version)
gcc, g++ 6.5 (supporting cross-compiling for the OS above)
What did you do?
[libprotobuf ERROR XXXX/protobuf/descriptor_database.cc:57] File already exists in database: xxxx.proto
[libprotobuf FATAL XXXX/protobuf/descriptor.cc:1018] 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): Aborted.
The error is similar the the protobuf issue #863. But my problem is caused by the GCC symbol visibility option.
According to the error, it seems that the generated proto serializer was loaded twice. But only libapp.so includes the proto serializer.
What's the problem?
The text was updated successfully, but these errors were encountered: