summaryrefslogtreecommitdiffstats
path: root/Modules/faulthandler.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-03-15 16:23:35 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2016-03-15 16:23:35 (GMT)
commit57003f81ead9ff38150c1e4821811c66c296d33c (patch)
tree032dc11bab422f9a5b5bc0e0470b8f9e9e9889f3 /Modules/faulthandler.c
parent4ddee7f5fd38137629eea15f3bf4b48dbdbcb356 (diff)
downloadcpython-57003f81ead9ff38150c1e4821811c66c296d33c.zip
cpython-57003f81ead9ff38150c1e4821811c66c296d33c.tar.gz
cpython-57003f81ead9ff38150c1e4821811c66c296d33c.tar.bz2
faulthandler: Test Py_FatalError() with GIL released
Issue #26558.
Diffstat (limited to 'Modules/faulthandler.c')
-rw-r--r--Modules/faulthandler.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c
index 14384b5..45c9fcb 100644
--- a/Modules/faulthandler.c
+++ b/Modules/faulthandler.c
@@ -935,10 +935,18 @@ static PyObject *
faulthandler_fatal_error_py(PyObject *self, PyObject *args)
{
char *message;
- if (!PyArg_ParseTuple(args, "y:fatal_error", &message))
+ int release_gil = 0;
+ if (!PyArg_ParseTuple(args, "y|i:fatal_error", &message, &release_gil))
return NULL;
faulthandler_suppress_crash_report();
- Py_FatalError(message);
+ if (release_gil) {
+ Py_BEGIN_ALLOW_THREADS
+ Py_FatalError(message);
+ Py_END_ALLOW_THREADS
+ }
+ else {
+ Py_FatalError(message);
+ }
Py_RETURN_NONE;
}