Skip to content

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

Closed

Description

@gaogaotiantian

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

Activity

  1. markshannon commented on Mar 12, 2024

    @markshannon
    Member

    Yes, CALL_FUNCTION_EX should behave exactly like other CALL instructions.

  2. added a commit that references this issue on Mar 13, 2024
  3. added a commit that references this issue on Mar 13, 2024
  4. added a commit that references this issue on Mar 14, 2024
  5. hugovk commented on Mar 15, 2024

    @hugovk
    Member

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

  6. added a commit that references this issue on Mar 20, 2024
  7. added a commit that references this issue on Mar 25, 2024
  8. added a commit that references this issue on Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.12only security fixes3.13only security fixestype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions