views:

78

answers:

2

I'm troubleshooting a C++ binary on RHEL/CentOS 5, which has problems with the openssl shared libraries. I don't do much C/C++ programming, and I'm having trouble finding the root issue.

What seems to be going wrong is that the application is linking to specific versions of libcrypto and libssl (0.9.8), instead of the symlinked paths of /lib/libcrypto.so.6 and /lib/libssl.so.6. Since the openssl libs have been updated since this was compiled, it's now broken.

ldd shows the following 2 problems with the binary:

libcrypto.so.0.9.8 => not found
libssl.so.0.9.8 => not found

[EDIT] I obtained the source, and it built correctly. I'm going to have to go with the simplest possible explanation, the build machine was misconfigured with non-standard libraries, and the makefiles are fine.

A: 

D'oh, I'd misread the question as troubleshooting a binary that you were building yourself.


You can use ldd your-binary to check which libraries it will load at runtime.

If it's deliberately loading a different version, you should check the LD_LIBRARY_PATH environment and the loader configuration in /etc/ld.so.config for the list of paths to load libraries from. Alternatively the loader path might be hard-coded into your binary using -rpath switches on the link line - look for these in your Makefile.

Rup
Sorry, should have added ldd output in my question.
JimB
A: 

A couple suggestions (i'm assuming you have no way of getting a new binary that links to the new versions of the ssl libs):

  1. Get the old versions of the libs from the previous version of the package and keep them around just for your binary (you could put them somewhere out of /usr/lib and load them just for your program with LD_LIBRARY_PATH).

  2. Force loading the new versions of the libs with LD_PRELOAD and hope all the symbols the binary needs are there and the binary actually runs. This has a quite slim chance of working, but it's worth a try.

Torp
I know I could load the older libraries, and I *think* that I can force the new ones in by preloading them, or adding appropriate symlinks, but I want to track down the cause of the issue; both for myself, so I can learn what went wrong, and so I can provide more information to the developer.
JimB
Oops, misread the question. Searching for this it looks like libcrypto.so.6 is the usual name for OpenSSL 0.9.8's libraries so I guess your binary was built by someone using a different distro that names them differently. In which case I'd go with 2 here, or even just add symlinks in /lib for libcrypto.so.0.9.8 -> libcrypto.so.6 etc. I'd guess your existing libraries would actually work. Just seen your comment: I'd ask your developer what distro they're using because I expect it's related to that.
Rup
@Rup - It was *supposed* to have been built on the same platform ;) That's a good point that it may have been on a system where the openssl libraries were simply named differently. I'm attempting to rebuild it myself to test, but it's a chore - waiting for QT to compile right now.
JimB