Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.8.0, 5.9.0 Beta 3, 5.12.2
Description
When loading and unloading a Qt3D scene using a loader a crash is triggered sporatically (race condition):
"Cannot make QOpenGLContext current in a different thread."
Callstack:
Qt5Cored.dll!qt_message_fatal(QtMsgType __formal, const QMessageLogContext & context, const QString & message) Line 1681 C++ Qt5Cored.dll!QMessageLogger::fatal(const char * msg, ...) Line 795 C++ Qt5Guid.dll!QOpenGLContext::makeCurrent(QSurface * surface) Line 970 C++ Qt53DRenderd.dll!Qt3DRender::Render::Renderer::releaseGraphicsResources() Line 374 C++ Qt53DRenderd.dll!Qt3DRender::Render::Renderer::shutdown() Line 336 C++ Qt53DRenderd.dll!Qt3DRender::QRenderAspect::onUnregistered() Line 484 C++ Qt53DCored.dll!Qt3DCore::QAspectManager::unregisterAspect(Qt3DCore::QAbstractAspect * aspect) Line 222 C++ Qt53DCored.dll!Qt3DCore::QAspectManager::qt_static_metacall(QObject * _o, QMetaObject::Call _c, int _id, void * * _a) Line 123 C++ Qt5Cored.dll!QMetaCallEvent::placeMetaCall(QObject * object) Line 503 C++ Qt5Cored.dll!QObject::event(QEvent * e) Line 1263 C++ Qt5Cored.dll!QCoreApplicationPrivate::notify_helper(QObject * receiver, QEvent * event) Line 1123 C++ Qt5Cored.dll!doNotify(QObject * receiver, QEvent * event) Line 1063 C++ Qt5Cored.dll!QCoreApplication::notify(QObject * receiver, QEvent * event) Line 1050 C++ Qt5Guid.dll!QGuiApplication::notify(QObject * object, QEvent * event) Line 1667 C++ Qt5Cored.dll!QCoreApplication::notifyInternal2(QObject * receiver, QEvent * event) Line 988 C++ Qt5Cored.dll!QCoreApplication::sendEvent(QObject * receiver, QEvent * event) Line 231 C++ Qt5Cored.dll!QCoreApplicationPrivate::sendPostedEvents(QObject * receiver, int event_type, QThreadData * data) Line 1648 C++ Qt5Cored.dll!QEventDispatcherWin32::sendPostedEvents() Line 1059 C++ Qt5Cored.dll!QEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 648 C++ Qt5Cored.dll!QEventLoop::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 135 C++ Qt5Cored.dll!QEventLoop::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags, int maxTime) Line 242 C++ Qt53DCored.dll!Qt3DCore::QAspectManager::exec() Line 243 C++ Qt53DCored.dll!Qt3DCore::QAspectThread::run() Line 88 C++ Qt5Cored.dll!QThreadPrivate::start(void * arg) Line 380 C++ [External Code]
Before crashing often the error message "Failed to make context current: OpenGL resources will not be destroyed" is printed to the console.
Attached you find a small example which occasionally triggers the crash. If the crash isn't triggered, try to adjust the timer interval.