[issue1758146] Crash in PyObject_Malloc
report at bugs.python.org
Wed Jul 9 00:05:01 CEST 2008
Franco DiRosa <fdirosa at stny.rr.com> added the comment:
I believe PyThreadState_Swap function in ceval.c has a bug as I stated
earlier. However, I have not seen it included in the latest patches so
now I wonder...
The following line in PyThreadState_Swap...
if (check && check->interp == newts->interp && check != newts)
should read as follows...
if (check && check->interp != newts->interp && check != newts)
since this condition, if true, raises an error. Why should it raise an
error if all the interpreters are equal across multiple thread states?
If we have one interpreter with multiple thread states (i.e. multi-
threaded application) this function will error when switching between
the thread states within the same interpreter (in DEBUG compile mode
only since this code is commented out otherwise). In the forums it
describes the use of thread states to handle multiple python threads
running simultaneously and not by using multiple interpreters but only
one (the main interpreter).
Also the interpreters have be equal because in the documentation for
the GIL functions it says it doesn't support multiple interpreters. I
think this is a typo/bug in the code.
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list