View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0001318||Scribus||Scripter||public||2004-11-16 11:06||2005-04-27 03:49|
|Platform||x86 Linux||OS||Fedora Core||OS Version||1|
|Summary||0001318: 'Execute Script' crashes Scribus when built against a thread-enabled Python debug build|
|Description||Python debug builds perform some additional checks and tests to 'sanity check' functions. One of these sanity checks aborts due to the way that Scribus creates new interpreters in slotRunScriptFile.|
Py_NewInterpreter calls PyThreadState_Swap to swap thread states.
PyThreadState_Swap (Python/pystate.c:265) calls PyGILState_GetThisThreadState to get the thread state for the running thread, and compares it to the thread state that's being switched to. If they're not the same, it aborts the program.
PyGILState_GetThisThreadState appears to use thread-local storage to keep track of the thread state for the thread. I haven't fully unravelled it yet, but that's how it looks.
Note this comment in the PyThreadState_Swap function:
/* It should not be possible for more than one thread state
to be used for a thread. Check this the best we can in debug+
Python does not check this in single-threaded builds, nor enforce this restriction. Whether this is because it has no way to check and enforce it, or because it doesn't matter, I don't know.
Nonetheless the upshot of all this is that Scribus crashes with a SIGABRT when you try to 'Execute Script' and it has been built against a Python debug build (unless threading was disabled in that Python build).
I can only assume that Python is aborting for a good reason. Perhaps this is related to the PyQt issues that have been so frustrating.
Apache's mod_python may provide some insight, but I haven't been able to make head or tail of what exactly it's doing yet.
|Tags||No tags attached.|
||Note Added: 0002898|
||Note Added: 0002899|
||Note Edited: 0002899|
||Note Added: 0004292|
||Status||new => assigned|
||Assigned To||=> ringerc|
||Status||assigned => resolved|
||Resolution||open => not fixable|
||Note Added: 0004427|
||Status||resolved => closed|