-
Notifications
You must be signed in to change notification settings - Fork 423
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
Tensorflow is taking over my openssl and causing segfaults #417
Comments
I tried all solutions mentioned in tensorflow/tensorflow#34742, and nothing works. My final attempt was |
Are you pointing Rust to the TensorFlow library you built? There are instructions on how to do that at https://github.com/tensorflow/rust/blob/master/tensorflow-sys/README.md#manual-tensorflow-compilation. |
Yes, I moved the compiled objects into /usr/local/lib and ran ldconfig on the directory. |
+1 for me. All I do is open a http connection with the
|
I worked around this by placing libssl and libcrypto before tensorflow in order of priority above. Create a
and note that libssl and libcrypto are not before libtensorflow so it would never try to use tensorflow's statically linked ssl:
It's still broken for unit tests because to my knowledge there's no way to enforce the linking order in tests. Ideally libtensorflow should never be statically linked to openssl and let the binary choose its own libssl. |
So I recently added
tensorflow
to a rust project that had an external openssl dependency (reqwests
andpaho-mqtt
) and I immediately started seeing segfaults. The strange thing is that these segfaults are coming from crypto functions being called in thetensorflow_framework.so.2
library from frompaho-mqtt
(SSLSocket_initialize
in the core dump shown below). If I remove the paho-mqtt dependency on ssl, I see similar things withreqwests
Relevant Logs
This backtrace reliably occurs everytime I run my program.
Interestingly, here's what I see from ldd. Note that libssl.so.3 does correctly point to the real openssl, so I don't know why at runtime it gets linked to
tensorflow_framework.so.2
Note: I am using the latest rust versions and the latest versions of all packages mentioned here. Here's what my
uname -a
output looks like:Prior Art
The only other mention of this issue I could find was here tensorflow/tensorflow#34742, and I am currently trying to resolve my problem using the steps outlined in that issue.
Goals
A perfect fix would be for me to be able to seamlessly use tensorflow and openssl in a project without any tweaks, but I would consider this issue closed for me if we could find some workaround (environmental variables, build script or something similar) so that I could make my project run without segfaulting.
The text was updated successfully, but these errors were encountered: