[PyKDE] PyQt4 random crashes under windows.

Giovanni Bajo rasky at develer.com
Tue Jan 23 02:17:32 GMT 2007

On 22/01/2007 22.56, sole at esrf.fr wrote:

> If I build Qt4 and the extension modules with VS2003 with the patched Qt4 files
> from the qtwin project the application crashes even more often, so the patch
> does not seem to be a solution to my problem.

With that patch installed, the whole PyQt+Qt block should use *only* 
msvcr71.dll (you can verify it by inspecting the dependencies of the generated 
dynamic libraries). If that's the case, it surely means that this is *not* the 
problem causing a random crash.

There are several ways to debug such a random crash under Windows. I would 
start from compiling Python, PyQt and Qt in debug mode. Notice that Python 
itself has an official "debug" mode which is totally useless (it's the one 
which changes the ABI: you get a python_d.dll, and you then need the _d 
version of each and every pyd you use). What you really want is to get the 
"release" version of Python, disable optimization, enable debugging 
information and recompile; you'll get a python.dll with debug infos; do the 
same with sip and pyqt (you can try with "configure.py -u" for both, but I 
suggest to hand-edit the generated Makefiles to remove "-O2" and add "-Zi", 
and "/DEBUG" to linker, and run "nmake clean all").

After that, you should have enough debug informations to get an useful stack 
trace and full debug session from within VS2003. Notice you can either start 
your whole application within VS2003, or attach it at the moment it crashes.
Giovanni Bajo

More information about the PyQt mailing list