-
-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Deprecate thread debugging PYTHONTHREADDEBUG=1 #88750
Comments
Copy of my email to python-dev: Hi, Does anyone use threading debug PYTHONTHREADDEBUG=1 env var on a -- To fix a race condition at thread exit on Linux using the glibc, I https://bugs.python.org/issue44434 A side effect of this change is the removal of the I never used PYTHONTHREADDEBUG. I just tried it and it produces tons This debug mode requires to build Python in debug mode (./configure https://docs.python.org/dev/using/configure.html#python-debug-build IMO there are enough external debugging tools to debug threading I propose to deprecate the feature in Python 3.11 and remove it in 2 Victor |
I never ever used PYTHONTHREADDEBUG=1. I just tried: $ PYTHONTHREADDEBUG=1 ./python -m test -v test_sys
PyThread_init_thread called
PyThread_allocate_lock() -> 0x1f212c0
PyThread_allocate_lock called
PyThread_allocate_lock() -> 0x1f21300
PyThread_allocate_lock called
PyThread_allocate_lock() -> 0x1f21340
PyThread_allocate_lock called
PyThread_allocate_lock() -> 0x1f3ea70
PyThread_acquire_lock_timed(0x1f212c0, -1, 0) called
PyThread_acquire_lock_timed(0x1f212c0, -1, 0) -> 1
PyThread_release_lock(0x1f212c0) called
PyThread_acquire_lock_timed(0x1f212c0, -1, 0) called
PyThread_acquire_lock_timed(0x1f212c0, -1, 0) -> 1
PyThread_release_lock(0x1f212c0) called
PyThread_acquire_lock_timed(0x1f21340, -1, 0) called
PyThread_acquire_lock_timed(0x1f21340, -1, 0) -> 1
PyThread_release_lock(0x1f21340) called
PyThread_acquire_lock_timed(0x1f21340, -1, 0) called
PyThread_acquire_lock_timed(0x1f21340, -1, 0) -> 1
PyThread_release_lock(0x1f21340) called
PyThread_acquire_lock_timed(0x1f21340, -1, 0) called
PyThread_acquire_lock_timed(0x1f21340, -1, 0) -> 1
PyThread_release_lock(0x1f21340) called
PyThread_acquire_lock_timed(0x1f21340, -1, 0) called
PyThread_acquire_lock_timed(0x1f21340, -1, 0) -> 1
PyThread_release_lock(0x1f21340) called
(...) ====================================================================== Traceback (most recent call last):
File "/home/vstinner/python/main/Lib/test/test_sys.py", line 1525, in test_changing_sys_stderr_and_removing_reference
self.assertEqual(out, b"")
^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: b'PyThread_init_thread called\nPyThread_all[59813 chars]ed\n' != b''
(...)
PyThread_release_lock(0x2113660) called
PyThread_free_lock(0x2113660) called
PyThread_free_lock(0x7fc6e8001300) called
PyThread_acquire_lock_timed(0x1f212c0, -1, 0) called
PyThread_acquire_lock_timed(0x1f212c0, -1, 0) -> 1
PyThread_release_lock(0x1f212c0) called
PyThread_acquire_lock_timed(0x1f212c0, -1, 0) called
PyThread_acquire_lock_timed(0x1f212c0, -1, 0) -> 1
PyThread_release_lock(0x1f212c0) called
PyThread_free_lock(0x1f3ea70) called
PyThread_acquire_lock_timed(0x1f212c0, -1, 0) called
PyThread_acquire_lock_timed(0x1f212c0, -1, 0) -> 1
PyThread_release_lock(0x1f212c0) called
PyThread_free_lock(0x1f212c0) called
PyThread_free_lock(0x1f21300) called
PyThread_free_lock(0x1f21340) called This debug mode produces so many logs that it looks basically useless :-( See also discussion at: #24241 |
PYTHONTHREADDEBUG is now deprecated in Python 3.10, and planned for removal in 3.12. If someone finds it useful, we can reconsider to keep the feature, but maybe redirect the output to stderr rather than stdout. |
Remove the `PYTHONTHREADDEBUG` env var support. Remove no-op dprintf() macro calls.
…LL (#92586) On Windows, PyThread_acquire_lock(), PyThread_acquire_lock_timed() and PyThread_release_lock() no longer check at runtime if the lock is not NULL.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: