error while loading shared libraries: libcrypt.so.1: cannot open shared object file:
Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
error while loading shared libraries: libcrypt.so.1: cannot open shared object file:
I am trying to run under opensuse 12.1 the folowing executable
(here is the output from file:
sessmgr: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.5, not stripped)
and I always get the following error message :
sessmgr: error while loading shared libraries: libcrypt.so.1: cannot open shared object file: No such file or directory
I have set LD_ASSUME_KERNEL=2.2.5
The strange thing is that libcrypt.so.1 exists and all locations are set properly in LD_LIBRARY_PATH
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
Quote:
sessmgr: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
dynamically linked (uses shared libs), for GNU/Linux 2.2.5
Well, then please try : 'ldd sessmgr'
"sessmgr" could be an old file requiring a glibc object "2.2.5"
not present in the Suse 12.1 "glibc-2.14.1" files.
( libcrypt.so.1 is part of glibc-2.14.1 ).
LD_LIBRARY_PATH=/symbol/bp/lib:/lib:/usr/lib:/usr/local/lib
##### LD_LIBRARY_PATH=/symbol/lib:/symbol/usr/lib:/symbol/bp/lib:/lib:/usr/lib:/usr/local/lib
export LD_LIBRARY_PATH
==================================================================================================== ==
This a part of the shell script that sets LD_ASSUME_KERNEL and LD_LIBRARY_PATH.
The executable in question is compiled for kernel 2.2.5.
Here is the file program output : sessmgr: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.5, not stripped
And here is the "ls -l" you requested
lrwxrwxrwx 1 root root 23 Jun 15 19:08 /lib/libcrypt.so.1 -> /lib/libcrypt-2.14.1.so
please "ls -l /lib/libcrypt-2.14.1.so", to see whether it is existant, and see the permision.
and also can use the nm or ldd to /lib/libcrypt-2.14.1.so, to see whether it is valid.
all above is ok, then please cp it to your current directory (which your sessmgr locates), and rename it to libcrypt.so.1. and run again.
if still failed. we can write a test program, use dlopen, dlsym, dlclose (you can man dlopen to get enough help information) to test the libcrypt.so.1.
if the test is ok, then delete current directory libcrypt.so.1, and test again, if still ok, then it means libcrypt.so.1 is no problem, and the error which "sessmgr" generated is not the root cause of the issue (it is only the direct cause).
: )
IF all what I said above happened, then you can solve it in this way:
1) skip the program loading libraries in Makefile, to see what symbols can not be found.
2) comment all the calls for the unresolved symbols in your source code (maybe 90% source code must "deleted")
3) for basic symbols which not relative with libcrypt directly or indirectly, can let them uncomment (it will restore more than 85% source code).
4) for unresolved symbols, you can use nm or ldd (or another tools) to see which shared libraries they are located on, and then link them.
Please step by step to do these things, and be careful all the outputs of compiler and linker(need set -Wall), not skip every error and warning.
for every error or warning, if you do not know the meaning (or not know how to solve), you can ask the relative question here (in this thread).
Hope these information above may be helpful for you.
I also tried co cp the the library in the current directory as libcrypt.so.1 But nothing
I also changed the the mode of /lib/libcrypt-2.14.1.so to 777 But nothing again (Same message).
Unfortunately I have NOT the source code for "sessmgr" So I can't compile or relink
Looks like a desparate situation... And even more because all other binaries in the package are running without any problems
Ok, now I assume that you are also the tester or user of sessmgr, not the implementor of it (you can not get source code, it is not open source)
I think you can solve it in this way.
1) write a test program to test libcrypto.so, (can use dlopen, dlsym, dlclose lib c function to test, you can man dlopen to get more help).
2) if libcrypto.so truly no problem (mostly it is), can examine all logs of sessmgr outputs (maybe user verbos parameter, which is -v to let it output more logs).
3) find the help informations about it (relative local document, or google).
4) if all of above can not solve it (maybe truly happen), I think you can contact with the product provider (support team).
: )
Of cause has another way which can find the root cause of it, but it need more programming and disassemble skills:
1) use gdb to debug sessmgr (which is release version, and no source code)
2) set break point to dlopen function call.
3) run sessmgr in gdb.
4) when break point occur, can examine the input parameters and output results.
5) can also step into it to know more details of .so.
6) Please notice, for loading shared library, the disassembly code is a little complex, you truly need familiar with disassemble and know the shared library loading work flow, firstly.
7) I am sure, it is truly can get the root cause of this issue, but may be not quit suitable for normal users or testers.
At last, maybe I can not truly help you to solve the issue, but I hope these information are helpful for you.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.