[PyKDE] canvas related segfault

Hans-Peter Jansen hpj at urpla.net
Mon Jan 31 23:52:54 GMT 2005


Hi Phil,

there was a nice little qt tile based imaging example published today 
in the german linux magazine, and I thought, it would be nice to play 
with in PyQt, thus I converted it. Now it appears, that after loading 
an image and quitting, it segfaults reproducible, unless I use the 
WDestructiveClose flag on the main window. Here's a typical backtrace:

#0  0x40f5050f in QCanvasSprite::bottomEdge() const () from /usr/lib/libqt-mt.so.3
#1  0x40f508cb in QCanvasSprite::removeFromChunks() () from /usr/lib/libqt-mt.so.3
#2  0x40f5505d in QCanvasSprite::~QCanvasSprite() () from /usr/lib/libqt-mt.so.3
#3  0x4159335e in sipQCanvasSprite::~sipQCanvasSprite() ()
   from /usr/lib/python2.3/site-packages/qtcanvas.so
#4  0x40f4a3e6 in QCanvas::~QCanvas() () from /usr/lib/libqt-mt.so.3
#5  0x415a30d1 in sipQCanvas::~sipQCanvas() () from /usr/lib/python2.3/site-packages/qtcanvas.so
#6  0x40d80a02 in QWidget::~QWidget() () from /usr/lib/libqt-mt.so.3
#7  0x40e6055b in QScrollView::~QScrollView() () from /usr/lib/libqt-mt.so.3
#8  0x40f50db1 in QCanvasView::~QCanvasView() () from /usr/lib/libqt-mt.so.3
#9  0x415967cf in sipQCanvasView::~sipQCanvasView() ()
   from /usr/lib/python2.3/site-packages/qtcanvas.so
#10 0x40d80a02 in QWidget::~QWidget() () from /usr/lib/libqt-mt.so.3
#11 0x409f6c8c in sipQWidget::~sipQWidget() () from /usr/lib/python2.3/site-packages/qt.so
#12 0x40d80a02 in QWidget::~QWidget() () from /usr/lib/libqt-mt.so.3
#13 0x40e3ffc9 in QMainWindow::~QMainWindow() () from /usr/lib/libqt-mt.so.3
#14 0x40842f8c in sipQMainWindow::~sipQMainWindow() () from /usr/lib/python2.3/site-packages/qt.so
#15 0x4084d698 in dealloc_QMainWindow(_sipWrapper*) () from /usr/lib/python2.3/site-packages/qt.so
#16 0x4001cd37 in sipWrapper_dealloc () from /usr/lib/python2.3/site-packages/sip.so
#17 0x4008da11 in subtype_dealloc () from /usr/lib/libpython2.3.so.1.0
#18 0x4007b479 in insertdict () from /usr/lib/libpython2.3.so.1.0
#19 0x4007b755 in PyDict_SetItem () from /usr/lib/libpython2.3.so.1.0
#20 0x4007eea2 in _PyModule_Clear () from /usr/lib/libpython2.3.so.1.0
#21 0x400c6af7 in PyImport_Cleanup () from /usr/lib/libpython2.3.so.1.0
#22 0x400cf7fa in Py_Finalize () from /usr/lib/libpython2.3.so.1.0
#23 0x400d6fdf in Py_Main () from /usr/lib/libpython2.3.so.1.0
#24 0x080486f7 in main ()

Needless to say, the c++ version doesn't show this behaviour, which
is available here:
http://www.linux-magazin.de/Service/Listings/2005/03/Qt

Just extract the attached tarball, make && mainwindow.py. 
The interesting piece is closeImage() in canvasview.py. Do you 
have any idea, what's going wrong here?

BTW, cute stuff, isn't it?

@world: any proposals, how to make it faster? 
 - Sure, we could stick processOneTile() back into c++
 - Any advances on the PIL with PyQt front?

Cheers,
Pete
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pyimager-0.1.tar.gz
Type: application/x-tgz
Size: 4781 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20050201/a80e4b60/pyimager-0.1.tar.bin


More information about the PyQt mailing list