[PyKDE] PyQt Segfault - Stack Dump

Albert.Anderson at mscsoftware.com Albert.Anderson at mscsoftware.com
Fri Nov 14 14:26:02 GMT 2003


I have a similar problem under SIP 3.3/PyQt 3.3/Qt 3.0.4. I haven't solved 
it, though. I don't know if it's a SIP/PyQt problem or a Qt problem.

I think you will find that the focusData() list is corrupted or has 
corrupted objects in it. In your case, looks like the QWidget destructor 
is scanning the focusData() list and finding a QWidget supposedly at 
address 0xffffffff. No wonder Qt has a problem finding this object's 
parent.

In my case, I see crashes when using tab to change the keyboard focus. 
This leads to a similar scan of focusData(), and crashes when focusProxy() 
gets called on a non-existant or corrupted widget.

The corruption must happen sometime previously, but I don't know when. It 
seems related to deleting widgets/items associated with a table. In my 
case, I'm deleting and recreating the entire table. As far as I can tell 
by watching reference counts and using prints in __del__ methods, the 
deletions are happening as expected at the python level. This is supposed 
to clean up the focusData() list. Somehow either the cleanup isn't 
happening or the list/objects are being overwritten in some other way.

That's as far as I've gotten. Hope that helps.

_________________________________
Andy Anderson
MSC.Software Corporation
Andy.Anderson at mscsoftware.com

pykde-admin at mats.imk.fraunhofer.de wrote on 11/11/2003 01:16:08 AM:

> Ok, in changing selection/focus from one table cell to another, thisis 
what I 
> got (I'm using sip-3.8/pyqt-3.8.1/qt-3.2.2):
> 
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 16384 (LWP 2947)]
> 0x404cf324 in QObject::parent() const (this=0xffffffff) at qobject.h:154
> 154     qobject.h: No such file or directory.
>         in qobject.h
> (gdb) bt
> #0  0x404cf324 in QObject::parent() const (this=0xffffffff) at 
qobject.h:154
> #1  0x404ce0d3 in QWidget::parentWidget(bool) const (this=0xffffffff, 
> sameWindow=false) at qwidget.h:852
> #2  0x405f2c3b in ~QWidget (this=0x8ac60d0) at kernel/qwidget.cpp:895
> #3  0x4068b42f in ~QFrame (this=0x8ac60d0) at .moc/debug-shared-mt/
> moc_qvbox.cpp:28
> #4  0x406a3c67 in ~QLineEdit (this=0x8ac60d0) at 
widgets/qlineedit.cpp:441
> #5  0x405b40a6 in QObject::event(QEvent*) (this=0x8ac60d0, e=0x8a8c2c8) 
at 
> kernel/qobject.cpp:750
> #6  0x405f9591 in QWidget::event(QEvent*) (this=0x8ac60d0, e=0x8a8c2c8) 
at 
> kernel/qwidget.cpp:4408
> #7  0x406a59f2 in QLineEdit::event(QEvent*) (this=0x8ac60d0, 
e=0x8a8c2c8) at 
> widgets/qlineedit.cpp:1406
> ...
> I'll include the rest below for the interested... It looks like the 
parent 
> information was somehow invalid?  It doesn't look like the destructor 
did 
> anything that it shouldn't have, but I didn't really trace through the 
whole 
> thing.
> 
> kernel/qwidget.cpp:895:
> 
>     886     // Remove myself and all children from the can-take-focus 
list
>     887     QFocusData *f = focusData( FALSE );
>     888     if ( f ) {
>     889     QPtrListIterator<QWidget> it(f->focusWidgets);
>     890     QWidget *w;
>     891     while ( (w = it.current()) ) {
>     892         ++it;
>     893         QWidget * p = w;
>     894         while( p && p != this )
>     895         p = p->parentWidget();
>     896         if ( p ) // my descendant
>     897         f->focusWidgets.removeRef( w );
>     898     }
>     899     }
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20031113/1f473dd4/attachment.html


More information about the PyQt mailing list