[issue1758146] Crash in PyObject_Malloc

Adam Olsen report at bugs.python.org
Wed Jul 9 00:25:27 CEST 2008


Adam Olsen <rhamph at gmail.com> added the comment:

Franco, you need to look at the line above that check:

	PyThreadState *check = PyGILState_GetThisThreadState();
	if (check && check->interp == newts->interp && check != newts)
		Py_FatalError("Invalid thread state for this thread");

PyGILState_GetThisThreadState returns the original tstate *for that
thread*.  What it's asserting is that, if there's a second tstate *in
that thread*, it must be in a different subinterpreter.

It doesn't prevent your second and third tstate from sharing the same
subinterpreter, but it probably should, as this check implies it's an
invariant.

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


More information about the Python-bugs-list mailing list