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

Crash in QQuickParticleEmitter::emitWindow while accessing invalid qml context

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P1: Critical
    • None
    • 5.12.7
    • Quick: Particles
    • None
    • Linux/X11

    Description

      Sometimes our application crashes with the following stacktrace:

      ==17017==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000010 (pc 0x7f5194a31b1e bp 0x7ffee1b17840 sp 0x7ffee1b16e60 T0)
      ==17017==The signal is caused by a READ memory access.
      ==17017==Hint: address points to the zero page.
          #0 0x7f5194a31b1d in QJSEngine::handle() const ../../include/QtQml/../../../../../Downloads/qt/qtdeclarative/src/qml/jsapi/qjsengine.h:116
          #1 0x7f5194a31b1d in QQuickParticleEmitter::emitWindow(int) /mnt/work/source/ntgdeps/ba/Downloads/qt/qtdeclarative/src/particles/qquickparticleemitter.cpp:489
          #2 0x7f5194a730d9 in QQuickParticleSystem::updateCurrentTime(int) /mnt/work/source/ntgdeps/ba/Downloads/qt/qtdeclarative/src/particles/qquickparticlesystem.cpp:1077
          #3 0x7f5194a8c960 in QQuickParticleSystemAnimation::updateCurrentTime(int) /mnt/work/source/ntgdeps/ba/Downloads/qt/qtdeclarative/src/particles/qquickparticlesystem_p.h:478
          #4 0x7f52007fdab9 in QAbstractAnimation::setCurrentTime(int) /mnt/work/source/ntgdeps/ba/Downloads/qt/qtbase/src/corelib/animation/qabstractanimation.cpp:1322
          #5 0x7f52007fdfc1 in QAnimationTimer::updateAnimationsTime(long long) /mnt/work/source/ntgdeps/ba/Downloads/qt/qtbase/src/corelib/animation/qabstractanimation.cpp:607
          #6 0x7f52007f6a6a in QUnifiedTimer::updateAnimationTimers(long long) /mnt/work/source/ntgdeps/ba/Downloads/qt/qtbase/src/corelib/animation/qabstractanimation.cpp:323
          #7 0x7f52007f895a in QAnimationDriver::advanceAnimation(long long) /mnt/work/source/ntgdeps/ba/Downloads/qt/qtbase/src/corelib/animation/qabstractanimation.cpp:821
          #8 0x7f5204831487 in QSGAnimationDriver::advance() (/mnt/work/source/ntgdeps/ba/install/lib/libQt5Quick.so.5+0x42f487)
          #9 0x7f52048e234e in QSGThreadedRenderLoop::polishAndSync(QSGThreadedRenderLoop::Window*, bool) /mnt/work/source/ntgdeps/ba/Downloads/qt/qtdeclarative/src/quick/scenegraph/qsgthreadedrenderloop.cpp:1229
          #10 0x7f52048e3745 in QSGThreadedRenderLoop::handleUpdateRequest(QQuickWindow*) /mnt/work/source/ntgdeps/ba/Downloads/qt/qtdeclarative/src/quick/scenegraph/qsgthreadedrenderloop.cpp:1042
          #11 0x7f5204a94272 in QQuickWindow::event(QEvent*) /mnt/work/source/ntgdeps/ba/Downloads/qt/qtdeclarative/src/quick/items/qquickwindow.cpp:1685
          #12 0x7f5200e9f4fa in QCoreApplicationPrivate::notify_helper(QObject*, QEvent*) /mnt/work/source/ntgdeps/ba/Downloads/qt/qtbase/src/corelib/kernel/qcoreapplication.cpp:1249
          #13 0x7f5200e9f749 in doNotify /mnt/work/source/ntgdeps/ba/Downloads/qt/qtbase/src/corelib/kernel/qcoreapplication.cpp:1178
          #14 0x7f5200e9fc18 in QCoreApplication::notify(QObject*, QEvent*) /mnt/work/source/ntgdeps/ba/Downloads/qt/qtbase/src/corelib/kernel/qcoreapplication.cpp:1164
          #15 0x7f5201a4593e in QGuiApplication::notify(QObject*, QEvent*) /mnt/work/source/ntgdeps/ba/Downloads/qt/qtbase/src/gui/kernel/qguiapplication.cpp:1796
          #16 0x7f5200e9f9b8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) /mnt/work/source/ntgdeps/ba/Downloads/qt/qtbase/src/corelib/kernel/qcoreapplication.cpp:1088
          #17 0x7f5200ea02ca in QCoreApplication::sendEvent(QObject*, QEvent*) /mnt/work/source/ntgdeps/ba/Downloads/qt/qtbase/src/corelib/kernel/qcoreapplication.cpp:1476
          #18 0x7f5201a1f27f in QPlatformWindow::deliverUpdateRequest() /mnt/work/source/ntgdeps/ba/Downloads/qt/qtbase/src/gui/kernel/qplatformwindow.cpp:793
          #19 0x7f5201a175bb in QPlatformWindow::windowEvent(QEvent*) /mnt/work/source/ntgdeps/ba/Downloads/qt/qtbase/src/gui/kernel/qplatformwindow.cpp:478
          #20 0x7f51f5de073e in QXcbWindow::windowEvent(QEvent*) /mnt/work/source/ntgdeps/ba/Downloads/qt/qtbase/src/plugins/platforms/xcb/qxcbwindow.cpp:2380
          #21 0x7f5201a2f16b in QGuiApplicationPrivate::sendQWindowEventToQPlatformWindow(QWindow*, QEvent*) /mnt/work/source/ntgdeps/ba/Downloads/qt/qtbase/src/gui/kernel/qguiapplication.cpp:1828
          #22 0x7f5201a4592c in QGuiApplication::notify(QObject*, QEvent*) /mnt/work/source/ntgdeps/ba/Downloads/qt/qtbase/src/gui/kernel/qguiapplication.cpp:1792
          #23 0x7f5200e9f9b8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) /mnt/work/source/ntgdeps/ba/Downloads/qt/qtbase/src/corelib/kernel/qcoreapplication.cpp:1088
          #24 0x7f5200ea02ca in QCoreApplication::sendEvent(QObject*, QEvent*) /mnt/work/source/ntgdeps/ba/Downloads/qt/qtbase/src/corelib/kernel/qcoreapplication.cpp:1476
          #25 0x7f5200ff5952 in QTimerInfoList::activateTimers() /mnt/work/source/ntgdeps/ba/Downloads/qt/qtbase/src/corelib/kernel/qtimerinfo_unix.cpp:643
          #26 0x7f5200ff7819 in timerSourceDispatch /mnt/work/source/ntgdeps/ba/Downloads/qt/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:182
          #27 0x7f51fc3e9416 in g_main_context_dispatch (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x4c416)
          #28 0x7f51fc3e964f  (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x4c64f)
          #29 0x7f51fc3e96db in g_main_context_iteration (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x4c6db)
          #30 0x7f5200ff8d1c in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) /mnt/work/source/ntgdeps/ba/Downloads/qt/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:422
          #31 0x7f51f5e25b01 in QXcbGlibEventDispatcher::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) /mnt/work/source/ntgdeps/ba/Downloads/qt/qtbase/src/plugins/platforms/xcb/qxcbeventdispatcher.cpp:143
          #32 0x7f5200e98189 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) /mnt/work/source/ntgdeps/ba/Downloads/qt/qtbase/src/corelib/kernel/qeventloop.cpp:138
          #33 0x7f5200e9959e in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) /mnt/work/source/ntgdeps/ba/Downloads/qt/qtbase/src/corelib/kernel/qeventloop.cpp:225
          #34 0x7f5200eb7b48 in QCoreApplication::exec() /mnt/work/source/ntgdeps/ba/Downloads/qt/qtbase/src/corelib/kernel/qcoreapplication.cpp:1389
          #35 0x7f5201a2f0cd in QGuiApplication::exec() /mnt/work/source/ntgdeps/ba/Downloads/qt/qtbase/src/gui/kernel/qguiapplication.cpp:1784
          #36 0x55fb74e919d6 in main /mnt/work/source/ntgdeps/ntgdeps/qtapplicationmanager/src/tools/appman/appman.cpp:120
          #37 0x7f51ff938b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
          #38 0x55fb74e90fb9 in _start (/mnt/work/source/ntgdeps/ba/install/bin/appman+0x88fb9)
      

      Quick analysis showed that at the time an emitter calls emitWindow its underlying QQmlContextData was already invalidated (QQmlContextData::invalidate resets engine pointer to nullptr).

      Attachments

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

        Activity

          People

            w00t Robin Burchell
            dmytrokh Dmytro Khlopov
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes