Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Christian Biesinger (Code Review)" <gerrit@gnutoolchain-gerrit.osci.io>
To: Christian Biesinger <cbiesinger@google.com>,	gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@sourceware.org>
Subject: [review] Allow not saving the signal state in SIGSETJMP
Date: Wed, 16 Oct 2019 16:10:00 -0000	[thread overview]
Message-ID: <20191016161040.F17F720AF6@gnutoolchain-gerrit.osci.io> (raw)
In-Reply-To: <gerrit.1571181623000.Ib3010966050c64b4cc8b47d8cb45871652b0b3ea@gnutoolchain-gerrit.osci.io>

Christian Biesinger has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/124
......................................................................


Patch Set 2:

> Patch Set 2:
> 
> > Patch Set 2:
> > 
> > Thank you for doing this.
> > 
> > It seems reasonable to me.  My only question is: how do we know it works?
> > 
> > I guess one way would be to find a mangled string that causes a crash
> > (there may be some in bugzilla), then demangle it twice (using "demangle"
> > should be enough) -- the second time should still report the error.
> 
> I went the easy way:
> +    *(int*)0=0;
> 
> And got this output:
> ../../gdb/cp-support.c:1589: demangler-warning: unable to demangle '__progname' (demangler failed with signal 11)
> Unable to dump core, use `ulimit -c unlimited' before executing GDB next time.
> ../../gdb/cp-support.c:1603: demangler-warning: unable to demangle '__progname' (demangler failed with signal 11)
> A problem internal to GDB has been detected,
> further debugging may prove unreliable.
> Quit this debugging session? (y or n) n
> then:
> (gdb) demangle __progname
> Can't demangle "__progname"
> 
> 
> The same as without this patch applied.
> 
> Although I am confused because I don't see where error_reported gets reset.

In fact, with a printf in the signal handler, I get lots of output, so this does work.

Conversely, if I remove the sigprocmask call but keep the rest of the patch, I do get a segfault from gdb.

So this should be good!



  parent reply	other threads:[~2019-10-16 16:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-15 23:20 [review] Don't save " Christian Biesinger (Code Review)
2019-10-15 23:22 ` [review] Allow not saving " Christian Biesinger (Code Review)
2019-10-16 15:30 ` Tom Tromey (Code Review)
2019-10-16 15:54 ` Christian Biesinger (Code Review)
2019-10-16 16:10 ` Christian Biesinger (Code Review) [this message]
2019-10-16 17:59 ` Tom Tromey (Code Review)
2019-10-16 21:15 ` Sourceware to Gerrit sync (Code Review)
2019-10-16 21:15 ` Sourceware to Gerrit sync (Code Review)

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=20191016161040.F17F720AF6@gnutoolchain-gerrit.osci.io \
    --to=gerrit@gnutoolchain-gerrit.osci.io \
    --cc=cbiesinger@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@sourceware.org \
    /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