Mailing List Archive

gh-117658: Fix check_dump_traceback_threads in free-threaded build (#117659)
https://github.com/python/cpython/commit/6edde8a91c753dba03c92315b7585209931c704b
commit: 6edde8a91c753dba03c92315b7585209931c704b
branch: main
author: Sam Gross <colesbury@gmail.com>
committer: colesbury <colesbury@gmail.com>
date: 2024-04-09T11:50:49-04:00
summary:

gh-117658: Fix check_dump_traceback_threads in free-threaded build (#117659)

With the GIL disabled, the waiting thread may still be in the
`self.running.set() ` call when faulthandler dumps tracebacks.

files:
M Lib/test/test_faulthandler.py

diff --git a/Lib/test/test_faulthandler.py b/Lib/test/test_faulthandler.py
index 200f34d18ca60a..61ec8fe3151af1 100644
--- a/Lib/test/test_faulthandler.py
+++ b/Lib/test/test_faulthandler.py
@@ -575,10 +575,12 @@ def run(self):
lineno = 8
else:
lineno = 10
+ # When the traceback is dumped, the waiter thread may be in the
+ # `self.running.set()` call or in `self.stop.wait()`.
regex = r"""
^Thread 0x[0-9a-f]+ \(most recent call first\):
(?: File ".*threading.py", line [0-9]+ in [_a-z]+
- ){{1,3}} File "<string>", line 23 in run
+ ){{1,3}} File "<string>", line (?:22|23) in run
File ".*threading.py", line [0-9]+ in _bootstrap_inner
File ".*threading.py", line [0-9]+ in _bootstrap


_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-leave@python.org
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: list-python-checkins@lists.gossamer-threads.com