[issue4804] Python on Windows disables all C runtime library assertions

Martin v. Löwis report at bugs.python.org
Mon Jan 19 23:14:21 CET 2009


Martin v. Löwis <martin at v.loewis.de> added the comment:

> I understand thread-safe.  This usage is safe from Python threads 
> because it is all done in the context of the GIL.

No, it is not. See below.

> In your example, T2 doesn't hold the GIL and so, this is the scenario 
> that I believe you are invoking.

Assume that T2 is a Python thread. First, it doesn't hold the GIL.
However, when T1 releases the GIL to invoke the CRT, T2 can acquire
the GIL (which it had been waiting for, anyway), and then proceed
as described.

> Furthermore, since your argument assumes a rogue thread modifying the 
> CRT settings

No, it does not. Regular Python threads can break under this patch.

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4804>
_______________________________________


More information about the Python-bugs-list mailing list