Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-6883

Qt crashes when closing mainwindow while dock is floating

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 4.6.1
    • 4.6.0
    • None
    • openSuse 11.2, gcc (SUSE Linux) 4.4.1 [gcc-4_4-branch revision 150839]
    • 03baad51d584778a99f4b393232ccc1312db3391

    Description

      I made a small test program to show you what happens (attached).
      Mainly: I create a main window with a dock window, which contains a Q3ListView.
      Also I have a Toolbar which contains a ComboBox.
      when I run the app, make the dock floating aside the main window and then click the main windows close button, Qt crashes.
      The stack is:
      Program received signal SIGSEGV, Segmentation fault.
      0xb76b037b in QWidget::isAncestorOf(QWidget const*) const () from /usr/lib/libQtGui.so.4
      (gdb) bt
      #0 0xb76b037b in QWidget::isAncestorOf(QWidget const*) const () from /usr/lib/libQtGui.so.4
      #1 0xb76c1737 in QWidget::setParent(QWidget*, QFlags<Qt::WindowType>) () from /usr/lib/libQtGui.so.4
      #2 0xb76c1c0f in QWidget::setParent(QWidget*) () from /usr/lib/libQtGui.so.4
      #3 0xb76cac63 in QWidgetAction::releaseWidget(QWidget*) () from /usr/lib/libQtGui.so.4
      #4 0xb7b5a13f in ?? () from /usr/lib/libQtGui.so.4
      #5 0xb76c5df5 in QWidget::~QWidget() () from /usr/lib/libQtGui.so.4
      #6 0xb7b5476d in QToolBar::~QToolBar() () from /usr/lib/libQtGui.so.4
      #7 0xb742159c in QObjectPrivate::deleteChildren() () from /usr/lib/libQtCore.so.4
      #8 0xb76c5ee0 in QWidget::~QWidget() () from /usr/lib/libQtGui.so.4
      #9 0xb7ae58d5 in QMainWindow::~QMainWindow() () from /usr/lib/libQtGui.so.4
      #10 0x08048ed7 in main (argc=1, argv=0xbfffe974) at mainwin4.cxx:30

      It seems to happen only in this combination (Q3ListView and QComboBox in the toolbar).
      Trying with QListWidget does not crash (but I still need to use Q3ListView in my real application due to the porting effort).

      In my real application (which I compiled agains Qt-4.5.3) the stack looks like this:
      Program received signal SIGSEGV, Segmentation fault.
      0xb72d62fb in parent (this=<value optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qobject.h:243
      243 inline QObject *parent() const

      { return d_ptr->parent; }

      (gdb) bt
      #0 0xb72d62fb in parent (this=<value optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qobject.h:243
      #1 parentWidget (this=<value optimized out>) at ../../include/QtGui/../../src/gui/kernel/qwidget.h:988
      #2 QWidget::isAncestorOf (this=<value optimized out>) at kernel/qwidget.cpp:7460
      #3 0xb72e54a2 in moveStaticWidgets (reparented=<value optimized out>, this=<value optimized out>)
      at ../../include/QtGui/private/../../../src/gui/painting/qbackingstore_p.h:189
      #4 QWidget::setParent (reparented=<value optimized out>, this=<value optimized out>) at kernel/qwidget.cpp:9245
      #5 0xb72e595e in QWidget::setParent (this=0x0, parent=0x9a90460) at kernel/qwidget.cpp:9177
      #6 0xb72ecf26 in QWidgetAction::releaseWidget (this=0x9a90910, widget=0x9a90460) at kernel/qwidgetaction.cpp:208
      #7 0xb76b175c in QToolBarLayout::~QToolBarLayout (this=0x9a66130, __in_chrg=<value optimized out>)
      at widgets/qtoolbarlayout.cpp:101
      #8 0xb72deb82 in QWidget::~QWidget (this=0x9a65ef0, __in_chrg=<value optimized out>) at kernel/qwidget.cpp:1324
      #9 0xb76ac9ad in QToolBar::~QToolBar (this=0x9a65ef0, __in_chrg=<value optimized out>) at widgets/qtoolbar.cpp:576
      #10 0xb7f1225f in QObjectPrivate::deleteChildren (this=0x9856880) at kernel/qobject.cpp:1838
      #11 0xb72dec84 in QWidget::~QWidget (this=0x97bc120, __in_chrg=<value optimized out>) at kernel/qwidget.cpp:1367
      #12 0xb7641ed1 in QMainWindow::~QMainWindow (this=0x97bc120, __in_chrg=<value optimized out>) at widgets/qmainwindow.cpp:331

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            goffart Olivier Goffart (closed Nokia identity) (Inactive)
            mkoller Martin Koller
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes