This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 3/3 v4] Demangler crash handler
- From: Andrew Burgess <aburgess at broadcom dot com>
- To: Gary Benson <gbenson at redhat dot com>, <gdb-patches at sourceware dot org>
- Cc: Doug Evans <xdje42 at gmail dot com>, Eli Zaretskii <eliz at gnu dot org>, "Florian Weimer" <fw at deneb dot enyo dot de>, Mark Kettenis <mark dot kettenis at xs4all dot nl>, "Pedro Alves" <palves at redhat dot com>, Tom Tromey <tromey at redhat dot com>
- Date: Fri, 6 Jun 2014 22:12:29 +0100
- Subject: Re: [PATCH 3/3 v4] Demangler crash handler
- Authentication-results: sourceware.org; auth=none
- References: <20140605130140 dot GA20572 at blade dot nx> <20140605130358 dot GD20572 at blade dot 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