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

Application crashes when Qt3DRender::QSceneLoader "source" property is changed too quickly



    • Type: Bug
    • Status: Reported
    • Priority: P1: Critical
    • Resolution: Unresolved
    • Affects Version/s: 5.15.2
    • Fix Version/s: None
    • Component/s: Qt3D
    • Labels:
    • Platform/s:


      I added a 3D model preview function to my application that is built on top of Qt3D. When user hovers their mouse over an .obj file entry in a separate piece of GUI I load that file for preview using Qt3DRender::QSceneLoader. That is when I found this bug - if we change loader's "source" property too quickly our application crashes.

      Probably, the crash happens when we change the loader's source before it has time to finish loading the previous model.

      I reproduced this bug in a separate tiny application attached below.

      The test app uses a QML Timer object to switch a SceneLoader's source between two paths to .obj files embedded into the app's resources. It works fine if the timer's "interval" property is big enough (say 300 milliseconds), but crashes when the interval is small. Set it to 1 ms to guarantee an instant crash.

      Here is stacktrace of the crash:

      Qt3DCore::QNodePrivate::get(Qt3DCore::QNode*) 0x00007f425fcc1b60
       Qt3DRender::Render::OpenGL::Renderer::sendShaderChangesToFrontend(Qt3DCore::QAspectManager*) 0x00007f424f4bc183
       Qt3DRender::Render::GenericLambdaJobAndPostFramePrivate<std::function<void ()>, std::function<void (Qt3DCore::QAspectManager*)> >::postFrame(Qt3DCore::QAspectManager*) 0x00007f424f4c692f
       Qt3DCore::QScheduler::scheduleAndWaitForFrameAspectJobs(long long, bool) 0x00007f425fca94d9
       Qt3DCore::QAspectManager::processFrame() 0x00007f425fcb9dba
       QtPrivate::QFunctorSlotObject<Qt3DCore::QAspectManager::enterSimulationLoop()::{lambda()#1}, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void*, bool) 0x00007f425fcb9e99
       void doActivate<false>(QObject*, int, void**) 0x00007f425ea79e80
       QAbstractAnimation::stop() 0x00007f425e83d2af
       QUnifiedTimer::updateAnimationTimers(long long) 0x00007f425e83d6be
       QAnimationDriver::advanceAnimation(long long) 0x00007f425e83e2cc
       QObject::event(QEvent*) 0x00007f425ea70cab
       QCoreApplication::notifyInternal2(QObject*, QEvent*) 0x00007f425ea418f8
       QTimerInfoList::activateTimers() 0x00007f425ea9c5d9
       idleTimerSourceDispatch(_GSource*, int (void*), void*) 0x00007f425ea9cde9
       g_main_context_dispatch 0x00007f425b78ef2e
       <unknown> 0x00007f425b78f1c8
       g_main_context_iteration 0x00007f425b78f25c
       QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) 0x00007f425ea9d11c
       QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) 0x00007f425ea4030a
       QCoreApplication::exec() 0x00007f425ea492b3
       main main.cpp:11
       __libc_start_main 0x00007f425e2a409b
       _start 0x0000564dcb1eb1ba


      Thank you for your time!


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



            seanharmer Sean Harmer
            ivan_mikhnovich Ivan Mikhnovich
            1 Vote for this issue
            1 Start watching this issue



                Gerrit Reviews

                There are no open Gerrit changes