views:

38

answers:

2

I have an application (for which I do not have the source code).

I know that it is designed to dynamically load a shared library, depending on the command line parameters.

I know which library it should be loading and I've set up LD_LIBRARY_PATH to the appropriate directory.

The application works on one server without any problems, but does not work on another.

I'm trying to figure out why and it would be helpful if I could confirm that the script is looking for the library that I think it is and if I could track where it is looking.

Are there any tools that could help me? I've been googling, but most of the information I'm finding is about ldd which really only tells you about statically linked libraries.

This is in a Linux environment and the application and library are both written in C

Thanks

+1  A: 

Use strace. You will see the libraries being searched etc., which will help you figure out what is happening.

rmk
Perfect. Turns out the libraries that were missing were not the ones being reported. `strace` made this immediately obvious.
Dancrumb
A: 

As every shared library is memory-mapped into the process's address space, you can also inspect the /proc/[PID]/maps file.

zvrba