Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@mvista.com>
To: Mark Kettenis <kettenis@chello.nl>
Cc: gdb@sources.redhat.com
Subject: Re: i386-linux signal backtraces broken
Date: Sat, 12 Oct 2002 10:55:00 -0000	[thread overview]
Message-ID: <20021012175507.GA18048@nevyn.them.org> (raw)
In-Reply-To: <863crbpmvl.fsf@elgar.kettenis.dyndns.org>

On Sat, Oct 12, 2002 at 07:50:38PM +0200, Mark Kettenis wrote:
> Daniel Jacobowitz <drow@mvista.com> writes:
> 
> > There's only one problem here.  On my desktop (Debian GNU/Linux, glibc
> > 2.2.5), there are two copies of sigaction in a dynamically linked
> > executable.  One of them's in libc.so.6 and the other is in ld-linux.so.2.
> > The only __restore symbol we find is in ld-linux.so.2; this seems to be
> > because we leave a symbol table in ld-linux.so.2 (probably for the
> > debugger's benefit, so that it can find _dl_debug_state) - but we strip
> > libc.so.6.
> 
> How unfortunate.  I'd recommend using an unstripped libc.so.6 when
> doing any serious debugging, but I guess that won't trick the Debian
> folks into distributing an unstripped libc.

Never happen, I think.

> > Unfortunately, the application gets the copy of __restore that is in
> > libc.so.6.  Which is right after a function whose name appears in the
> > dynamic symbol table (sigaction).  So it's considered to be part of
> > sigaction, and NAME is "sigaction".
> > 
> > We have two choices, that I see:
> >   - Call the code inspection functions always
> >   - Call the code inspection functions if the name is sigaction, taking
> >     advantage of the glibc implementation detail that sigaction is the
> >     only exported name for this function that I can see, and they are
> >     implemented right after it in the same file.
> 
> We could also modify glibc such that __restore and __restore_rt get
> included in libc.so's dynamic symbol table.  Or perhaps we could
> modify GDB such that it scans libc.so.6 for signal trampolines when it
> is loaded.

I don't like the former very much; then we'll require a newer libc for
this to work.  The latter would work...

> > Option (A) is a performance hit.  Option (B) is, well, a little fragile.
> 
> I don't think implementing (B) makes the code more fragile than it
> already is.

That's true.  I'll put together a patch for (B) in a few days, then. 
After I finish the host of changes needed for MIPS GNU/Linux signal
backtracing... it's proving quite complicated :)

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


      reply	other threads:[~2002-10-12 17:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-10 11:46 Daniel Jacobowitz
2002-10-10 12:06 ` Kevin Buettner
2002-10-10 12:11   ` Daniel Jacobowitz
2002-10-12 10:50 ` Mark Kettenis
2002-10-12 10:55   ` Daniel Jacobowitz [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=20021012175507.GA18048@nevyn.them.org \
    --to=drow@mvista.com \
    --cc=gdb@sources.redhat.com \
    --cc=kettenis@chello.nl \
    /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