From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Fri, 26 Jun 2026 12:09:07 +0000 (+0200) Subject: [3.14] gh-152156: Fix a crash in `interpeters.create` under limited memory conditions... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df7c9e1eda6a35ad2f10e522c6c1163164660217;p=thirdparty%2FPython%2Fcpython.git [3.14] gh-152156: Fix a crash in `interpeters.create` under limited memory conditions (GH-152163) (#152268) gh-152156: Fix a crash in `interpeters.create` under limited memory conditions (GH-152163) (cherry picked from commit 3ad66bf10dbb929bcf8efd889e56a9b9068319ca) Co-authored-by: sobolevn --- 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 index 000000000000..30e561274dc5 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2026-06-25-10-07-54.gh-issue-152156.gscPU9.rst @@ -0,0 +1,2 @@ +Fix a possible crash in :func:`concurrent.interpreters.create` under limited +memory conditions. diff --git a/Modules/_interpchannelsmodule.c b/Modules/_interpchannelsmodule.c index 183279fdce7d..09e0d310b00c 100644 --- a/Modules/_interpchannelsmodule.c +++ b/Modules/_interpchannelsmodule.c @@ -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);