From d19163912bfc790283724f05328bd31e4e65003d Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 21 Jun 2021 13:15:40 +0200 Subject: bpo-44466: Faulthandler now detects the GC (GH-26823) The faulthandler module now detects if a fatal error occurs during a garbage collector collection (only if all_threads is true). --- Python/traceback.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Python/traceback.c') diff --git a/Python/traceback.c b/Python/traceback.c index 470324b1af..f7dc5ad686 100644 --- a/Python/traceback.c +++ b/Python/traceback.c @@ -4,6 +4,7 @@ #include "Python.h" #include "code.h" +#include "pycore_interp.h" // PyInterpreterState.gc #include "frameobject.h" // PyFrame_GetBack() #include "structmember.h" // PyMemberDef #include "osdefs.h" // SEP @@ -914,6 +915,9 @@ _Py_DumpTracebackThreads(int fd, PyInterpreterState *interp, break; } write_thread_id(fd, tstate, tstate == current_tstate); + if (tstate == current_tstate && tstate->interp->gc.collecting) { + PUTS(fd, " Garbage-collecting\n"); + } dump_traceback(fd, tstate, 0); tstate = PyThreadState_Next(tstate); nthreads++; -- cgit v1.2.1