From 7646b10a629e3d10eafdd297e275a24409379b7e Mon Sep 17 00:00:00 2001 From: Ken Jin Date: Tue, 13 Jan 2026 19:30:06 +0000 Subject: [PATCH 1/2] Limit executor growth --- Python/optimizer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Python/optimizer.c b/Python/optimizer.c index 79ac179d0b710a..8469966e379b98 100644 --- a/Python/optimizer.c +++ b/Python/optimizer.c @@ -72,6 +72,9 @@ get_index_for_executor(PyCodeObject *code, _Py_CODEUNIT *instr) } assert(size <= capacity); if (size == capacity) { + if (capacity * 2 >= MAX_EXECUTORS_SIZE) { + return -1; + } /* Array is full. Grow array */ int new_capacity = capacity ? capacity * 2 : 4; _PyExecutorArray *new = PyMem_Realloc( From ed05c8ebbd444a0943737a86c175ffcdfe8ed9a1 Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Tue, 13 Jan 2026 19:32:02 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../2026-01-13-19-31-56.gh-issue-143807.H5KP1C.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Core_and_Builtins/2026-01-13-19-31-56.gh-issue-143807.H5KP1C.rst diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2026-01-13-19-31-56.gh-issue-143807.H5KP1C.rst b/Misc/NEWS.d/next/Core_and_Builtins/2026-01-13-19-31-56.gh-issue-143807.H5KP1C.rst new file mode 100644 index 00000000000000..eb1a74ce784e7e --- /dev/null +++ b/Misc/NEWS.d/next/Core_and_Builtins/2026-01-13-19-31-56.gh-issue-143807.H5KP1C.rst @@ -0,0 +1 @@ +Place a limit on the number of JIT executors.