mirror of
https://github.com/python/cpython.git
synced 2026-01-22 07:08:40 +00:00
gh-143123: Protect against recursive tracer calls/finalization (GH-143126)
* Stronger check for recursive traces * Add a stop_tracing field * Stop early when tracing exceptions
This commit is contained in:
parent
6db952eae9
commit
e370c8db52
9 changed files with 100 additions and 31 deletions
|
|
@ -5620,6 +5620,9 @@ dummy_func(
|
|||
#else
|
||||
assert(_PyErr_Occurred(tstate));
|
||||
#endif
|
||||
SAVE_STACK();
|
||||
STOP_TRACING();
|
||||
RELOAD_STACK();
|
||||
|
||||
/* Log traceback info. */
|
||||
assert(frame->owner != FRAME_OWNED_BY_INTERPRETER);
|
||||
|
|
@ -5634,6 +5637,9 @@ dummy_func(
|
|||
}
|
||||
|
||||
spilled label(exception_unwind) {
|
||||
SAVE_STACK();
|
||||
STOP_TRACING();
|
||||
RELOAD_STACK();
|
||||
/* We can't use frame->instr_ptr here, as RERAISE may have set it */
|
||||
int offset = INSTR_OFFSET()-1;
|
||||
int level, handler, lasti;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue