From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18412 invoked by alias); 12 Oct 2002 17:50:47 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 18404 invoked from network); 12 Oct 2002 17:50:45 -0000 Received: from unknown (HELO walton.kettenis.dyndns.org) (62.163.169.250) by sources.redhat.com with SMTP; 12 Oct 2002 17:50:45 -0000 Received: from elgar.kettenis.dyndns.org (elgar.kettenis.dyndns.org [192.168.0.2]) by walton.kettenis.dyndns.org (8.12.5/8.12.5) with ESMTP id g9CHodMs000321; Sat, 12 Oct 2002 19:50:39 +0200 (CEST) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: from elgar.kettenis.dyndns.org (localhost [127.0.0.1]) by elgar.kettenis.dyndns.org (8.12.6/8.12.6) with ESMTP id g9CHodXD000923; Sat, 12 Oct 2002 19:50:39 +0200 (CEST) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: (from kettenis@localhost) by elgar.kettenis.dyndns.org (8.12.6/8.12.6/Submit) id g9CHocRk000920; Sat, 12 Oct 2002 19:50:38 +0200 (CEST) (envelope-from kettenis) To: Daniel Jacobowitz Cc: gdb@sources.redhat.com Subject: Re: i386-linux signal backtraces broken References: <20021010184739.GA15971@nevyn.them.org> From: Mark Kettenis Date: Sat, 12 Oct 2002 10:50:00 -0000 In-Reply-To: Daniel Jacobowitz's message of "Thu, 10 Oct 2002 14:47:39 -0400" Message-ID: <863crbpmvl.fsf@elgar.kettenis.dyndns.org> X-SW-Source: 2002-10/txt/msg00111.txt.bz2 Daniel Jacobowitz 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. > 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. > 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. Mark