Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fault handler for Python: display the Python backtrace on SIGSEGV, SIGFPE, SIGABRT, SIGBUS and SIGILL signals
Python C Shell
Failed to load latest commit information.
doc Added support for file descriptors
.gitignore ignore more generated files
AUTHORS Added Giuseppe Corbelli as contributor for thread name printout on Linux
COPYING
MANIFEST.in Add support for the ``PYTHONFAULTHANDLER`` environment variable.
README Add support for the ``PYTHONFAULTHANDLER`` environment variable.
TODO sync with cpython; set version to 2.0
faulthandler.c Added support for file descriptors
faulthandler.embed Generate the .pth file from something readable. Run `setup.py genpth`…
faulthandler.pth Generate the .pth file from something readable. Run `setup.py genpth`…
release.py Add release.py
releaser.conf Add releaser.conf
run_tests.sh
setup.py cleanup
tests.py [tests.py] Couple of unit tests for thread name and updated other tes…
tox.ini Drop Python 2.5 and 3.1 support; update changelog
traceback.c [traceback.c] Use #ifdef instead of #if for __gnu_linux__

README

+++++++++++++
Fault handler
+++++++++++++

Fault handler for SIGSEGV, SIGFPE, SIGABRT, SIGBUS and SIGILL signals: display
the Python traceback and restore the previous handler. Allocate an alternate
stack for this handler, if sigaltstack() is available, to be able to allocate
memory on the stack, even on stack overflow (not available on Windows).

Import the module and call faulthandler.enable() to enable the fault handler.

Alternatively you can set the PYTHONFAULTHANDLER environment variable to a
non-empty value.

The fault handler is called on catastrophic cases and so it can only use
signal-safe functions (eg. it doesn't allocate memory on the heap). That's why
the traceback is limited: it only supports ASCII encoding (use the
backslashreplace error handler for non-ASCII characters) and limits each string
to 100 characters, doesn't print the source code in the traceback (only the
filename, the function name and the line number), is limited to 100 frames and
100 threads.

By default, the Python traceback is written to the standard error stream. Start
your graphical applications in a terminal and run your server in foreground to
see the traceback, or pass a file to faulthandler.enable().

faulthandler is implemented in C using signal handlers to be able to dump a
traceback on a crash or when Python is blocked (eg. deadlock).

Website:
http://faulthandler.readthedocs.org/

faulthandler is part of Python since Python 3.3:
http://docs.python.org/dev/library/faulthandler.html

Something went wrong with that request. Please try again.