From: Richard Earnshaw <rearnsha@arm.com>
To: Max <listposter@machsim.com>
Cc: gdb@sources.redhat.com, Richard.Earnshaw@arm.com
Subject: Re: Gdb LD_LIBRARY_PATH Problem
Date: Thu, 12 Dec 2002 07:51:00 -0000 [thread overview]
Message-ID: <200212121550.gBCFoiN19346@pc960.cambridge.arm.com> (raw)
In-Reply-To: Your message of "Thu, 12 Dec 2002 14:41:42 +0100." <3DF89216.4050203@machsim.com>
> Hi,
>
> I have an qt application whichis linked against a home made .so file.
> While app runs perfectly in the shell, it is not possible to run it in
> gdb due to the error :
>
> error while loading shared libraries: libDCcom.so
>
> I have gone thru all the posts in the mailing lists and newsgroups and
> google, but I still don't have a solution.
>
> When I do "set env LD_DEBUG=libs", I find something interesting. Gdb
> finds all libraries currently till the last one which is libDCcom.so.
> When gdb starts looking for this, it notices that the application has
> RPATH ( which is correct ) , searches the RPATHS and can not find it
> there which is also correct since the .so is not there, it is in the
> LD_LIBRARY_PATH.
>
> After looking for RPATH, gdb searches thru the LD_LIBRARY_PATH but !!!!
> this time the LD_LIBRARY_PATH is incorrect !!!! For all the searches
> before this shared object, the correct LD_LIBRARY_PATH is used however
> for the last .so , the LD_LIBRARY_PATH is broken.
>
> Can anybody give me a hint ?
A situation like this is often observed by csh users (or any similar
shell). The cause is normally that their .cshrc file sets LD_LIBRARY_PATH
back to a 'well-known' value. Since gdb starts an inferior process by
forking a $SHELL and then letting the shell run the real application you
get whatever LD_LIBRARY_PATH your .cshrc sets.
Setting environment variables in .cshrc is generally a bad idea, since
every subshell gets messed around by this. It's far better to put
environment settings into your .login file.
R.
prev parent reply other threads:[~2002-12-12 15:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-12 5:51 Max
2002-12-12 6:24 ` Roland Egger
2002-12-12 7:51 ` Richard Earnshaw [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200212121550.gBCFoiN19346@pc960.cambridge.arm.com \
--to=rearnsha@arm.com \
--cc=Richard.Earnshaw@arm.com \
--cc=gdb@sources.redhat.com \
--cc=listposter@machsim.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox