[PyKDE] Obscure bug in PyQt?

Roberto Alsina ralsina at kde.org
Tue Jan 20 20:48:01 GMT 2004


Hello,

Ok, this one is pretty hard to explain. I imagine understanding will be
harder still :-)

First of all: this same code worked with PyQt 3.8 (I think that was the
version), but doesn't with 3.9 or 3.10

Here's the story.

WI want to make a QTextBrowser show images. To do that, I created my own
QMimeSourceFactory which would download the stuff and return it on its
data() method.

The data has to be returned as a QMimeObject. Or rather, as something
inheriting QMimeObject, like QTextDrag or QImageDrag.

The problem is, somewhere things go wrong, and QMimeSource.provides is
called instead of QTextDrag's or QImageDrag's. Since that is pure virtual,
the app goes boom. Here's a backtrace:

#0  0x400ce671 in kill () from /lib/i686/libc.so.6
#1  0x40039afd in pthread_kill () from /lib/i686/libpthread.so.0
#2  0x40039e9b in raise () from /lib/i686/libpthread.so.0
#3  0x400ce414 in raise () from /lib/i686/libc.so.6
#4  0x400cf94b in abort () from /lib/i686/libc.so.6
#5  0x40926b57 in __cxa_call_unexpected () from /usr/lib/libstdc++.so.5
#6  0x40926ba4 in std::terminate() () from /usr/lib/libstdc++.so.5
#7  0x40927077 in __cxa_pure_virtual () from /usr/lib/libstdc++.so.5
#8  0x40417e77 in QMimeSource::provides(char const*) const () from
/usr/lib/qt-3.2/lib/libqt-mt.so.3
#9  0x403e3ace in QImageDrag::decode(QMimeSource const*, QImage&) () from
/usr/lib/qt-3.2/lib/libqt-mt.so.3
#10 0x40477a3a in QTextImage::QTextImage(QTextDocument*, QMap<QString,
QString> const&, QString const&, QMimeSourceFactory&) () from
/usr/lib/qt-3.2/lib/libqt-mt.so.3
#11 0x4043acad in QStyleSheet::tag(QString const&, QMap<QString, QString>
const&, QString const&, QMimeSourceFactory const&, bool, QTextDocument*)
const () from /usr/lib/qt-3.2/lib/libqt-mt.so.3
#12 0x4045f822 in QTextDocument::setRichTextInternal(QString const&,
QTextCursor*) ()
   from /usr/lib/qt-3.2/lib/libqt-mt.so.3
#13 0x4045c5df in QTextDocument::setRichText(QString const&, QString
const&) () from /usr/lib/qt-3.2/lib/libqt-mt.so.3
#14 0x40461dfa in QTextDocument::setText(QString const&, QString const&)
() from /usr/lib/qt-3.2/lib/libqt-mt.so.3
#15 0x4053626c in QTextEdit::setText(QString const&, QString const&) ()
from /usr/lib/qt-3.2/lib/libqt-mt.so.3
#16 0x4052ca2c in QTextBrowser::setText(QString const&, QString const&) ()
from /usr/lib/qt-3.2/lib/libqt-mt.so.3
#17 0x40e10134 in sipQTextBrowser::setText(QString const&, QString const&) ()

It's not easy to provide a sample program that causes this (it's a part of
a larger one, and tangled), but:

a) I can try, if it's necessary
b) You could try using krsn from CVS in sourceforge:
http://sourceforge.net/projects/krsn

To cause the crash, add a blog that links somewhere else or embeds images.
I used PerversionTracker (it's not what the name suggests ;-), at
http://perversiontracker.com/

Thanks in advance for any effort!

-- 
 ("\''/").__..-''"`-. .         Roberto Alsina
 `9_ 9  )   `-. (    ).`-._.`)  ralsina at kde.org
 (_Y_.)' ._   ) `._`.  " -.-'   KDE Developer (MFCH)
  _..`-'_..-_/ /-'_.'
(l)-'' ((i).' ((!.'             Buenos Aires - Argentina
Imminentizing the eschaton since 1971.




More information about the PyQt mailing list