Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static initializers prevent using libraries which also use Protobuf #5914

Closed
klapstoelpiloot opened this issue Mar 19, 2019 · 1 comment
Closed
Assignees

Comments

@klapstoelpiloot
Copy link

What version of protobuf and what language are you using?
Version: v3.6.0
Language: C++

What operating system (Linux, Windows, ...) and version?
Linux Ubuntu 18.04

What runtime / compiler are you using (e.g., python version or gcc version)
GCC 7.3.0

What did you do?
Follow this link to see the steps to reproduce:
tensorflow/tensorflow#24976

What did you expect to see
I expect using Protobuf and Tensorflow (and any other library that uses Protobuf) to work fine together. Without using cumbersome workarounds like wrapping anything in an addition shared library.

What did you see instead?
Segmentation fault during static initialization.
See this link for more details:
tensorflow/tensorflow#24976

@acozzette
Copy link
Member

If I understand correctly it sounds like TensorFlow bundles its own copy of protobuf, resulting in ODR violations when TensorFlow users try to use both TensorFlow and protobuf. Unfortunately I don't think we can really do anything on the protobuf side to fix this, and the only solution is to avoid linking against two separate copies of protobuf. The static initializers are not the problem, because ultimately ODR violations are undefined behavior no matter what how we do our initialization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants