LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-27-2011, 09:38 AM   #1
dileep
LQ Newbie
 
Registered: Sep 2011
Posts: 2

Rep: Reputation: Disabled
cannot open shared object file


I get this error when I try to run a binary
error while loading shared libraries: libXXX.so.0: cannot open shared object file: No such file or directory

First off this is not a LD_LIBRARY_PATH issue. The path is fine. Issue is, it runs fine when I run as userA, but I get this error when I run as user B.
Both are launched off the same scripts which set the LD_LIBRARY_PATH the same - it shows me the correct path before it runs.
The library libXXX.so is in a path owned by userA, but userB has full permissions to it.
Any ideas why?
Thanks
 
Old 09-27-2011, 09:41 AM   #2
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Hello,

Perform the following:
Code:
ldd /path/to/binary/binary
Of course, put the path to the binary there. This will show you any problems with libraries. I know you said that the path is good, but I just want to verify. As far as the permissions issue, run the following and post the output if you can:
Code:
ls -al /path/to/library/libxxxxx.so
I'm curious as to what the permissions are for the library, since user B can not access it.

Cheers,

Josh
 
Old 09-27-2011, 09:50 AM   #3
dileep
LQ Newbie
 
Registered: Sep 2011
Posts: 2

Original Poster
Rep: Reputation: Disabled
As I said, ld path is not the issue. ldd shows me the correct dir for the libs as expected.
The permissions are
Dir
drwxrwxrwx 2 userA AllGroup--1 4096 Sep 26 16:47 lib/

Actual file:
-rwxrwxrwx 1 userA AllGroup--1 3224479 Sep 26 16:47 lib/libXXX.so
 
Old 01-26-2012, 04:55 PM   #4
linux-bigot
LQ Newbie
 
Registered: May 2010
Location: Illinois (USA)
Distribution: RHEL 6.2 & kbuntu 11.10
Posts: 5

Rep: Reputation: 1
Did you ever discover the solution to this problem?

I seem to be having a very similar problem on a RHEL6 host. Like you, my LD_LIBRARY_PATH is correctly set for the second user but he cannot execute the binary. Permissions are like yours above (except no other write priv).

Also, I can get the binary to execute for the second user by running it through strace. i.e.
Code:
strace -o error.log binary
This is what makes me believe it's a permissions issue since strace is often installed setuid to root.
 
Old 01-26-2012, 07:15 PM   #5
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
linux-bigot seeing as you ARE paying red hat for the REQUIRED yearly support contract .
Did you look on the red hat site ?

search here
https://access.redhat.com/knowledge/search

but to read the documents you WILL need to log in to your red hat account

and have a read through the manuals
https://access.redhat.com/knowledge/...erprise_Linux/
 
Old 01-27-2012, 08:50 AM   #6
linux-bigot
LQ Newbie
 
Registered: May 2010
Location: Illinois (USA)
Distribution: RHEL 6.2 & kbuntu 11.10
Posts: 5

Rep: Reputation: 1
John VV,
No, I haven't checked RH's site. I'm just an end user at the company so I don't actually have an acct with RH. I just recently attributed my problem to being privileges so I checked lq first. (Always a good place to start) :-)

My next move is to engage our IT dept who are usually swamped with work which might take longer for a resolution.

I'll also check with the IT folks to see if I could be assigned a RH acct.
 
Old 02-22-2012, 05:08 PM   #7
linux-bigot
LQ Newbie
 
Registered: May 2010
Location: Illinois (USA)
Distribution: RHEL 6.2 & kbuntu 11.10
Posts: 5

Rep: Reputation: 1
LD_LIBRARY_PATH problem SOLVED! (for me at least)

All,
Just a follow-up in case anyone is following this thread. After way too much time with this, I finally discovered why our application wasn't using LD_LIBRARY_PATH.

My problem stemmed from the fact that the app was installed on Linux systems as a set user-id root executable as the default. It was done that way in order to allow access to privileged I/O ports and memory mapping. A security feature of Linux is that set user-id root executables require system level shared library configuration. So any LD_LIBRARY_PATH settings are ignored.

You can change the modes with
Code:
 chmod u-s /path/to/the/app
But this might be a problem if you still need the app to be setuid.

I also discovered a Linux utility called 'patchelf' which will edit an elf binary and internally modify the rpath which negates the need for LD_LIBRARY_PATH. patchelf might already be installed on your system, if not you can download and install it. You can use it thusly
Code:
 patchelf --set-rpath /path/to/lib  /path/to/the/app
Hopefully this might be of use to someone.

-J
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
error while loading shared libraries: libgda-4.0.so.4: cannot open shared object file mahesh1234 Linux - Newbie 2 10-22-2013 11:06 PM
error while loading shared libraries: libstdc++.so.5: cannot open shared object file: Franziss Linux - Newbie 10 06-28-2010 05:47 AM
error while loading shared libraries: libhid.so.0: cannot open shared object file: No misungs Linux - Software 4 06-10-2009 12:05 PM
error while loading shared libraries: libstdc++.so.5: cannot open shared object file PaulyWally Debian 2 10-18-2008 05:59 PM
error while loading shared libraries: libgvc.so.3: cannot open shared object file coolrock Slackware 6 01-17-2007 05:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration