Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Thomas Ackermann <tja@anykey.de>
To: gdb@sourceware.org
Subject: Help with debugging LD_PRELOADed shared C libraries
Date: Thu, 13 Jul 2006 16:47:00 -0000	[thread overview]
Message-ID: <6780801.1152809218081.OPEN-XCHANGE.WebMail.wwwrun@eu.main.anykey> (raw)

Hello,
at first i asked at gcc-help, but it seems to be gdb-related:

I have a problem to debug my shared C libary which i use to fix an
existing binary.
I am loading this library via LD_PRELOAD variable, but sometimes the
programm crashes. Now i wan to find and fix the problem with gdb.

Regardless how i prelaod the library for the gdb session, gdb always
only gives "Cannot access memory at address ..." messages.

I tried "export LD_PRELOAD=/.../mylib.so" and then started "gdb mybin
core" or tried to set it within gdb: "set environment
LD_PRELOAD /.../mylib.so" and then continue with "file mybin" and "core
core", but:

Program terminated with signal 11, Segmentation fault.
#0 0x400cc9b8 in ?? ()
#0 0x400cc9b8 in ?? ()
End of crash report

That should be outputs from "bt", "info locals", "info
sharedlibrary" and "info frame".

Here in detail:

gdb mybin core
<...>
Program terminated with signal 11, Segmentation fault.
Cannot access memory at address 0x4001738c
#0 0x400cc9b8 in ?? ()
(gdb) bt
#0 0x400cc9b8 in ?? ()
Cannot access memory at address 0xbfffeddc
(gdb) info locals
No symbol table info available.

Both binary mybin and library mylib DO contain symbolic information as
confirmed via "nm".

The library was created with: "gcc -g3 -Wall -Wuninitialized
-D_GNU_SOURCE -fPIC -shared -ldl -o mylib.so mylib.c"

Can anybody give me a hint?


             reply	other threads:[~2006-07-13 16:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-13 16:47 Thomas Ackermann [this message]
2006-07-13 17:05 ` Daniel Jacobowitz
2006-07-13 17:38   ` Thomas Ackermann
2006-07-13 17:40     ` Daniel Jacobowitz
2006-07-13 18:55       ` Thomas Ackermann
2006-07-13 19:10         ` Daniel Jacobowitz
2006-07-13 22:14           ` Thomas Ackermann
2006-07-13 22:29             ` Daniel Jacobowitz
2006-07-14  1:22 ` Russell Shaw
2006-07-14 14:33   ` Thomas Ackermann
2006-07-14 16:31     ` Daniel Jacobowitz

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=6780801.1152809218081.OPEN-XCHANGE.WebMail.wwwrun@eu.main.anykey \
    --to=tja@anykey.de \
    --cc=gdb@sourceware.org \
    /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