PDA

View Full Version : Bug in Qt or Qt Designer or my mistake?



[maTa]
8th February 2006, 22:29
Hello, I am creating application MDI based and somehow it behaives strange. Developping in Qt Designer, I dont write code much in the source files and it causes some strange error when I activate one of the forms in my project (Form3 actually):

*** glibc detected *** corrupted double-linked list: 0x080d1ea0 ***

Quiting the application.

The thing is that when I put Grid Layout on Form3 with all elements included I get this error, but when I regroup them with vertical and horizontal layout it is not present. Also the Table on Form2 behaives like fixed, when Form2 maximized I dont see the Table on it also resized...

I share the source with you if you can help me...

Using:
Qt 3.3.4
KDE 3.4.0
Fedora Core 4

Thanks in advance...

jacek
8th February 2006, 22:46
']*** glibc detected *** corrupted double-linked list: 0x080d1ea0 ***
It's hard to find such problem just by looking at the sources. Did you try to run your program from gdb? Could you post the backtrace (don't forget to compile your program in debug mode)?


void Form2::dodaj()
{
Form3 *forma3 = new Form3();
forma3->setModal(TRUE);
forma3->show();
}
You use such code in several places, but this leads to a memory leak, because you don't delete the form when it's closed.

Try:
void Form2::dodaj()
{
Form3 *forma3 = new Form3( 0, 0, Qt::WDestructiveClose );
// ...
}

[maTa]
8th February 2006, 23:00
Try:
void Form2::dodaj()
{
Form3 *forma3 = new Form3( 0, 0, Qt::WDestructiveClose );
// ...
}


i got:

Program received signal SIGSEGV, Segmentation fault.
0x02593023 in QGListIterator::operator++ () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
(gdb)
Single stepping until exit from function _ZN14QGListIteratorppEv,
which has no line number information.
Couldn't get registers: No such process.
(gdb)
Single stepping until exit from function _ZN14QGListIteratorppEv,
which has no line number information.
Cannot fetch general-purpose registers for thread -1208314176: generic error
(gdb) backtrace
#0 0x02593023 in QGListIterator::operator++ () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
Error accessing memory address 0xbf8d2868: No such process.
(gdb)


hmm...
btw. posted from diff. comp :)

jacek
8th February 2006, 23:25
']i got:

Program received signal SIGSEGV, Segmentation fault.
0x02593023 in QGListIterator::operator++ () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
(gdb)
Single stepping until exit from function _ZN14QGListIteratorppEv,
which has no line number information.
Couldn't get registers: No such process.
Then try (make sure you have "debug" instead of "release" in CONFIG in your .pro file):

(gdb) run
...
Program received signal SIGSEGV, Segmentation fault.
...
(gdb) bt
<post this part>
(gdb) quit

[maTa]
8th February 2006, 23:33
here you go:


Program received signal SIGSEGV, Segmentation fault.
0x02593023 in QGListIterator::operator++ ()
from /usr/lib/qt-3.3/lib/libqt-mt.so.3
(gdb) bt
#0 0x02593023 in QGListIterator::operator++ ()
from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#1 0x02243761 in QApplication::sendPostedEvents ()
from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#2 0x022e418f in QWidget::show () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#3 0x02446556 in QDialog::show () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#4 0x0805b651 in Form2::qt_invoke (this=0x9207000, _id=47, _o=0xbffa5aa8)
at .moc/moc_form2.cpp:102
#5 0x022a6d17 in QObject::activate_signal ()
from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#6 0x022a7274 in QObject::activate_signal ()
from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#7 0x0262312e in QButton::clicked () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#8 0x02346a03 in QButton::mouseReleaseEvent ()
from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#9 0x022e5127 in QWidget::event () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#10 0x0224208d in QApplication::internalNotify ()
from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#11 0x02242fef in QApplication::notify ()
from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#12 0x021d9706 in QETWidget::translateMouseEvent ()
from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#13 0x021d7eb3 in QApplication::x11ProcessEvent ()
---Type <return> to continue, or q <return> to quit---
from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#14 0x021ebfc8 in QEventLoop::processEvents ()
from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#15 0x0225a74b in QEventLoop::enterLoop ()
from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#16 0x0225a656 in QEventLoop::exec () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#17 0x02241a59 in QApplication::exec () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#18 0x080507cb in main (argc=1, argv=0x79) at .ui/../form1.ui.h:41
(gdb)

jacek
9th February 2006, 00:02
']#2 0x022e418f in QWidget::show () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#3 0x02446556 in QDialog::show () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#4 0x0805b651 in Form2::qt_invoke (this=0x9207000, _id=47, _o=0xbffa5aa8)
at .moc/moc_form2.cpp:102
It looks like it crashes when you try to show Form3 in Form2::dodaj(). I just wonder why it doesn't crash on my system (I use Qt 3.3.5).

Did you try to run "make clean && qmake && make"? Does it still crash?

Does it crash with this code?

void Form2::dodaj()
{
}