[PyKDE] Problems with QDomDocument.setContent
Ricardo Javier Cardenes Medina
rcardenes at debian.org
Sun Jan 16 05:59:16 GMT 2005
Hi list,
Phil, some days ago I got this bug on Debian's PyQt package:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=289212&repeatmerged=no
The bug submitter claimed that using PyQt 3.13, he can hang a program
with a simple bit of code like this:
from qt import *
from qtxml import *
dom = QDomDocument('plist')
f = QFile('rdf.xml')
dom.setContent(f)
where 'rdf.xml' is a valid existing XML file (if it doesn't exists the
code doesn't hangs). I've reproduced it, and tried the matching C++
version of the code (using Qt 3.3.3), with full arguments as PyQt does,
just to make sure it wasn't a Qt problem:
#include <qdom.h>
#include <qfile.h>
int main() {
QFile *f = new QFile("rdf.xml");
QDomDocument *dd = new QDomDocument("plist");
QString *emsg = new QString();
int eline, ecol;
dd->setContent(f, emsg, &eline, &ecol);
}
Not that it does anything specially useful, but it doesn't hang. The
current version of Debian's package for PyQt has been built with SIP
4.1.1, and I've debugged it a bit. The code hangs when calling to the
Qt native method:
res = sipCpp -> QDomDocument::setContent(a0,emsg,&eline,&ecol);
Or at least it seems. An strace reveals an endless loop of futexes calls
like these:
...
futex(0x81a3d90, FUTEX_WAKE, 1, {0, 135508336}) = 0
futex(0x81a3d90, FUTEX_WAKE, 1, {0, 135508336}) = 0
futex(0x81a3d90, FUTEX_WAKE, 1, {0, 135508336}) = 0
...
The submitter says that previous versions (3.11, 3.12) worked without
problems. I've checked at least with 3.12, that were built with SIP
4.0.1 (3.11 were built with SIP3). The produced C++ code for the
relevant code in 3.12 matches exactly with 3.13, and it doesn't hang,
just like the bug submitter stated.
Building 3.13 with the latest SIP snapshot doesn't help it a bit.
Regards,
Ricardo
More information about the PyQt
mailing list