]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-120158: Fix inconsistent monitoring state when setting events too frequentl...
authorSam Gross <colesbury@gmail.com>
Sun, 23 Nov 2025 15:30:37 +0000 (10:30 -0500)
committerGitHub <noreply@github.com>
Sun, 23 Nov 2025 15:30:37 +0000 (15:30 +0000)
commitdbb539efc31220313589ba7dd5c2674eba64c4e3
tree0f5159be5c83faa678625c1922f6918aed2d0a1b
parente2d320b33001fe58295f441b086a2af1e5d6c0d6
[3.13] gh-120158: Fix inconsistent monitoring state when setting events too frequently (gh-141845) (gh-141880)

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.
(cherry picked from commit e457d60daafe66534283e0f79c81517634408e57)
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