Python3: update to 3.11.1

This commit is contained in:
Rudi Heitbaum 2022-12-07 12:38:11 +00:00
parent 32d2d3a67b
commit aba1a4e598
2 changed files with 2 additions and 64 deletions

View File

@ -3,8 +3,8 @@
PKG_NAME="Python3"
# When changing PKG_VERSION remember to sync PKG_PYTHON_VERSION!
PKG_VERSION="3.11.0"
PKG_SHA256="a57dc82d77358617ba65b9841cee1e3b441f386c3789ddc0676eca077f2951c3"
PKG_VERSION="3.11.1"
PKG_SHA256="85879192f2cffd56cb16c092905949ebf3e5e394b7f764723529637901dfb58f"
PKG_LICENSE="OSS"
PKG_SITE="https://www.python.org/"
PKG_URL="https://www.python.org/ftp/python/${PKG_VERSION}/${PKG_NAME::-1}-${PKG_VERSION}.tar.xz"

View File

@ -1,62 +0,0 @@
From 27763ef6ac5ad9d70dba68bf9c2c910ef1ddcded Mon Sep 17 00:00:00 2001
From: Brandt Bucher <brandtbucher@microsoft.com>
Date: Wed, 9 Nov 2022 13:55:20 -0800
Subject: [PATCH] GH-99205: Mark new interpreters and threads as non-static
(GH-99268) (cherry picked from commit
283ab0e1c002f2d7459d581df6b4b8599e7d1a4d)
Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
---
.../2022-11-08-16-35-25.gh-issue-99205.2YOoFT.rst | 2 ++
Python/pystate.c | 8 ++++++++
2 files changed, 10 insertions(+)
create mode 100644 Misc/NEWS.d/next/Core and Builtins/2022-11-08-16-35-25.gh-issue-99205.2YOoFT.rst
diff --git a/Misc/NEWS.d/next/Core and Builtins/2022-11-08-16-35-25.gh-issue-99205.2YOoFT.rst b/Misc/NEWS.d/next/Core and Builtins/2022-11-08-16-35-25.gh-issue-99205.2YOoFT.rst
new file mode 100644
index 000000000000..8ad0e147c203
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2022-11-08-16-35-25.gh-issue-99205.2YOoFT.rst
@@ -0,0 +1,2 @@
+Fix an issue that prevented :c:type:`PyThreadState` and
+:c:type:`PyInterpreterState` memory from being freed properly.
diff --git a/Python/pystate.c b/Python/pystate.c
index 425065322ebd..c0d161f894c9 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -341,6 +341,7 @@ PyInterpreterState_New(void)
interp = &runtime->_main_interpreter;
assert(interp->id == 0);
assert(interp->next == NULL);
+ assert(interp->_static);
interpreters->main = interp;
}
@@ -355,6 +356,9 @@ PyInterpreterState_New(void)
// Set to _PyInterpreterState_INIT.
memcpy(interp, &initial._main_interpreter,
sizeof(*interp));
+ // We need to adjust any fields that are different from the initial
+ // interpreter (as defined in _PyInterpreterState_INIT):
+ interp->_static = false;
if (id < 0) {
/* overflow or Py_Initialize() not called yet! */
@@ -817,6 +821,7 @@ new_threadstate(PyInterpreterState *interp)
assert(id == 1);
used_newtstate = 0;
tstate = &interp->_initial_thread;
+ assert(tstate->_static);
}
else {
// Every valid interpreter must have at least one thread.
@@ -828,6 +833,9 @@ new_threadstate(PyInterpreterState *interp)
memcpy(tstate,
&initial._main_interpreter._initial_thread,
sizeof(*tstate));
+ // We need to adjust any fields that are different from the initial
+ // thread (as defined in _PyThreadState_INIT):
+ tstate->_static = false;
}
interp->threads.head = tstate;