Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Matt Welsh <mdw@cs.berkeley.edu>
To: gdb@sourceware.cygnus.com
Subject: Problem with LD_LIBRARY_PATH and gdb 4.18
Date: Wed, 01 Sep 1999 20:49:00 -0000	[thread overview]
Message-ID: <199909020352.UAA23561@bhikku.CS.Berkeley.EDU> (raw)

I'm using gdb 4.18 (although 4.16 exhibits the same problem) on a Linux x86
machine with glibc 2.1.1 (Red Hat 6.0). gdb fails to run any binaries which
require shared libraries not on the usual search path for ld.so, i.e. any
libraries located by LD_LIBRARY_PATH.

Setting LD_LIBRARY_PATH or gdb 'set solib-search-path' has no effect. Here
is what I see:

> enclave1:~/src/ninja/test/mdw% echo $LD_LIBRARY_PATH
> /home/cs/mdw/lib:/usr/local/ninja/gcc-2.95.1/lib
> enclave1:~/src/ninja/test/mdw% gdb TestT
> GNU gdb 4.18
> Copyright 1998 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you are
> welcome to change it and/or distribute copies of it under certain conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for details.
> This GDB was configured as "i386-redhat-linux"...
> (gdb) run   
> Starting program: /disks/now/grad/mdw/src/ninja/test/mdw/TestT 
> /disks/now/grad/mdw/src/ninja/test/mdw/TestT: error in loading shared libraries: libgcj.so.0: cannot open shared object file: No such file or directory
>
> Program exited with code 0177.

In this case, libgcj.so.0 is found in the LD_LIBRARY_PATH. I can run the
program just fine directly from the shell, but not from within gdb.

I can 'attach' to the running process from gdb, however, in some cases I 
wish to test the code as it's starting, so this is not good enough.

If I set LD_LIBRARY_PATH and run 'strace TestT' from within gdb, it's
obvious that ld.so is not looking for the library in any directories on the
LD_LIBRARY_PATH. Is it possible that gdb is not passing along the value of
this environment variable?

Thanks much,
Matt Welsh, mdw@cs.berkeley.edu


             reply	other threads:[~1999-09-01 20:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-09-01 20:49 Matt Welsh [this message]
1999-09-01 22:55 ` Kevin Buettner
     [not found] <19990901230402.A19637@cygnus.com>
1999-09-01 23:30 ` Matt Welsh

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=199909020352.UAA23561@bhikku.CS.Berkeley.EDU \
    --to=mdw@cs.berkeley.edu \
    --cc=gdb@sourceware.cygnus.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