From: Tom Tromey <tromey@redhat.com>
To: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
Cc: <gdb-patches@sourceware.org>
Subject: Re: catch SIGSEGV in the demangler
Date: Thu, 17 Jan 2013 19:56:00 -0000 [thread overview]
Message-ID: <87622vd2vd.fsf@fleche.redhat.com> (raw)
In-Reply-To: <19236.9665638127$1358374641@news.gmane.org> (Pierre Muller's message of "Wed, 16 Jan 2013 23:16:34 +0100")
>>>>> "Pierre" == Pierre Muller <pierre.muller@ics-cnrs.unistra.fr> writes:
Pierre> sigaction is not available everywhere and is tested by configure
Pierre> see remote-sim.c:999
Pierre> I don't know the exact status of sigaltstack function, but
Pierre> I would be surprised that it is supported on systems that
Pierre> don't support sigaction...
Yeah, thanks.
Pierre> Also, sigaction can return the previous signal handler,
Pierre> so why not use this previous handle instead of SIG_DFL?
I don't mind changing this, but it seems like if this gives a result
other than SIG_DFL, then we've done something weird. There should be
only one handler installed.
Pierre> Would it make sense to still throw an exception even if not inside the
Pierre> demangler?
I was thinking of perhaps expanding the scope somewhat.
One idea I had was to introduce a new RETURN_SEGV to return_reason and
*not* add this to RETURN_MASK_ALL.
Then, have a special throw_segv that first looks to see if anything
expects to catch it, and if not, reset the handler and re-raise the
signal.
This way we could let code handle SEGV when appropriate, without tying
it to the demangler -- but also without catching all SEGVs that occur in
gdb.
I think we probably want to let some SEGVs through for the benefit of
external crash-catchers like ABRT. But, maybe not -- I've also been
wondering if a SEGV should be treated like internal_error instead.
Maybe sometimes gdb could limp on after a SEGV.
Pierre> I was also surprised by the fact that you called the new file
Pierre> safe-demangle.c, why not simply name it gdb-demangle.c?
I didn't want to confuse it with the existing demangle.c.
Tom
next prev parent reply other threads:[~2013-01-17 19:56 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 [this message]
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
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=87622vd2vd.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=gdb-patches@sourceware.org \
--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