This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients davidfraser, dmalcolm, joshbressers, pitrou, vstinner
Date 2010-12-18.00:54:08
SpamBayes Score 1.1710077e-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:12vstinnersetrecipients: + vstinner, davidfraser, pitrou, dmalcolm, joshbressers
2010-12-18 00:54:11vstinnersetmessageid: <1292633651.94.0.879474934778.issue8863@psf.upfronthosting.co.za>
2010-12-18 00:54:10vstinnerlinkissue8863 messages
2010-12-18 00:54:10vstinnercreate