This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 0/2] Demangler crash handler
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: gbenson at redhat dot com
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 9 May 2014 13:20:24 +0200 (CEST)
- Subject: Re: [PATCH 0/2] Demangler crash handler
- Authentication-results: sourceware.org; auth=none
- References: <20140509100656 dot GA4760 at blade dot nx>
> Date: Fri, 9 May 2014 11:06:57 +0100
> From: Gary Benson <gbenson@redhat.com>
>
> Hi all,
>
> A number of bugs have been filed recently because of segmentation
> faults in the demangler. While such crashes are a problem for all
> demangler consumers, they are particularly nasty for GDB because they
> prevent the user from debugging their program at all.
>
> This patch series arranges for GDB to catch segmentation faults in the
> demangler and recover from them gracefully. A warning is printed the
> first time a fault occurs. Example sessions with and without these
> patches are included below.
>
> None of the wrapped code uses cleanups, so each caught failure will
> leak a small amount of memory. This is undesirable but I think the
> benefits here outweigh this drawback.
>
> Ok to commit?
No. It's this skind of duct-tape that will make sure that bugs in the
demangler won't get fixed. Apart from removing the incentive to fix
the bugs, these SIGSEGV signal handlers make actually fixing the bugs
harder as you won't have core dumps.
Besides, any signal handler that does more than just setting a flag is
probably broken. Did you verify that you only call async-signal-safe
functions in the signal handler code path?