]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] gh-101975: Fixed a potential SegFault on garbage collection (GH-102803) (GH...
authorMark Shannon <mark@hotpy.org>
Mon, 20 Mar 2023 14:42:15 +0000 (14:42 +0000)
committerGitHub <noreply@github.com>
Mon, 20 Mar 2023 14:42:15 +0000 (14:42 +0000)
Authored-by: gaogaotiantian <gaogaotiantian@hotmail.com>
Misc/NEWS.d/next/Core and Builtins/2023-03-18-02-36-39.gh-issue-101975.HwMR1d.rst [new file with mode: 0644]
Python/ceval.c

diff --git a/Misc/NEWS.d/next/Core and Builtins/2023-03-18-02-36-39.gh-issue-101975.HwMR1d.rst b/Misc/NEWS.d/next/Core and Builtins/2023-03-18-02-36-39.gh-issue-101975.HwMR1d.rst
new file mode 100644 (file)
index 0000000..28c9a84
--- /dev/null
@@ -0,0 +1 @@
+Fixed ``stacktop`` value on tracing entries to avoid corruption on garbage collection.
index 96d215aba80058c2fe2d03c29d4d746d4e28abef..72f9c8375d072ac28faa92b2805749033b254cc7 100644 (file)
@@ -1536,6 +1536,7 @@ eval_frame_handle_pending(PyThreadState *tstate)
         _PyFrame_SetStackPointer(frame, stack_pointer); \
         int err = trace_function_entry(tstate, frame); \
         stack_pointer = _PyFrame_GetStackPointer(frame); \
+        frame->stacktop = -1; \
         if (err) { \
             goto error; \
         } \