Skip to content
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

Inconsistent behavior for sys.monitoring.events.CALL #116626

Closed
gaogaotiantian opened this issue Mar 11, 2024 · 2 comments
Closed

Inconsistent behavior for sys.monitoring.events.CALL #116626

gaogaotiantian opened this issue Mar 11, 2024 · 2 comments
Labels
3.12 bugs and security fixes 3.13 bugs and security fixes type-bug An unexpected behavior, bug, or error

Comments

@gaogaotiantian
Copy link
Member

gaogaotiantian commented Mar 11, 2024

Bug report

Bug description:

According to the docs, CALL event should be emitted as long as there's a function call in Python code. However, CALL_FUNCTION_EX does it differently - it only emits the event when it's a call to C function. So monitoring the following code produce different results:

def f(a, b):
    return a + b
f(1, 2)  # Emits CALL event
args = (1, 2)
f(*args)  # Does NOT emit CALL event

I think we should just fix CALL_FUNCTION_EX to make it work the same as the other CALL instructions.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

@markshannon
Copy link
Member

Yes, CALL_FUNCTION_EX should behave exactly like other CALL instructions.

@hugovk
Copy link
Member

hugovk commented Mar 15, 2024

Closing because the PR has been merged and backported. Please re-open if there's more needed here.

@hugovk hugovk closed this as completed Mar 15, 2024
vstinner pushed a commit to vstinner/cpython that referenced this issue Mar 20, 2024
adorilson pushed a commit to adorilson/cpython that referenced this issue Mar 25, 2024
diegorusso pushed a commit to diegorusso/cpython that referenced this issue Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.12 bugs and security fixes 3.13 bugs and security fixes type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants