faulthandler 1.0: display the Python backtrace on a crash

Victor Stinner victor.stinner at haypocalc.com
Fri Dec 24 15:11:29 CET 2010


faulthandler is an handler for SIGSEGV, SIGFPE, SIGBUS and SIGILL
signals: display the Python backtrace on a crash. Just import the module
to enable it.

https://github.com/haypo/faulthandler/wiki
http://pypi.python.org/pypi/faulthandler/

It works on Windows, Linux and FreeBSD with Python 2.6, 2.7, 3.1 and
3.2. I should work with Python 2.5 and on other OSes.

Tell me if the module works on your OS / Python version.

Dummy example of a segmentation fault on Linux:

    $ python
    >>> import faulthandler
    >>> faulthandler.isenabled()
    True
    >>> faulthandler.sigsegv()
    Fatal Python error: Segmentation fault

    Traceback (most recent call first):
      File "<stdin>", line 1 in <module>
    Segmentation fault

Victor Stinner




More information about the Python-announce-list mailing list