Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Pedro Alves <palves@redhat.com>
Cc: Pierre Muller <pierre.muller@ics-cnrs.unistra.fr>,
	       gdb-patches@sourceware.org
Subject: Re: catch SIGSEGV in the demangler
Date: Fri, 18 Jan 2013 18:09:00 -0000	[thread overview]
Message-ID: <87bocm749e.fsf@fleche.redhat.com> (raw)
In-Reply-To: <50F98CD9.5000600@redhat.com> (Pedro Alves's message of "Fri, 18	Jan 2013 17:56:41 +0000")

Tom> I'm primarily interested in opinions on whether this is even a good
Tom> idea.  I'm on the fence about it myself.

Pedro> Me too.  I'd rather all bugs in the demangler were fixed.  :-)

Yeah.  But there will be future crashes too.

Tom> It's far from clear that it is safe to call throw_exception from a
Tom> signal handler.

Pedro> Yeah.  It's risky.  It uses the heap (malloc/free), so
Pedro> if the wrapped code crashes within malloc or free (e.g.,
Pedro> corrupted heap), then the handler may e.g., deadlock
Pedro> (the handler crashing wouldn't be that bad, since we're
Pedro> already crashing).  It also calls clear_sigint_flag,
Pedro> which with python enabled is probably not very reentrant or
Pedro> async signal safe either, as it calls into python, which I can
Pedro> imagine to be a problem is you wrap all SEGVs throughtout
Pedro> GDB's execution, instead of just over the demangler, which
Pedro> won't normally call into python.

I think Python isn't an issue.  PyOS_InterruptOccurred is reasonably
unobjectionable.  It is a low-level thing, part of Python's own
signal-handling code.

We probably shouldn't call clear_quit_flag in there at all.
It wouldn't be hard to avoid this in the SEGV case at least.
That way a SEGV wouldn't obscure a QUIT.

Tom


  reply	other threads:[~2013-01-18 18:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-14 20:15 RFC: " Tom Tromey
2013-01-16 22:16 ` Pierre Muller
     [not found] ` <19236.9665638127$1358374641@news.gmane.org>
2013-01-17 19:56   ` Tom Tromey
2013-01-18 11:22     ` Pedro Alves
2013-01-18 15:01       ` Tom Tromey
2013-01-18 15:41         ` Pedro Alves
2013-01-18 16:09           ` Tom Tromey
2013-01-18 17:56             ` Pedro Alves
2013-01-18 18:09               ` Tom Tromey [this message]
2013-01-18 16:31       ` Tom Tromey
2013-01-18 16:59         ` Pedro Alves
2013-01-18 17:34     ` Tom Tromey

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=87bocm749e.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    --cc=pierre.muller@ics-cnrs.unistra.fr \
    /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