Skip to content

Commit d149f15

Browse files
authored
[3.11] gh-101975: Fixed a potential SegFault on garbage collection (GH-102803) (GH-102807)
Authored-by: gaogaotiantian <[email protected]>
1 parent 9883356 commit d149f15

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed ``stacktop`` value on tracing entries to avoid corruption on garbage collection.

Python/ceval.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1536,6 +1536,7 @@ eval_frame_handle_pending(PyThreadState *tstate)
15361536
_PyFrame_SetStackPointer(frame, stack_pointer); \
15371537
int err = trace_function_entry(tstate, frame); \
15381538
stack_pointer = _PyFrame_GetStackPointer(frame); \
1539+
frame->stacktop = -1; \
15391540
if (err) { \
15401541
goto error; \
15411542
} \

0 commit comments

Comments
 (0)