]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-120158: Fix inconsistent monitoring state when setting events too frequently ...
authorSam Gross <colesbury@gmail.com>
Sun, 23 Nov 2025 15:07:17 +0000 (10:07 -0500)
committerGitHub <noreply@github.com>
Sun, 23 Nov 2025 15:07:17 +0000 (10:07 -0500)
commite457d60daafe66534283e0f79c81517634408e57
treeca8ca1ed090d2a940bdaa3eceea827f30ef3fdb6
parent614a28b3da1c898f29c34c14f59bf2d496dbd31d
gh-120158: Fix inconsistent monitoring state when setting events too frequently (gh-141845)

If we overflowed the global version counter (i.e., after 2*24 calls to
`_PyMonitoring_SetEvents`), we bailed out after setting global monitoring
events but before instrumenting code objects, which led to assertion errors
later on.

Also add a `time.sleep()` to `test_free_threading.test_monitoring` to avoid
overflowing the global version counter.
Lib/test/test_free_threading/test_monitoring.py
Misc/NEWS.d/next/Core_and_Builtins/2025-11-22-10-43-26.gh-issue-120158.41_rXd.rst [new file with mode: 0644]
Python/instrumentation.c