-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ref tests failure on test_monitoring #103845
Comments
The direct trigger here is Demoimport sys
def f():
def func():
a = 1
b = 2
E = sys.monitoring.events
TOOL_ID = 2
sys.monitoring.use_tool_id(TOOL_ID, "test")
sys.monitoring.register_callback(TOOL_ID, E.LINE, lambda *args: print(args))
sys.monitoring.register_callback(TOOL_ID, E.INSTRUCTION, lambda *args: print(args))
sys.monitoring.set_events(TOOL_ID, E.LINE | E.INSTRUCTION)
func()
sys.monitoring.set_events(TOOL_ID, 0)
sys.monitoring.restart_events()
sys.monitoring.set_events(TOOL_ID, E.LINE | E.INSTRUCTION)
func()
sys.monitoring.set_events(TOOL_ID, 0)
f() When
So the line instrumentations on the code object will be removed and no line event will be generated. This could be confirmed with The fix could be simply to do remove first, then add. I had a prototype in #103851 and it solved the original issue. I also added a regression test. |
Appears to be fixed. @sunmy2019 can you confirm? |
Confirmed and closed |
Tested on cef542c, GCC 11.3 Ubuntu 22.04
Error Log
Looks like the behavior is changed when using
-R :
?CC: @markshannon
Linked PRs
The text was updated successfully, but these errors were encountered: