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 Arfrever, Trundle, dmalcolm, lemburg, pitrou, scott.dial, vstinner
Date 2011-03-25.16:25:20
SpamBayes Score 2.6645353e-15
Marked as misclassified No
Message-id <1301070320.99.0.607666182323.issue11393@psf.upfronthosting.co.za>
In-reply-to
Content
Ok, here is a full patch tested on Linux and Windows:
 - Add faulthandler module (code, doc, tests) as a builtin module
 - Add "-X faulthandler=1" command line option and PYTHONFAULTHANDLER=1 en var to enable the fault handler at startup
 - Add _Py_DumpTraceback() and _Py_DumpTracebackThreads() functions to Python/traceback.c
 - Py_FatalError() calls _Py_DumpTraceback() if there is not exception
 - Initialize/Unload faulthandler explicitly in Py_InitializeEx()/Py_Finalize() to do it in the right order

I added a section in the doc to explain the file descriptor issue.

I merged different .c and .h files into faulthandler.c, the code is easier to read and maintain like that.

I don't know if the following test is the best test to check if SIGARLM constant and alarm() function are available:

+#ifdef SIGALRM
+#  define FAULTHANDLER_LATER
+#endif

(The test works at least on Linux and Windows)
History
Date User Action Args
2011-03-25 16:25:21vstinnersetrecipients: + vstinner, lemburg, scott.dial, pitrou, Arfrever, Trundle, dmalcolm
2011-03-25 16:25:20vstinnersetmessageid: <1301070320.99.0.607666182323.issue11393@psf.upfronthosting.co.za>
2011-03-25 16:25:20vstinnerlinkissue11393 messages
2011-03-25 16:25:20vstinnercreate