public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@broadcom.com>
To: Gary Benson <gbenson@redhat.com>, <gdb-patches@sourceware.org>
Cc: Doug Evans <xdje42@gmail.com>, Eli Zaretskii <eliz@gnu.org>,
	"Florian Weimer" <fw@deneb.enyo.de>,
	Mark Kettenis <mark.kettenis@xs4all.nl>,
	"Pedro Alves" <palves@redhat.com>, Tom Tromey <tromey@redhat.com>
Subject: Re: [PATCH 3/3 v4] Demangler crash handler
Date: Fri, 06 Jun 2014 21:12:00 -0000	[thread overview]
Message-ID: <53922EBD.7030300@broadcom.com> (raw)
In-Reply-To: <20140605130358.GD20572@blade.nx>

On 05/06/2014 2:03 PM, Gary Benson wrote:

> diff --git a/gdb/cp-support.c b/gdb/cp-support.c
> index 91533e8..f4dde70 100644
> --- a/gdb/cp-support.c
> +++ b/gdb/cp-support.c

> +
> +/* Signal handler for gdb_demangle.  */
> +
> +static void
> +gdb_demangle_signal_handler (int signo)
> +{
> +  if (gdb_demangle_attempt_core_dump)
> +    {
> +      if (fork () == 0)
> +	dump_core ();

This worries me a little, when a problem case occurs gdb will dump 
core regardless of the users ulimit setting, without first asking
the user, and doesn't tell the user that a core file was created.

This feels quite unexpected behaviour to me, especially the bit about
disregarding the ulimit setting without first asking for permission.

Catching the crash feels like a good idea, but I'd prefer that gdb ask
before circumventing the ulimit and dumping core.  Alternatively we
could just not dump core from gdb, report the bad symbol and let the
user file a bug.  With the demangler being so deterministic it should
be possible to reproduce, if not, then we just ask the user to turn
off the crash catch, adjust their ulimit (like we would with any other
gdb SEGV crash), and rerun the test.

If we really want to create the core file by default, but aren't going
to ask, then I'd propose we honour the ulimit setting, and make sure
that the user is told that a core file was just written.

Thanks,
Andrew


  parent reply	other threads:[~2014-06-06 21:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-05 13:01 [PATCH 0/3 " Gary Benson
2014-06-05 13:02 ` [PATCH 1/3 v4] Add new internal problem for demangler warnings Gary Benson
2014-06-05 13:03 ` [PATCH 2/3 v4] Refactor and expose core-dumping functionality Gary Benson
2014-06-05 16:28   ` Doug Evans
2014-06-06  9:09     ` Gary Benson
2014-06-05 13:04 ` [PATCH 3/3 v4] Demangler crash handler Gary Benson
2014-06-06 18:16   ` Florian Weimer
2014-06-06 19:27     ` Gary Benson
2014-06-06 19:42       ` Florian Weimer
2014-06-06 21:12   ` Andrew Burgess [this message]
2014-06-09  9:01     ` Gary Benson
2014-06-09 10:26       ` Andrew Burgess
2014-06-09 11:48         ` Gary Benson
2014-06-05 16:19 ` [PATCH 0/3 " Doug Evans
2014-06-06  9:19   ` Gary Benson

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=53922EBD.7030300@broadcom.com \
    --to=aburgess@broadcom.com \
    --cc=eliz@gnu.org \
    --cc=fw@deneb.enyo.de \
    --cc=gbenson@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=mark.kettenis@xs4all.nl \
    --cc=palves@redhat.com \
    --cc=tromey@redhat.com \
    --cc=xdje42@gmail.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).