[Python-Dev] Issue #8863 adds a new PYTHONNOFAULTHANDLER environment variable (original) (raw)

Victor Stinner victor.stinner at haypocalc.com
Sat Dec 18 01:55:36 CET 2010


Hi,

In 2008, I proposed a patch to raise a Python exception on SIGSEVG signal. In some cases, it's possible to catch the exception, log it, and continue the execution. But because in some cases, the Python internal state is corrupted, the idea was rejected (see the issue #3999).

Someone asked me to display the Python backtrace on SIGSEGV, instead of raising an exception. I implemented this idea in issue #8863. After 9 versions, I think that the patch is ready for inclusion. It catchs SIGSEGV, SIGFPE, SIGBUS and SIGILL signals, and also display the Python backtrace on fatal errors. Because some operating systems have their own fault handler (eg. Ubuntu with apport), Dave Malcolm asked me to add an option disable the Python handler. That's why I added the PYTHONNOFAULTHANDLER environment variable (we all love long variable names!). For an OS vendor, it looks like an environment variable is more practical than a command line option. Eg. Mandriva sets PYTHONDONTWRITEBYTECODE for the whole system.

Raymond Hettinger asked me on IRC to write an email about the new environment variable, so here is the question: do you agree to add the new variable?

Victor



More information about the Python-Dev mailing list