PDA

View Full Version : winId() crashed



nedivi
6th March 2011, 13:01
Hi,

winId() crashed once in a while on memory allocation from one of my function(Can not simulate this problem).
I have no idea why.
We just switched to QT-4.7.1 and it doesn't happen with the old version, QT-4.2.3 .

Can someone help me?
Below you can see the printout of the debugger.

Thanks
Jacob


(gdb) backtrace
#0 0x0000000000ae35e0 in vtable for __cxxabiv1::__si_class_type_info ()
#1 0x00002b01eef4e7ed in QWidget::isActiveWindow() const () from /usr/Local/Qt-4.7.1/lib/libQtGui.so.4
#2 0x00002b01eef4ed65 in QWidget::palette() const () from /usr/Local/Qt-4.7.1/lib/libQtGui.so.4
#3 0x00002b01eef9aaf4 in QWidgetPrivate::updateSystemBackground() () from /usr/Local/Qt-4.7.1/lib/libQtGui.so.4
#4 0x00002b01eef54d6e in QWidget::create(unsigned long, bool, bool) () from /usr/Local/Qt-4.7.1/lib/libQtGui.so.4
#5 0x00002b01eef556e8 in QWidgetPrivate::createWinId(unsigned long) () from /usr/Local/Qt-4.7.1/lib/libQtGui.so.4
#6 0x00002b01eef556e8 in QWidgetPrivate::createWinId(unsigned long) () from /usr/Local/Qt-4.7.1/lib/libQtGui.so.4
#7 0x00002b01eef556e8 in QWidgetPrivate::createWinId(unsigned long) () from /usr/Local/Qt-4.7.1/lib/libQtGui.so.4
#8 0x00002b01eef556e8 in QWidgetPrivate::createWinId(unsigned long) () from /usr/Local/Qt-4.7.1/lib/libQtGui.so.4
#9 0x00002b01eef556e8 in QWidgetPrivate::createWinId(unsigned long) () from /usr/Local/Qt-4.7.1/lib/libQtGui.so.4
#10 0x00002b01eef556e8 in QWidgetPrivate::createWinId(unsigned long) () from /usr/Local/Qt-4.7.1/lib/libQtGui.so.4
#11 0x00002b01eef556e8 in QWidgetPrivate::createWinId(unsigned long) () from /usr/Local/Qt-4.7.1/lib/libQtGui.so.4
#12 0x00002b01eef556e8 in QWidgetPrivate::createWinId(unsigned long) () from /usr/Local/Qt-4.7.1/lib/libQtGui.so.4
#13 0x00002b01eef556e8 in QWidgetPrivate::createWinId(unsigned long) () from /usr/Local/Qt-4.7.1/lib/libQtGui.so.4
#14 0x00002b01eef556e8 in QWidgetPrivate::createWinId(unsigned long) () from /usr/Local/Qt-4.7.1/lib/libQtGui.so.4
#15 0x00002b01eef556e8 in QWidgetPrivate::createWinId(unsigned long) () from /usr/Local/Qt-4.7.1/lib/libQtGui.so.4
#16 0x00002b01eef556e8 in QWidgetPrivate::createWinId(unsigned long) () from /usr/Local/Qt-4.7.1/lib/libQtGui.so.4
#17 0x00002b01eef556e8 in QWidgetPrivate::createWinId(unsigned long) () from /usr/Local/Qt-4.7.1/lib/libQtGui.so.4
#18 0x00002b01eef556e8 in QWidgetPrivate::createWinId(unsigned long) () from /usr/Local/Qt-4.7.1/lib/libQtGui.so.4
#19 0x00002b01eef556e8 in QWidgetPrivate::createWinId(unsigned long) () from /usr/Local/Qt-4.7.1/lib/libQtGui.so.4
#20 0x00002b01eef5579e in QWidget::winId() const () from /usr/Local/Qt-4.7.1/lib/libQtGui.so.4
#21 0x00002b020470d616 in LiveVideoWidgetXv::displayFrameImpl (this=0xb7303d0, frame=0xa3e43a0, grabber_thread=true) at ...

d_stranz
6th March 2011, 23:03
It is very unlikely that the winId() method is the source of the crash. It is much more likely that your code is doing something to corrupt the memory used by the widget, either in the LiveVideoWidgetXv::displayFrameImpl() method or somewhere before that.

Differences in memory use or layout between Qt 4.2.3 and 4.7.1 have probably now caused this bug to become apparent in your app.

Have you recompiled -all- of the libraries in your app that also use Qt? If one of your libraries is still using Qt 4.2 and your app is using 4.7, then it is entirely possible that QObject, QWidget, or any of the other base classes that lie between your class and QWidget have changed.