mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-138122: Don't sample partial frame chains (#141912)
This commit is contained in:
parent
c5b37228af
commit
d6d850df89
13 changed files with 135 additions and 105 deletions
|
|
@ -380,6 +380,7 @@ unwind_stack_for_thread(
|
|||
}
|
||||
|
||||
uintptr_t frame_addr = GET_MEMBER(uintptr_t, ts, unwinder->debug_offsets.thread_state.current_frame);
|
||||
uintptr_t base_frame_addr = GET_MEMBER(uintptr_t, ts, unwinder->debug_offsets.thread_state.base_frame);
|
||||
|
||||
frame_info = PyList_New(0);
|
||||
if (!frame_info) {
|
||||
|
|
@ -411,9 +412,9 @@ unwind_stack_for_thread(
|
|||
PyErr_Clear(); // Non-fatal
|
||||
}
|
||||
} else {
|
||||
// No caching - process entire frame chain
|
||||
// No caching - process entire frame chain with base_frame validation
|
||||
if (process_frame_chain(unwinder, frame_addr, &chunks, frame_info,
|
||||
gc_frame, 0, NULL, NULL, NULL, 0) < 0) {
|
||||
base_frame_addr, gc_frame, 0, NULL, NULL, NULL, 0) < 0) {
|
||||
set_exception_cause(unwinder, PyExc_RuntimeError, "Failed to process frame chain");
|
||||
goto error;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue