From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3133 invoked by alias); 14 May 2008 18:13:43 -0000 Received: (qmail 3120 invoked by uid 22791); 14 May 2008 18:13:41 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 14 May 2008 18:13:14 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id AD6D5983FA; Wed, 14 May 2008 18:13:12 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 39D41983F9; Wed, 14 May 2008 18:13:12 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1JwLTT-0003W0-EG; Wed, 14 May 2008 14:13:11 -0400 Date: Wed, 14 May 2008 19:14:00 -0000 From: Daniel Jacobowitz To: Ulrich Weigand Cc: gdb-patches@sourceware.org Subject: Re: longjmp handling vs. glibc LD_POINTER_GUARD problems Message-ID: <20080514181311.GB13147@caradoc.them.org> Mail-Followup-To: Ulrich Weigand , gdb-patches@sourceware.org References: <200805141800.m4EI0IHe006471@d12av02.megacenter.de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200805141800.m4EI0IHe006471@d12av02.megacenter.de.ibm.com> User-Agent: Mutt/1.5.17 (2008-05-05) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-05/txt/msg00438.txt.bz2 On Wed, May 14, 2008 at 08:00:18PM +0200, Ulrich Weigand wrote: > To implement implement get_longjmp_target I'd have to retrieve > that guard value and demangle the pointers. This is of course > possible in principle -- but this assumes that the details of > where to find the guard value (typically somewhere in the > thread control block header) remain fixed across glibc versions. > I'm not sure we can actually rely on that. I couldn't find any > exported glibc mechanism to retrieve this value in a supported > way either ... Indeed, there isn't such a mechanism, and the mangling algorithm has changed at least once in the past. > I'm now wondering how we should handle this. Should be > implement an ad-hoc solution to retrieve the guard, which > may break in the future if glibc changes? Should we require > use of LD_POINTER_GUARD=0 (which switches off the pointer > guard mechanism) to enable debugging? Am I overlooking some > defined interface to get at the value? > > Why are we using the get_longjmp_target mechanism instead of > just stepping through longjmp until we see where we come out? Bingo. I discussed this with Pedro, in followups to one of his nine patches... ah, here it is. http://sourceware.org/ml/gdb-patches/2008-04/msg00252.html And stepping on platforms that don't provide a fetch routine, plus not providing fetch routines on platforms which mangle the pointer, is my best idea so far. Maybe dropping the fetcher entirely? Will that be too slow? -- Daniel Jacobowitz CodeSourcery