https://github.com/python/cpython/commit/41ad2bb2489c4cf9ba4f13401750b3fcdb33937b
commit: 41ad2bb2489c4cf9ba4f13401750b3fcdb33937b
branch: main
author: Brandt Bucher <[email protected]>
committer: brandtbucher <[email protected]>
date: 2025-01-28T16:26:46-08:00
summary:

GH-128563: Don't leave frame->lltrace uninitialized (GH-129417)

files:
A 
Misc/NEWS.d/next/Core_and_Builtins/2025-01-28-11-13-41.gh-issue-128563.xElppE.rst
M Include/internal/pycore_frame.h

diff --git a/Include/internal/pycore_frame.h b/Include/internal/pycore_frame.h
index 155a6f3ce054a2..f6f2776804e85b 100644
--- a/Include/internal/pycore_frame.h
+++ b/Include/internal/pycore_frame.h
@@ -215,6 +215,9 @@ _PyFrame_Initialize(
     frame->return_offset = 0;
     frame->owner = FRAME_OWNED_BY_THREAD;
     frame->visited = 0;
+#ifdef Py_DEBUG
+    frame->lltrace = 0;
+#endif
 
     for (int i = null_locals_from; i < code->co_nlocalsplus; i++) {
         frame->localsplus[i] = PyStackRef_NULL;
@@ -398,6 +401,9 @@ _PyFrame_PushTrampolineUnchecked(PyThreadState *tstate, 
PyCodeObject *code, int
 #endif
     frame->owner = FRAME_OWNED_BY_THREAD;
     frame->visited = 0;
+#ifdef Py_DEBUG
+    frame->lltrace = 0;
+#endif
     frame->return_offset = 0;
 
 #ifdef Py_GIL_DISABLED
diff --git 
a/Misc/NEWS.d/next/Core_and_Builtins/2025-01-28-11-13-41.gh-issue-128563.xElppE.rst
 
b/Misc/NEWS.d/next/Core_and_Builtins/2025-01-28-11-13-41.gh-issue-128563.xElppE.rst
new file mode 100644
index 00000000000000..dfd932e836bda6
--- /dev/null
+++ 
b/Misc/NEWS.d/next/Core_and_Builtins/2025-01-28-11-13-41.gh-issue-128563.xElppE.rst
@@ -0,0 +1,2 @@
+Fix an issue where the "lltrace" debug feature could have been incorrectly
+enabled for some frames.

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to