Message132110
| 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) |
|