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: catch SIGSEGV in the demangler


On 01/18/2013 04:08 PM, Tom Tromey wrote:
> 
> I'm primarily interested in opinions on whether this is even a good
> idea.  I'm on the fence about it myself.

Me too.  I'd rather all bugs in the demangler were fixed.  :-)

> It's far from clear that it is safe to call throw_exception from a
> signal handler.

Yeah.  It's risky.  It uses the heap (malloc/free), so
if the wrapped code crashes within malloc or free (e.g.,
corrupted heap), then the handler may e.g., deadlock
(the handler crashing wouldn't be that bad, since we're
already crashing).  It also calls clear_sigint_flag,
which with python enabled is probably not very reentrant or
async signal safe either, as it calls into python, which I can
imagine to be a problem is you wrap all SEGVs throughtout
GDB's execution, instead of just over the demangler, which
won't normally call into python.

So dunno either.

-- 
Pedro Alves


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