-
-
Notifications
You must be signed in to change notification settings - Fork 33k
Closed
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
When tracing, profiling, or object tracing functions are installed in CPython, they are not notified if another function is later installed to replace them. This is particularly bad for ref tracker hooks as this means that existing tracers may continue referencing objects they believe are still alive, even though they never receive deallocation events, creating the risk of dangling references and inconsistent state.
The proposed solution is to emit a special event whenever a new tracing or profiling function is installed, so that currently active functions can react appropriately (e.g., cleaning up resources or releasing references) before being substituted.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error