[issue11393] Integrate faulthandler module into Python 3.3

STINNER Victor report at bugs.python.org
Wed Mar 30 00:29:47 CEST 2011


STINNER Victor <victor.stinner at haypocalc.com> added the comment:

I regenerated the patch.

Last changes:

 - I merged Antoine's new implementation of faulthandler.dump_backtraces_later() using a thread
 - dump_backtraces_later() has a new exit option: if exit=True, call _exit()
 - disable (remove) register() and unregister() on Windows just because these functions are useless. No signal can be used. Only SIGSEGV and SIGBUS can be handled by the process, and these signals cannot be used with register(), only with enable()
 - fix register() and unregister() to be "signal safe": don't move the signal list in memory (because of realloc) or free memory (on unregister) because the signal handler may be running at the same time. Use a static list instead, with a "enabled" flag per signal. The code becomes simpler.
 - fix register(): don't reinstall the signal if it was already installed
 - speed up the test: because dump_backtraces_later() has now a subsecond resolution, we can use sleep of 50 ms instead of 1 sec

It tested the patch on Linux and Windows: it works. Cool, dump_backtraces_later() is now also supported on Windows, thanks to Antoine!

My TODO list is empty (the last item was "fix register() to be signal safe") so I think that the patch is ready to be commited.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11393>
_______________________________________


More information about the Python-bugs-list mailing list