You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test_sys_settrace leaked [6604, 6602, 6604] on main branch #94979
commit 2f8bff6879c5d76d143068e8bc867196a7d28afc (HEAD)Author: Mark Shannon <mark@hotpy.org>Date: Mon Jul 18 16:06:42 2022 +0100 GH-94739: Mark stacks of exception handling blocks for setting frame.f_lineno in the debugger. (GH-94958)
The issue is when we jump out of an exception handler into non-exception-handling code. We skip over POP_EXCEPT, which is supposed to clear tstate->exc_info->exc_value, the currently active exception. This exception references thousands of objects through its traceback frames.
I'm not sure what a good solution is. Perhaps clearing the thread's exception state if we can detect that we're jumping out of an exception handler? I'm not sure if that's always correct (or even easy to detect). Maybe we can flag every stack between an exception handler entry and a POP_EXCEPT?
Or, just disallow jumping out of exception handlers like this?
Activity
kumaraditya303 commentedon Jul 18, 2022
cc @markshannon @pablogsal
kumaraditya303 commentedon Jul 18, 2022
Git bisect points to 2f8bff6 as first bad commit:
mdboom commentedon Jul 18, 2022
frame.setlinenostrikes again.brandtbucher commentedon Jul 18, 2022
Checking this out now.
brandtbucher commentedon Jul 18, 2022
The following three tests are leaking:
test_jump_from_except_to_finallytest_jump_out_of_bare_except_blocktest_jump_out_of_qualified_except_blockThe issue is when we jump out of an exception handler into non-exception-handling code. We skip over
POP_EXCEPT, which is supposed to cleartstate->exc_info->exc_value, the currently active exception. This exception references thousands of objects through its traceback frames.I'm not sure what a good solution is. Perhaps clearing the thread's exception state if we can detect that we're jumping out of an exception handler? I'm not sure if that's always correct (or even easy to detect). Maybe we can flag every stack between an exception handler entry and a
POP_EXCEPT?Or, just disallow jumping out of exception handlers like this?
GH-94979: Pop the exception stack when jumping out of exception handl…
pythonGH-94979: Pop the exception stack when jumping out of exception…