This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 0/2] Demangler crash handler


> 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?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]