Skip to content

sys.settrace and sys.setprofile are not re-entrant #94510

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

Closed
pablogsal opened this issue Jul 2, 2022 · 2 comments
Closed

sys.settrace and sys.setprofile are not re-entrant #94510

pablogsal opened this issue Jul 2, 2022 · 2 comments

Comments

@pablogsal
Copy link
Member

The code that sets trace and profile functions is not re-entrant. We are leaking objects if removing a profile/trace functions triggers a re-entrant call.

We should raise in this case.

@pablogsal pablogsal changed the title sys.settrace is not re-entrant sys.settrace and sys.setprofile are not re-entrant Jul 2, 2022
pablogsal added a commit to pablogsal/cpython that referenced this issue Jul 2, 2022
ambv pushed a commit to ambv/cpython that referenced this issue Jul 5, 2022
…d sys.settrace (pythonGH-94511)

Co-authored-by: Łukasz Langa <[email protected]>
(cherry picked from commit 40d81fd)

Co-authored-by: Pablo Galindo Salgado <[email protected]>
ambv pushed a commit to ambv/cpython that referenced this issue Jul 5, 2022
…d sys.settrace (pythonGH-94511)

Co-authored-by: Łukasz Langa <[email protected]>
(cherry picked from commit 40d81fd)

Co-authored-by: Pablo Galindo Salgado <[email protected]>
pablogsal added a commit to pablogsal/cpython that referenced this issue Jul 5, 2022
…d sys.settrace (pythonGH-94511)

Co-authored-by: Łukasz Langa <[email protected]>.
(cherry picked from commit 40d81fd)

Co-authored-by: Pablo Galindo Salgado <[email protected]>
pablogsal added a commit that referenced this issue Jul 5, 2022
…ettrace (GH-94511) (#94579)

Co-authored-by: Łukasz Langa <[email protected]>.
Co-authored-by: Pablo Galindo Salgado <[email protected]>
ambv added a commit that referenced this issue Jul 5, 2022
…settrace (GH-94511) (GH-94578)

Co-authored-by: Pablo Galindo Salgado <[email protected]>
Co-authored-by: Łukasz Langa <[email protected]>
(cherry picked from commit 40d81fd)
@ambv
Copy link
Contributor

ambv commented Jul 5, 2022

This is now fixed in 3.10 - 3.12. Thanks, Pablo! ✨ 🍰 ✨

@vstinner
Copy link
Member

This change introduce a randomly failure in test_import: issue #98257.

I propose to make the function reentrant, rather than detecting and rejecting reentrant call: PR #98258.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants