<feed xmlns='http://www.w3.org/2005/Atom'>
<title>python.git/Python/pystate.c, branch master</title>
<subtitle>Python interpreter</subtitle>
<id>http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Python/pystate.c?h=master</id>
<link rel='self' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Python/pystate.c?h=master'/>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/'/>
<updated>2025-03-11T15:31:03Z</updated>
<entry>
<title>[3.11] gh-106883 Fix deadlock in threaded application (#117332)</title>
<updated>2025-03-11T15:31:03Z</updated>
<author>
<name>Diego Russo</name>
<email>diego.russo@arm.com</email>
</author>
<published>2025-03-11T15:31:03Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=6b37486184590d19c6f24e620545ec8f8f65e4c7'/>
<id>urn:sha1:6b37486184590d19c6f24e620545ec8f8f65e4c7</id>
<content type='text'>
When using threaded applications, there is a high risk of a deadlock in
the interpreter. It's a lock ordering deadlock with HEAD_LOCK(&amp;_PyRuntime); and the GIL.

By disabling the GC during the _PyThread_CurrentFrames() and
_PyThread_CurrentExceptions() calls fixes the issue.</content>
</entry>
<entry>
<title>[3.11] gh-108987: Fix _thread.start_new_thread() race condition (#109135) (#109272)</title>
<updated>2023-09-11T17:33:08Z</updated>
<author>
<name>Victor Stinner</name>
<email>vstinner@python.org</email>
</author>
<published>2023-09-11T17:33:08Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=82a18069a1c288b9be3cdaf63a04e4c77fbd231f'/>
<id>urn:sha1:82a18069a1c288b9be3cdaf63a04e4c77fbd231f</id>
<content type='text'>
gh-108987: Fix _thread.start_new_thread() race condition (#109135)

Fix _thread.start_new_thread() race condition. If a thread is created
during Python finalization, the newly spawned thread now exits
immediately instead of trying to access freed memory and lead to a
crash.

thread_run() calls PyEval_AcquireThread() which checks if the thread
must exit. The problem was that tstate was dereferenced earlier in
_PyThreadState_Bind() which leads to a crash most of the time.

Move _PyThreadState_CheckConsistency() from thread_run() to
_PyThreadState_Bind().

(cherry picked from commit 517cd82ea7d01b344804413ef05610934a43a241)</content>
</entry>
<entry>
<title>[3.11] gh-104690: thread_run() checks for tstate dangling pointer (#109056) (#109134)</title>
<updated>2023-09-08T11:10:33Z</updated>
<author>
<name>Victor Stinner</name>
<email>vstinner@python.org</email>
</author>
<published>2023-09-08T11:10:33Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=b55cf2c2d82d7567720df113117752841ce74606'/>
<id>urn:sha1:b55cf2c2d82d7567720df113117752841ce74606</id>
<content type='text'>
gh-104690: thread_run() checks for tstate dangling pointer (#109056)

thread_run() of _threadmodule.c now calls
_PyThreadState_CheckConsistency() to check if tstate is a dangling
pointer when Python is built in debug mode.

Rename ceval_gil.c is_tstate_valid() to
_PyThreadState_CheckConsistency() to reuse it in _threadmodule.c.

(cherry picked from commit f63d37877ad166041489a968233b57540f8456e8)</content>
</entry>
<entry>
<title>[3.11] GH-102126: fix deadlock at shutdown when clearing thread state… (#102234)</title>
<updated>2023-02-25T15:30:05Z</updated>
<author>
<name>Kumar Aditya</name>
<email>59607654+kumaraditya303@users.noreply.github.com</email>
</author>
<published>2023-02-25T15:30:05Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=026faf20cc9d1d5913ff7c01a93d8934594d7fec'/>
<id>urn:sha1:026faf20cc9d1d5913ff7c01a93d8934594d7fec</id>
<content type='text'>
[3.11] GH-102126: fix deadlock at shutdown when clearing thread states (GH-102222)

(cherry picked from commit 5f11478ce7fda826d399530af4c5ca96c592f144)</content>
</entry>
<entry>
<title>GH-99205: Mark new interpreters and threads as non-static (GH-99268)</title>
<updated>2022-11-09T22:19:15Z</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2022-11-09T22:19:15Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=7c9c993945a63dc774554a8cc5ee1ef62a2454c7'/>
<id>urn:sha1:7c9c993945a63dc774554a8cc5ee1ef62a2454c7</id>
<content type='text'>
(cherry picked from commit 283ab0e1c002f2d7459d581df6b4b8599e7d1a4d)

Co-authored-by: Brandt Bucher &lt;brandtbucher@microsoft.com&gt;</content>
</entry>
<entry>
<title>GH-96754: Check whether the interpreter frame is complete before creating frame object. (GH-96776) (#96787)</title>
<updated>2022-09-13T10:56:27Z</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2022-09-13T10:56:27Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=c4cf745c723f19dbc5b304bfb21cf77ac9aa40b8'/>
<id>urn:sha1:c4cf745c723f19dbc5b304bfb21cf77ac9aa40b8</id>
<content type='text'>
(cherry picked from commit 12c5f328d2479ac3432df5e266adc4e59adeabfe)

Co-authored-by: Mark Shannon &lt;mark@hotpy.org&gt;

Co-authored-by: Mark Shannon &lt;mark@hotpy.org&gt;</content>
</entry>
<entry>
<title>Fix possible NULL pointer dereference in _PyThread_CurrentFrames (GH-96584)</title>
<updated>2022-09-10T11:12:46Z</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2022-09-10T11:12:46Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=c563b892618d1859ce0191c2e8097df4b3469f9a'/>
<id>urn:sha1:c563b892618d1859ce0191c2e8097df4b3469f9a</id>
<content type='text'>
(cherry picked from commit 88a7f661ca02c0eb76b8f19234b8293b70f171e2)

Co-authored-by: Kumar Aditya &lt;59607654+kumaraditya303@users.noreply.github.com&gt;</content>
</entry>
<entry>
<title>[3.11] GH-96569: Avoid undefined behavior (#96616)</title>
<updated>2022-09-08T11:00:04Z</updated>
<author>
<name>Mark Shannon</name>
<email>mark@hotpy.org</email>
</author>
<published>2022-09-08T11:00:04Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=e72f469e857e2e853dd067742e4c8c5f7bb8fb16'/>
<id>urn:sha1:e72f469e857e2e853dd067742e4c8c5f7bb8fb16</id>
<content type='text'>
Co-authored-by: Michael Droettboom &lt;mdboom@gmail.com&gt;</content>
</entry>
<entry>
<title>GH-96071: fix deadlock in PyGILState_Ensure  (GH-96124) (#96129)</title>
<updated>2022-08-19T21:11:31Z</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2022-08-19T21:11:31Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=1fa9644c23632f8ffc3f59e7f574b92185c371e4'/>
<id>urn:sha1:1fa9644c23632f8ffc3f59e7f574b92185c371e4</id>
<content type='text'>
Alternative of GH-96107
(cherry picked from commit e0d54a4a799dae4ebdd72a16bcf287ed62ae2972)

Co-authored-by: Kumar Aditya &lt;59607654+kumaraditya303@users.noreply.github.com&gt;

Co-authored-by: Kumar Aditya &lt;59607654+kumaraditya303@users.noreply.github.com&gt;</content>
</entry>
<entry>
<title>GH-95818: Skip incomplete frames in `PyThreadState_GetFrame` (GH-95886) (#95890)</title>
<updated>2022-08-12T18:40:49Z</updated>
<author>
<name>Miss Islington (bot)</name>
<email>31488909+miss-islington@users.noreply.github.com</email>
</author>
<published>2022-08-12T18:40:49Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=6fc90c11835f1af869a47724ab9742535b73fe7b'/>
<id>urn:sha1:6fc90c11835f1af869a47724ab9742535b73fe7b</id>
<content type='text'>
(cherry picked from commit 1b46d118e6e72daa64b98cafddb406c68b419efa)

Co-authored-by: Mark Shannon &lt;mark@hotpy.org&gt;

Co-authored-by: Mark Shannon &lt;mark@hotpy.org&gt;</content>
</entry>
</feed>
