Author haypo
Recipients davidfraser, dmalcolm, haypo, joshbressers, pitrou
Date 2010-12-18.00:54:08
SpamBayes Score 1.17101e-12
Marked as misclassified No
Message-id <1292633651.94.0.879474934778.issue8863@psf.upfronthosting.co.za>
In-reply-to
Content
Version 9 of my patch:
 - Create PYTHONNOHANDLER environment variable: don't install the signal handler if the variable is set
 - Rename "Segfault" by "FaultHandler"
 - reverse_string() does nothing if len==0, even if it cannot occur when it's called by dump_decimal() and dump_hexadecimal().
 - _Py_DumpBacktrace() only writes the first 100 frames (arbitrary limit) to avoid unlimited loops

I don't know 100 frames is a good limit or not. Is it enough?

Summary of the patch:
 - Add a fault handler for SIGSEGV, SIGFPE, SIGBUS and SIGILL signals: display the Python backtrace and abort the process (call the debugger on Windows)
 - Add PYTHONNOHANDLER environment variable to disable the fault handler
 - The fault handler is implemented using only very simple instructions: it calls only signal-safe functions and it doesn't allocate memory (on the heap, only some bytes on the stack)
 - The fault handler uses an alternate stack to be able to display the backtrace (to be able to allocate memory on the stack and call functions)

The fault handler has no more the infinite loop issue (because the backtrace is truncated on frame loop).
History
Date User Action Args
2010-12-18 00:54:12hayposetrecipients: + haypo, davidfraser, pitrou, dmalcolm, joshbressers
2010-12-18 00:54:11hayposetmessageid: <1292633651.94.0.879474934778.issue8863@psf.upfronthosting.co.za>
2010-12-18 00:54:10haypolinkissue8863 messages
2010-12-18 00:54:10haypocreate