From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15544 invoked by alias); 21 May 2008 19:38:27 -0000 Received: (qmail 15534 invoked by uid 22791); 21 May 2008 19:38:26 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 21 May 2008 19:38:07 +0000 Received: (qmail 1717 invoked from network); 21 May 2008 19:38:05 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 21 May 2008 19:38:05 -0000 From: Pedro Alves To: "Ulrich Weigand" Subject: Re: [patch] Re: longjmp handling vs. glibc LD_POINTER_GUARD problems Date: Thu, 22 May 2008 00:14:00 -0000 User-Agent: KMail/1.9.9 Cc: gdb-patches@sourceware.org, Daniel Jacobowitz References: <200805211920.m4LJKJXS016101@d12av02.megacenter.de.ibm.com> In-Reply-To: <200805211920.m4LJKJXS016101@d12av02.megacenter.de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200805212038.02924.pedro@codesourcery.com> 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/msg00648.txt.bz2 A Wednesday 21 May 2008 20:20:19, Ulrich Weigand wrote: > Pedro Alves wrote: > > ... here's an updated patch. The tests are the same as before. Tested > > on x86_86-unknown-linux-gnu, and confirmed longjmp.exp also passes > > cleanly on x86-pc-linux-gnu. > > > > What do you think? > > Looks like the right way to go for me. Unfortunately, I doesn't quite > work yet on the platforms I've tried it (s390, s390x, powerpc, powerpc64, > and spu) -- the "next" over > 110 call_longjmp (&env); /* patt2 */ > always causes the program to run to its end. I didn't get the chance yet > to debug this problem ... I had forgotten to that the longjmp breakpoints are only inserted when there's a gdbarch_get_longjmp_target implementation, and none of those target implements it ... If you're willing, could you try changing breakpoint.c:set_longjmp_breakpoint like so? void set_longjmp_breakpoint (void) { struct breakpoint *b; - if (gdbarch_get_longjmp_target_p (current_gdbarch)) - { create_longjmp_breakpoint ("longjmp"); create_longjmp_breakpoint ("_longjmp"); create_longjmp_breakpoint ("siglongjmp"); create_longjmp_breakpoint ("_siglongjmp"); - } } > > Another issue with your patch is the use of frame_id_inner ... I'd rather > get rid of this function instead of adding new uses, because this really > requires that it is possible to compare two stack (frame) addresses > along a linear order. This breaks for me in multi-architecture scenarios, > but even on existing targets it may not always work OK (e.g. if signal > handlers run on a different frame, or if the code uses some sort of > user-level threading or coroutine library ...). Maybe instead of > comparing frame_ids, it would be better to check whether or not a > frame with the given ID still exists in the current backtrace? Hmm, coroutines and different stacks, ... I had mentioned in the other threads it wouldn't work on those cases. ;-) OK. That may work too. I'll give it a try. -- Pedro Alves