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

QGLContext sharing with the Qt global context causes Qt to crash on application shutdown

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.4.2
    • 5.4.1, 5.5.0
    • GUI: OpenGL
    • None
    • edd555425a08f9e074f0a4d9333862636ccaae8d

    Description

      Testcase

      #include <QApplication>
      #include <QGLContext>
      #include <QOpenGLContext>
      
      int main(int argc, char **argv)
      {
          QApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true);
          QApplication app(argc, argv);
          
          QOpenGLContext *globalContext = QOpenGLContext::globalShareContext();
          
          QOpenGLContext *context = new QOpenGLContext;
          context->setFormat(globalContext->format());
          context->setShareContext(globalContext);
          if (!context->create())
              qFatal("Could not create context");
          
          Q_ASSERT(QOpenGLContext::areSharing(context, globalContext));
          
          QGLContext *ctx = QGLContext::fromOpenGLContext(context);
          Q_UNUSED(ctx);
      }
      

      Backtrace

      0	QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData>>::data	qscopedpointer.h	135	0x7ffff6076816	
      1	qGetPtrHelper<QScopedPointer<QObjectData>>	qglobal.h	978	0x7ffff636a6d7	
      2	QObject::d_func	qobject.h	110	0x7ffff636a8a8	
      3	QObject::thread	qobject.cpp	1413	0x7ffff6360ec0	
      4	QGLSignalProxy::instance	qgl.cpp	166	0x7ffff7b72546	
      5	QGLContext::~QGLContext	qgl.cpp	2205	0x7ffff7b76165	
      6	QGLContext::~QGLContext	qgl.cpp	2207	0x7ffff7b761c2	
      7	qDeleteQGLContext	qgl.cpp	2155	0x7ffff7b75f66	
      8	QOpenGLContext::deleteQGLContext	qopenglcontext.cpp	1102	0x7ffff6995925	
      9	QOpenGLContext::destroy	qopenglcontext.cpp	629	0x7ffff69949e9	
      10	QOpenGLContext::~QOpenGLContext	qopenglcontext.cpp	669	0x7ffff6994baa	
      11	QOpenGLContext::~QOpenGLContext	qopenglcontext.cpp	674	0x7ffff6994bf4	
      12	QGuiApplicationPrivate::~QGuiApplicationPrivate	qguiapplication.cpp	1367	0x7ffff6948dfb	
      13	QApplicationPrivate::~QApplicationPrivate	qapplication.cpp	180	0x7ffff7289f06	
      14	QApplicationPrivate::~QApplicationPrivate	qapplication.cpp	184	0x7ffff7289f38	
      15	QScopedPointerDeleter<QObjectData>::cleanup	qscopedpointer.h	54	0x7ffff636d230	
      16	QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData>>::~QScopedPointer	qscopedpointer.h	101	0x7ffff636b72f	
      17	QObject::~QObject	qobject.cpp	883	0x7ffff63606f2	
      18	QCoreApplication::~QCoreApplication	qcoreapplication.cpp	787	0x7ffff6328238	
      19	QGuiApplication::~QGuiApplication	qguiapplication.cpp	564	0x7ffff6945d91	
      20	QApplication::~QApplication	qapplication.cpp	811	0x7ffff728c199	
      21	main	main.cpp	21	0x400ea7	
      

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-44621
          # Subject Branch Project Status CR V

          Activity

            People

              peppe Giuseppe D'Angelo
              peppe Giuseppe D'Angelo
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes