Results 1 to 2 of 2

Thread: winId() crashed

  1. #1
    Join Date
    Mar 2011
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default winId() crashed

    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:alette() 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 ...

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: winId() crashed

    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.

Similar Threads

  1. Replies: 16
    Last Post: 15th March 2010, 11:22
  2. Extra moveEvent after calling winId for a widget.
    By Alex_123 in forum Qt Programming
    Replies: 1
    Last Post: 31st December 2008, 17:57
  3. Can't get Widget from WinID()
    By abbapatris in forum Qt Programming
    Replies: 3
    Last Post: 9th July 2008, 17:25
  4. Problem with the QWidget::winId() method
    By yellowmat in forum Qt Programming
    Replies: 5
    Last Post: 22nd April 2008, 12:15
  5. Winid issue with Qt
    By Pragya in forum Qt Programming
    Replies: 6
    Last Post: 7th June 2007, 13:10

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.