This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 0/2 v3] Demangler crash handler
- From: Doug Evans <xdje42 at gmail dot com>
- To: Andrew Burgess <aburgess at broadcom dot com>
- Cc: Gary Benson <gbenson at redhat dot com>, Mark Kettenis <mark dot kettenis at xs4all dot nl>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, Eli Zaretskii <eliz at gnu dot org>, Florian Weimer <fw at deneb dot enyo dot de>, Pedro Alves <palves at redhat dot com>, Tom Tromey <tromey at redhat dot com>
- Date: Wed, 4 Jun 2014 08:52:08 -0700
- Subject: Re: [PATCH 0/2 v3] Demangler crash handler
- Authentication-results: sourceware.org; auth=none
- References: <20140604100755 dot GA7570 at blade dot nx> <201406041027 dot s54ARXYL017073 at glazunov dot sibelius dot xs4all dot nl> <20140604133413 dot GA10121 at blade dot nx> <538F3300 dot 6010700 at broadcom dot com>
On Wed, Jun 4, 2014 at 7:53 AM, Andrew Burgess <aburgess@broadcom.com> wrote:
>> "Should" is the operative word here. It *should* not be necessary
>> because the demangler *should* never crash. But this isn't utopia.
>> The demangler is code, and code has bugs. People make mistakes.
>> Things are valid now that may not be valid in the future. And GDB
>> should not just crash if some symbol in the inferior isn't handled
>> or doesn't make sense or whatever.
>
> By this logic should / would we not extend the SIGSEGV handler to cover
> all gdb code? If the target is running in synchronous mode we'd
> install our SEGV handler when the target stops and remove it when the
> target restarts (asynchronous mode would need more thought), then any
> bugs in gdb that cause a SEGV would result in a core dump ...
>
> I'm just not sure why the demangler should get special treatment.
It has a very specific entry point, and thus adding one here is easy
(setting aside the technicalities of the implementation).
I'd say this is ok if only to provide a proving ground for whether
this is useful in practice.