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

Application with QOpenGLWidget on heap crashes on exit

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.5.0 RC
    • 5.5.0 Beta
    • QPA
    • None
    • OS X 10.10, mid-2009 MBP (NVIDIA)
    • macOS

    Description

      Run this app:

      #include <QOpenGLWidget>
      #include <QApplication>
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          QOpenGLWidget *glw = new QOpenGLWidget;
          glw->show();
          return a.exec();
      }
      

      and exit with Cmd-Q. The result is

      Test/OpenGLWidgetTest.app/Contents/MacOS/OpenGLWidgetTest' (x86_64)
      Process 6373 stopped
      * thread #1: tid = 0x16269, 0x000000010575b1bc libqcocoa_debug.dylib`QListData::size(this=0x0000000000000060) const + 12 at qlist.h:105, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x60)
          frame #0: 0x000000010575b1bc libqcocoa_debug.dylib`QListData::size(this=0x0000000000000060) const + 12 at qlist.h:105
         102 	    void remove(int i);
         103 	    void remove(int i, int n);
         104 	    void move(int from, int to);
      -> 105 	    inline int size() const { return d->end - d->begin; }
         106 	    inline bool isEmpty() const { return d->end  == d->begin; }
         107 	    inline void **at(int i) const { return d->array + d->begin + i; }
         108 	    inline void **begin() const { return d->array + d->begin; }
      (lldb) bt
      * thread #1: tid = 0x16269, 0x000000010575b1bc libqcocoa_debug.dylib`QListData::size(this=0x0000000000000060) const + 12 at qlist.h:105, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x60)
        * frame #0: 0x000000010575b1bc libqcocoa_debug.dylib`QListData::size(this=0x0000000000000060) const + 12 at qlist.h:105
          frame #1: 0x00000001057704cd libqcocoa_debug.dylib`QList<QCocoaWindow*>::indexOf(this=0x0000000000000060, t=0x00007fff5fbfeb98, from=0) const + 109 at qlist.h:941
          frame #2: 0x000000010576f981 libqcocoa_debug.dylib`QList<QCocoaWindow*>::removeAll(this=0x0000000000000060, _t=0x00007fff5fbfeb98) + 49 at qlist.h:849
          frame #3: 0x0000000105767932 libqcocoa_debug.dylib`QCocoaWindow::~QCocoaWindow(this=0x00000001031d4080) + 498 at qcocoawindow.mm:438
          frame #4: 0x0000000105767c05 libqcocoa_debug.dylib`QCocoaWindow::~QCocoaWindow(this=0x00000001031d4080) + 21 at qcocoawindow.mm:407
          frame #5: 0x0000000105767c29 libqcocoa_debug.dylib`QCocoaWindow::~QCocoaWindow(this=0x00000001031d4080) + 25 at qcocoawindow.mm:407
          frame #6: 0x0000000100de9243 libQt5Gui_debug.5.dylib`QWindow::destroy(this=0x00000001031c99e0) + 499 at qwindow.cpp:1626
          frame #7: 0x0000000100df0775 libQt5Gui_debug.5.dylib`QOffscreenSurface::destroy(this=0x00000001031c9d20) + 149 at qoffscreensurface.cpp:209
          frame #8: 0x0000000100df0e07 libQt5Gui_debug.5.dylib`QOffscreenSurface::setScreen(this=0x00000001031c9d20, newScreen=0x0000000000000000) + 151 at qoffscreensurface.cpp:313
          frame #9: 0x0000000100df0f59 libQt5Gui_debug.5.dylib`QOffscreenSurface::screenDestroyed(this=0x00000001031c9d20, object=0x000000010314cd30) + 73 at qoffscreensurface.cpp:335
          frame #10: 0x0000000101281bb1 libQt5Gui_debug.5.dylib`QOffscreenSurface::qt_static_metacall(_o=0x00000001031c9d20, _c=InvokeMetaMethod, _id=1, _a=0x00007fff5fbff1d0) + 129 at moc_qoffscreensurface.cpp:80
          frame #11: 0x0000000101de884b libQt5Core_debug.5.dylib`QMetaObject::activate(sender=0x000000010314cd30, signalOffset=0, local_signal_index=0, argv=0x00007fff5fbff1d0) + 2955 at qobject.cpp:3718
          frame #12: 0x0000000101de7cad libQt5Core_debug.5.dylib`QMetaObject::activate(sender=0x000000010314cd30, m=0x00000001021ec240, local_signal_index=0, argv=0x00007fff5fbff1d0) + 61 at qobject.cpp:3583
          frame #13: 0x0000000101ddf4e7 libQt5Core_debug.5.dylib`QObject::destroyed(this=0x000000010314cd30, _t1=0x000000010314cd30) + 71 at moc_qobject.cpp:211
          frame #14: 0x0000000101ddec09 libQt5Core_debug.5.dylib`QObject::~QObject(this=0x000000010314cd30) + 425 at qobject.cpp:904
          frame #15: 0x0000000100e2785b libQt5Gui_debug.5.dylib`QScreen::~QScreen(this=0x000000010314cd30) + 587 at qscreen.cpp:104
          frame #16: 0x0000000100e278c5 libQt5Gui_debug.5.dylib`QScreen::~QScreen(this=0x000000010314cd30) + 21 at qscreen.cpp:74
          frame #17: 0x0000000100e278e9 libQt5Gui_debug.5.dylib`QScreen::~QScreen(this=0x000000010314cd30) + 25 at qscreen.cpp:74
          frame #18: 0x0000000100dc4b26 libQt5Gui_debug.5.dylib`QPlatformIntegration::destroyScreen(this=0x0000000103102fc0, screen=0x00000001027797a0) + 102 at qplatformintegration.cpp:473
          frame #19: 0x0000000105758e56 libqcocoa_debug.dylib`QCocoaIntegration::~QCocoaIntegration(this=0x0000000103102fc0) + 406 at qcocoaintegration.mm:334
          frame #20: 0x00000001057590d5 libqcocoa_debug.dylib`QCocoaIntegration::~QCocoaIntegration(this=0x0000000103102fc0) + 21 at qcocoaintegration.mm:312
          frame #21: 0x00000001057590f9 libqcocoa_debug.dylib`QCocoaIntegration::~QCocoaIntegration(this=0x0000000103102fc0) + 25 at qcocoaintegration.mm:312
          frame #22: 0x0000000100dd88d1 libQt5Gui_debug.5.dylib`QGuiApplicationPrivate::~QGuiApplicationPrivate(this=0x000000010271e660) + 465 at qguiapplication.cpp:1391
          frame #23: 0x00000001000578e0 libQt5Widgets_debug.5.dylib`QApplicationPrivate::~QApplicationPrivate(this=0x000000010271e660) + 144 at qapplication.cpp:192
          frame #24: 0x0000000100057905 libQt5Widgets_debug.5.dylib`QApplicationPrivate::~QApplicationPrivate(this=0x000000010271e660) + 21 at qapplication.cpp:189
          frame #25: 0x0000000100057929 libQt5Widgets_debug.5.dylib`QApplicationPrivate::~QApplicationPrivate(this=0x000000010271e660) + 25 at qapplication.cpp:189
          frame #26: 0x0000000101df08de libQt5Core_debug.5.dylib`QScopedPointerDeleter<QObjectData>::cleanup(pointer=0x000000010271e660) + 46 at qscopedpointer.h:54
          frame #27: 0x0000000101df0898 libQt5Core_debug.5.dylib`QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> >::~QScopedPointer(this=0x00007fff5fbffa78) + 24 at qscopedpointer.h:101
          frame #28: 0x0000000101decdf5 libQt5Core_debug.5.dylib`QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData> >::~QScopedPointer(this=0x00007fff5fbffa78) + 21 at qscopedpointer.h:99
          frame #29: 0x0000000101ddf456 libQt5Core_debug.5.dylib`QObject::~QObject(this=0x00007fff5fbffa70) + 2550 at qobject.cpp:1039
          frame #30: 0x0000000101d97b4e libQt5Core_debug.5.dylib`QCoreApplication::~QCoreApplication(this=0x00007fff5fbffa70) + 446 at qcoreapplication.cpp:838
          frame #31: 0x0000000100dd6128 libQt5Gui_debug.5.dylib`QGuiApplication::~QGuiApplication(this=0x00007fff5fbffa70) + 392 at qguiapplication.cpp:607
          frame #32: 0x000000010005a229 libQt5Widgets_debug.5.dylib`QApplication::~QApplication(this=0x00007fff5fbffa70) + 1001 at qapplication.cpp:887
          frame #33: 0x000000010005a2e5 libQt5Widgets_debug.5.dylib`QApplication::~QApplication(this=0x00007fff5fbffa70) + 21 at qapplication.cpp:818
          frame #34: 0x0000000100003f02 OpenGLWidgetTest`main(argc=1, argv=0x00007fff5fbffab8) + 178 at main.cpp:10
          frame #35: 0x0000000100003e44 OpenGLWidgetTest`start + 52
      

      When changing to stack allocation

         QOpenGLWidget glw;
          glw.show();
      

      it's fine.

      Attachments

        Issue Links

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

          Activity

            People

              lagocs Laszlo Agocs
              lagocs Laszlo Agocs
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes