Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: "Ulrich Weigand" <uweigand@de.ibm.com>
Cc: gdb-patches@sourceware.org,  Daniel Jacobowitz <dan@codesourcery.com>
Subject: Re: [patch] Re: longjmp handling vs. glibc LD_POINTER_GUARD problems
Date: Thu, 22 May 2008 00:14:00 -0000	[thread overview]
Message-ID: <200805212038.02924.pedro@codesourcery.com> (raw)
In-Reply-To: <200805211920.m4LJKJXS016101@d12av02.megacenter.de.ibm.com>

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


  reply	other threads:[~2008-05-21 19:38 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-14 18:24 Ulrich Weigand
2008-05-14 19:14 ` Daniel Jacobowitz
2008-05-14 22:01   ` Ulrich Weigand
2008-05-14 19:17 ` Pedro Alves
2008-05-17 14:00   ` Pedro Alves
2008-05-21  4:20     ` [patch] " Pedro Alves
2008-05-22  0:11       ` Ulrich Weigand
2008-05-22  0:14         ` Pedro Alves [this message]
2008-05-22 15:20           ` Pedro Alves
2008-05-22 15:34             ` Daniel Jacobowitz
2008-05-22 16:17               ` Pedro Alves
2008-05-22 16:38                 ` Ulrich Weigand
2008-05-22 17:03                   ` [patch] Re: longjmp handling vs. glibc LD_POINTER_GUARD ?problems Daniel Jacobowitz
2008-05-22 16:29           ` [patch] Re: longjmp handling vs. glibc LD_POINTER_GUARD problems Ulrich Weigand
2008-05-22  3:14         ` Daniel Jacobowitz
2008-05-14 23:03 ` David Miller
2008-05-15  0:39   ` 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=200805212038.02924.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=dan@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=uweigand@de.ibm.com \
    /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