summaryrefslogtreecommitdiffstats
path: root/Modules/faulthandler.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2021-01-18 19:47:13 (GMT)
committerGitHub <noreply@github.com>2021-01-18 19:47:13 (GMT)
commit250035d134ad482e724f73ce654682254b513ee0 (patch)
tree48d2b3627adfe0b0e04aaaee25f35f4999cde254 /Modules/faulthandler.c
parentf7b5bacd7a0b2084ce699eda6f6f4b1adfa16590 (diff)
downloadcpython-250035d134ad482e724f73ce654682254b513ee0.zip
cpython-250035d134ad482e724f73ce654682254b513ee0.tar.gz
cpython-250035d134ad482e724f73ce654682254b513ee0.tar.bz2
bpo-42923: Dump extension modules on fatal error (GH-24207)
The Py_FatalError() function and the faulthandler module now dump the list of extension modules on a fatal error. Add _Py_DumpExtensionModules() and _PyModule_IsExtension() internal functions.
Diffstat (limited to 'Modules/faulthandler.c')
-rw-r--r--Modules/faulthandler.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c
index fe5dbc1..da8b774 100644
--- a/Modules/faulthandler.c
+++ b/Modules/faulthandler.c
@@ -1,5 +1,6 @@
#include "Python.h"
#include "pycore_initconfig.h" // _PyStatus_ERR
+#include "pycore_pyerrors.h" // _Py_DumpExtensionModules
#include "pycore_traceback.h" // _Py_DumpTracebackThreads
#include <signal.h>
#include <object.h>
@@ -349,6 +350,8 @@ faulthandler_fatal_error(int signum)
faulthandler_dump_traceback(fd, fatal_error.all_threads,
fatal_error.interp);
+ _Py_DumpExtensionModules(fd, fatal_error.interp);
+
errno = save_errno;
#ifdef MS_WINDOWS
if (signum == SIGSEGV) {