]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-152156: Fix a crash in `interpeters.create` under limited memory conditions (...
authorsobolevn <mail@sobolevn.me>
Fri, 26 Jun 2026 11:41:55 +0000 (14:41 +0300)
committerGitHub <noreply@github.com>
Fri, 26 Jun 2026 11:41:55 +0000 (14:41 +0300)
Misc/NEWS.d/next/Library/2026-06-25-10-07-54.gh-issue-152156.gscPU9.rst [new file with mode: 0644]
Modules/_interpchannelsmodule.c

diff --git a/Misc/NEWS.d/next/Library/2026-06-25-10-07-54.gh-issue-152156.gscPU9.rst b/Misc/NEWS.d/next/Library/2026-06-25-10-07-54.gh-issue-152156.gscPU9.rst
new file mode 100644 (file)
index 0000000..30e5612
--- /dev/null
@@ -0,0 +1,2 @@
+Fix a possible crash in :func:`concurrent.interpreters.create` under limited
+memory conditions.
index 3614890757d69da7d3ae34d72e4533ffb929a61c..05957081079d4a06dbe6488ad5a4dd68edc34a86 100644 (file)
@@ -2951,10 +2951,8 @@ channelsmod_create(PyObject *self, PyObject *args, PyObject *kwds)
                            &cidobj);
     if (handle_channel_error(err, self, cid)) {
         assert(cidobj == NULL);
-        err = channel_destroy(&_globals.channels, cid);
-        if (handle_channel_error(err, self, cid)) {
-            // XXX issue a warning?
-        }
+        assert(PyErr_Occurred());
+        (void)channel_destroy(&_globals.channels, cid);
         return NULL;
     }
     assert(cidobj != NULL);