QPtrList bug???

Martin Bammer e9525103 at stud4.tuwien.ac.at
Mon May 19 23:32:08 BST 2003


I'm using this class for dynamically creating, sorting and destroying lists. 
With an own created class it just works fine, BUT:

for (...) {
	QPtrList<float> maxList;

	for (....) {
		maxList.append(new float(max));

produces 90% a SEGFAULT!!
Debugging output is:
[New Thread 16384 (LWP 6584)]
[New Thread 32769 (LWP 6587)]
[New Thread 16386 (LWP 6588)]
0x40dadaf9 in wait4 () from /lib/libc.so.6
#0  0x40dadaf9 in wait4 () from /lib/libc.so.6
#1  0x40e20f60 in sys_sigabbrev () from /lib/libc.so.6
#2  0x40cae061 in waitpid () from /lib/libpthread.so.0
#3  0x403f5348 in KCrash::defaultCrashHandler(int) ()
   from /usr/lib/libkdecore.so.4
#4  0x40d3a9c8 in sigaction () from /lib/libc.so.6
#5  0x40a2f7d4 in QGList::clear() () from /usr/lib/libqt-mt.so.3
#6  0x08054395 in QPtrList<float>::clear() (this=0xbffff110)
    at /usr/share/qt3/include/qptrlist.h:78
#7  0x08054322 in ~QPtrList (this=0xbffff110)
    at /usr/share/qt3/include/qptrlist.h:55
#8  0x080542a8 in DoFFT::shot() (this=0x80edcb8) at dofft.cpp:661
#9  0x080586a5 in KSpion::shotSlot() (this=0x80eda90) at kspion.cpp:609
#10 0x0806480b in KSpionMainDialog::qt_invoke(int, QUObject*) (this=0x80eda90, 
    _id=71, _o=0xbffff3f0) at uimaindialog.moc:212
#11 0x08065304 in KSpion::qt_invoke(int, QUObject*) (this=0x80eda90, _id=71, 
    _o=0xbffff3f0) at kspion.moc.cpp:216
#12 0x4080f132 in QObject::activate_signal(QConnectionList*, QUObject*) ()
   from /usr/lib/libqt-mt.so.3
#13 0x4080efef in QObject::activate_signal(int) () from /usr/lib/libqt-mt.so.3
#14 0x40a7bdfc in QButton::clicked() () from /usr/lib/libqt-mt.so.3
#15 0x40883480 in QButton::mouseReleaseEvent(QMouseEvent*) ()
   from /usr/lib/libqt-mt.so.3
#16 0x4083c4ab in QWidget::event(QEvent*) () from /usr/lib/libqt-mt.so.3
#17 0x407bb1be in QApplication::internalNotify(QObject*, QEvent*) ()
   from /usr/lib/libqt-mt.so.3
#18 0x407baa76 in QApplication::notify(QObject*, QEvent*) ()
   from /usr/lib/libqt-mt.so.3
#19 0x4039284b in KApplication::notify(QObject*, QEvent*) ()
   from /usr/lib/libkdecore.so.4
#20 0x40769af6 in QETWidget::translateMouseEvent(_XEvent const*) ()
   from /usr/lib/libqt-mt.so.3
#21 0x40767937 in QApplication::x11ProcessEvent(_XEvent*) ()
   from /usr/lib/libqt-mt.so.3
#22 0x4077a6b9 in QEventLoop::processEvents(unsigned) ()
   from /usr/lib/libqt-mt.so.3
#23 0x407cc77b in QEventLoop::enterLoop() () from /usr/lib/libqt-mt.so.3
#24 0x407cc638 in QEventLoop::exec() () from /usr/lib/libqt-mt.so.3
#25 0x407bb3b8 in QApplication::exec() () from /usr/lib/libqt-mt.so.3
#26 0x0805d5d8 in main (argc=1, argv=0xbffffd24) at main.cpp:52

I don't really understand his segfault. QPtrList should take care to free alle 
the reserved memory on it's own, and segfault's aren't allegeable here.

Greetings, Martin

to unsubscribe from this list send an email to kdevelop-request at kdevelop.org with the following body:
unsubscribe »your-email-address«

More information about the KDevelop mailing list