From 7f7e9cf0ddd0cdf4a70a54c5179cc77822571c6c Mon Sep 17 00:00:00 2001 From: sobolevn Date: Thu, 25 Jun 2026 01:01:11 +0300 Subject: [PATCH 1/2] gh-151763: Fix crash in `_interpqueues.create` on `MemoryError` --- .../next/Library/2026-06-25-01-00-43.gh-issue-151763.wWeHBe.rst | 2 ++ Modules/_interpqueuesmodule.c | 1 + 2 files changed, 3 insertions(+) create mode 100644 Misc/NEWS.d/next/Library/2026-06-25-01-00-43.gh-issue-151763.wWeHBe.rst diff --git a/Misc/NEWS.d/next/Library/2026-06-25-01-00-43.gh-issue-151763.wWeHBe.rst b/Misc/NEWS.d/next/Library/2026-06-25-01-00-43.gh-issue-151763.wWeHBe.rst new file mode 100644 index 000000000000000..9a9184416f13ae2 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2026-06-25-01-00-43.gh-issue-151763.wWeHBe.rst @@ -0,0 +1,2 @@ +Fix crash in :func:`!_interpqueues.create` on :exc:`MemoryError` when +happens on queue creation. diff --git a/Modules/_interpqueuesmodule.c b/Modules/_interpqueuesmodule.c index 9979cd3457e1014..d203ddba7d9c3c9 100644 --- a/Modules/_interpqueuesmodule.c +++ b/Modules/_interpqueuesmodule.c @@ -1101,6 +1101,7 @@ queue_create(_queues *queues, Py_ssize_t maxsize, } int64_t qid = _queues_add(queues, queue); if (qid < 0) { + queue->alive = 0; _queue_clear(queue); GLOBAL_FREE(queue); } From fdd49a7c5d3252e7756e063f674840d91e02c6da Mon Sep 17 00:00:00 2001 From: sobolevn Date: Thu, 25 Jun 2026 09:33:40 +0300 Subject: [PATCH 2/2] Typo --- .../next/Library/2026-06-25-01-00-43.gh-issue-151763.wWeHBe.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Library/2026-06-25-01-00-43.gh-issue-151763.wWeHBe.rst b/Misc/NEWS.d/next/Library/2026-06-25-01-00-43.gh-issue-151763.wWeHBe.rst index 9a9184416f13ae2..2f5e84027ad31bb 100644 --- a/Misc/NEWS.d/next/Library/2026-06-25-01-00-43.gh-issue-151763.wWeHBe.rst +++ b/Misc/NEWS.d/next/Library/2026-06-25-01-00-43.gh-issue-151763.wWeHBe.rst @@ -1,2 +1,2 @@ -Fix crash in :func:`!_interpqueues.create` on :exc:`MemoryError` when +Fix crash in :func:`!_interpqueues.create` whe :exc:`MemoryError` happens on queue creation.