LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 11-05-2007, 03:39 PM   #1
lilzz
Member
 
Registered: Aug 2006
Posts: 73

Rep: Reputation: 15
execution error, complaining about libc


Hi,
I have xandros linux 2.6.9. and everything is smooth until
I try to run a new executable file named ABC and it complains symbol
__libc_stack_end, version GLIBC_2.1 not defined in file ld-linux.so.2
I check my /lib and found my ld-linux.so.2 is ld-2.3.2.so and libc-2.3.2.so

So, I get more later libc which is ld-2.5.so and libc-2.5.so I think that's the latest. I put the new libc into a folder and use LD_LIBRARY_PATH path to point to the new library.

Still, the execution file ABC doesn't run correctly. I know both libc-2.3.2 and libc_2.5 are setup correctly because other files able to run.

any ideas outthere?

thx
 
Old 11-05-2007, 04:57 PM   #2
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Re: execution error, complaining about libc

What is in your "/etc/ld.so.conf" file?
 
Old 11-05-2007, 05:45 PM   #3
lilzz
Member
 
Registered: Aug 2006
Posts: 73

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by David1357 View Post
What is in your "/etc/ld.so.conf" file?
I believe it's safer to use LD_LIBRARY_PATH variable, if it doesn't work, it just go back to default.

If you use /etc/ld.so.conf and something goes wrong, it will crash your system..
 
Old 11-05-2007, 07:04 PM   #4
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Re: execution error, complaining about libc

Quote:
Originally Posted by lilzz View Post
I believe it's safer to use LD_LIBRARY_PATH variable, if it doesn't work, it just go back to default.

If you use /etc/ld.so.conf and something goes wrong, it will crash your system...
Well, I have been compiling binaries from source for many years and using ld.so.conf to add library directories for the same amount of time and I have never crashed a machine.

However, the real point of my question was what is the current contents of your ld.so.conf file because the directories in there will also be searched for libraries.

Also, LD_LIBRARY_PATH only affects the current environment, so processes that are spawned by other means will not have the LD_LIBRARY_PATH set to the same value. If you do set the LD_LIBRARY_PATH in some global place, it is the same as adding a line to ld.so.conf, and therefore entails the same risk.

Now, once again, what are the current contents of your ld.so.conf file. It may be corrupt, or it may not be set up correctly.
 
Old 11-06-2007, 03:48 PM   #5
lilzz
Member
 
Registered: Aug 2006
Posts: 73

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by David1357 View Post
Also, LD_LIBRARY_PATH only affects the current environment, so processes that are spawned by other means will not have the LD_LIBRARY_PATH set to the same value. If you do set the LD_LIBRARY_PATH in some global place, it is the same as adding a line to ld.so.conf, and therefore entails the same risk.

Now, once again, what are the current contents of your ld.so.conf file. It may be corrupt, or it may not be set up correctly.
Hi,
My ld.so.conf only contains /usr/X11R6/lib. That's all.
ld.so.conf tells the system what the library in the cache.
System will check for LD_LIBRARY_PATH first and then the cache.


The system will automatically search for /lib and /usr/lib if no LD_LIBRARY_PATH specified. SO, when I specified LD_LIBRARY_PATH=myfolder/lib then it will override the default. IF this is corrupted, then all my binaries will not be able to execute. But only this particular ABC binary has issue.

thx
 
Old 11-07-2007, 10:13 AM   #6
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by lilzz View Post
Hi,
My ld.so.conf only contains /usr/X11R6/lib. That's all.
ld.so.conf tells the system what the library in the cache.
System will check for LD_LIBRARY_PATH first and then the cache.


The system will automatically search for /lib and /usr/lib if no LD_LIBRARY_PATH specified. SO, when I specified LD_LIBRARY_PATH=myfolder/lib then it will override the default. IF this is corrupted, then all my binaries will not be able to execute. But only this particular ABC binary has issue.

thx
Most system processes are spawned from init with a limited set of default environment variables. You'll have to poke around in /etc on your particular system to see what the default LD_LIBRARY_PATH is set to.

You will probably want to add "/usr/lib" and "/usr/local/lib" to to "ld.so.conf" and then run "ldconfig" to refresh the cache. This should get your program running.
 
Old 11-08-2007, 03:08 AM   #7
lilzz
Member
 
Registered: Aug 2006
Posts: 73

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by David1357 View Post
Most system processes are spawned from init with a limited set of default environment variables. You'll have to poke around in /etc on your particular system to see what the default LD_LIBRARY_PATH is set to.

You will probably want to add "/usr/lib" and "/usr/local/lib" to to "ld.so.conf" and then run "ldconfig" to refresh the cache. This should get your program running.
I have a simple question.
Let say I have a system with redhat /lib/ld-2.3.2.so 101KB
then another system with suse /lib/ld-2.3.2.so 88KB

Since the glibc is the same version both 2.3.2, why they have different size, which indicate they are 2 different file.

If I put the REDHAT ld-2.3.2.so into SUSE,could that cause error?
 
Old 11-08-2007, 03:20 AM   #8
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 676

Rep: Reputation: 137Reputation: 137
Quote:
Originally Posted by lilzz View Post
I have a simple question.
Let say I have a system with redhat /lib/ld-2.3.2.so 101KB
then another system with suse /lib/ld-2.3.2.so 88KB

Since the glibc is the same version both 2.3.2, why they have different size, which indicate they are 2 different file.

If I put the REDHAT ld-2.3.2.so into SUSE,could that cause error?
You can try, but it may be dangerous.
If you are want to move executables between different distro you can try to use magicErmine (http://magicErmine.com) or statifier (http://statifier.sf.net).

Both of them create self-contained exe without any dependencies.

Valery.
 
Old 11-08-2007, 09:22 AM   #9
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by lilzz View Post
I have a simple question.
Let say I have a system with redhat /lib/ld-2.3.2.so 101KB
then another system with suse /lib/ld-2.3.2.so 88KB

Since the glibc is the same version both 2.3.2, why they have different size, which indicate they are 2 different file.

If I put the REDHAT ld-2.3.2.so into SUSE,could that cause error?
Yes. Red Hat and Novell both maintain their own internal versions of a lot of Linux programs (most notably gcc) and they back port patches from the main-line version.

Also, you may be moving a library from an i686 system to an i586 system and you might cause a system crash.

Moving libraries willy-nilly from one distro to another is a very bad idea.
 
Old 11-08-2007, 07:22 PM   #10
lilzz
Member
 
Registered: Aug 2006
Posts: 73

Original Poster
Rep: Reputation: 15
I find out that the linux system will look and use file in /lib no matter what I try to tell the system to use /mystuff/lib through
LD_LIBRARY_PATH of ld.so.conf.


I did a test that copy the original /lib folder into /usr/test/lib
and did a LD_LIBRARY_PATH and also ld.so.conf pointing to /usr/test/lib.
now I rename /lib to /lib-old. So there's no more /lib available. Now all the shells are not working because /lib is no more.

I thought it would work because the original /lib copied to /usr/test/lib and it's pointing there. I thought if the system cannot find /lib and it smart enough to search /usr/test/lib and use the original library in new location.but it's not the case.

I wonder why.

thx

Last edited by lilzz; 11-08-2007 at 07:23 PM.
 
Old 11-09-2007, 05:18 AM   #11
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 676

Rep: Reputation: 137Reputation: 137
Quote:
Originally Posted by lilzz View Post
I find out that the linux system will look and use file in /lib no matter what I try to tell the system to use /mystuff/lib through
LD_LIBRARY_PATH of ld.so.conf.


I did a test that copy the original /lib folder into /usr/test/lib
and did a LD_LIBRARY_PATH and also ld.so.conf pointing to /usr/test/lib.
now I rename /lib to /lib-old. So there's no more /lib available. Now all the shells are not working because /lib is no more.

I thought it would work because the original /lib copied to /usr/test/lib and it's pointing there. I thought if the system cannot find /lib and it smart enough to search /usr/test/lib and use the original library in new location.but it's not the case.

I wonder why.

thx
Two things :
1) Path to program loader is hardcoded in the program and it's
/lib/ld-linux.so.2
It's loaded by the kernel and neither ld.conf nor LD_LIBRARY_PATH used to find it.

So, when you move /lib to /lib-old you made impossible to find
ld-linux.so.2

2) ld.conf not used to find libraries.
Used only /etc/ld.so.cache.

This file generated from /etc/ld.so.conf by the /sbin/ldconfig
program. I.e after you changed ld.so.conf in order to make this change effective you have to run /sbin/ldconfig.

But I whoiuld recommend instead of messing up your system use magicErmine (http://magicErmine.com) or statifier (http://statifier.sf.net).

Hmmm. I think that I already said it :)

Valery.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
libc++ compile error knobby67 Programming 6 05-11-2007 04:19 PM
Java execution error NL-Stitch Programming 3 03-24-2007 01:44 PM
GCC 3.4.3 libc.so error trainpic Linux From Scratch 3 03-09-2006 03:54 PM
script execution error linux_lover2005 Programming 3 12-22-2004 07:46 AM
libc.so relocation error??? SIR_Taco Slackware 1 11-24-2003 07:23 PM

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

All times are GMT -5. The time now is 06:36 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration