comparison Python/pythonrun.c @ 69888:8752a81ada2d

faulthandler: dump all threads by default * Set the default value of all_threads arguments to True * Py_FatalError() dumps all threads, instead of only the current thread Dump only the current thread is not reliable. In some cases, Python is unable to retrieve the state of the current thread and so is unable to dump the traceback. faulthandler keeps a reference to the interpreter and so is always able to dump the traceback of all threads.
author Victor Stinner <victor.stinner@haypocalc.com>
date Sat, 07 May 2011 12:43:00 +0200
parents c892b0321d23
children 94e3c44b0662
comparison
equal deleted inserted replaced
69887:bae531098e68 69888:8752a81ada2d
2142 else { 2142 else {
2143 tstate = _Py_atomic_load_relaxed(&_PyThreadState_Current); 2143 tstate = _Py_atomic_load_relaxed(&_PyThreadState_Current);
2144 if (tstate != NULL) { 2144 if (tstate != NULL) {
2145 fputc('\n', stderr); 2145 fputc('\n', stderr);
2146 fflush(stderr); 2146 fflush(stderr);
2147 _Py_DumpTraceback(fd, tstate); 2147 _Py_DumpTracebackThreads(fd, tstate->interp, tstate);
2148 } 2148 }
2149 _PyFaulthandler_Fini(); 2149 _PyFaulthandler_Fini();
2150 } 2150 }
2151 2151
2152 #ifdef MS_WINDOWS 2152 #ifdef MS_WINDOWS