QT GUi app hang
-
I am using Qt QML. I see some random GUI freezes. I was able to get the back trace of the hang and it looks as follows:
It looks like GUI/render thread is stuck in swapbuffers, which is basically the call to the graphics driver to execute the rest of the rendering commands to post the contents to the window.Has anybody faced this issue ? Any clue about what could be causing this?
#3 <signal handler called>
#4 0x75a88a0c in pthread_cond_wait () from /opt/btl/data/libpthread-2.23.so
#5 0x74af14ac in gcoOS_GetDisplayBackbuffer (Display=0x16dc710,
Window=<optimized out>, context=context@entry=0x7ef910b8,
surface=<optimized out>, Offset=0x7ef910c0, X=0x7ef910c4, Y=0x7ef910c8)
at gc_hal_user_fbdev.c:1015#6 0x74af2744 in gcoOS_GetDisplayBackbufferEx (Display=<optimized out>,
Window=<optimized out>, localDisplay=<optimized out>,
context=context@entry=0x7ef910b8, surface=<optimized out>,
surface@entry=0x7ef910bc, Offset=0x7ef910c4, Offset@entry=0x7ef910c0,
X=0x7ef910c8, X@entry=0x7ef910c4, Y=Y@entry=0x7ef910c8)
at gc_hal_user_fbdev.c:2401#7 0x74c3cb70 in veglGetDisplayBackBuffer (Display=Display@entry=0x16dd00c,
Surface=Surface@entry=0x26bc6f4, BackBuffer=0x7ef910b8,
BackBuffer@entry=0x7ef91138) at gc_egl_platform.c:217#8 0x74c37bc4 in _SwapBuffersRegion (Rects=<optimized out>, NumRects=1,
Draw=0x26bc6f4, Dpy=0x16dd00c, Thread=0x16dcb5c) at gc_egl_swap.c:3338#9 _eglSwapBuffersRegion (Dpy=0x16dd00c,
Dpy@entry=<error reading variable: value has been optimized out>,
Draw=0x26bc6f4,
Draw@entry=<error reading variable: value has been optimized out>,
NumRects=1,
NumRects@entry=<error reading variable: value has been optimized out>,
Rects=<optimized out>,
Rects@entry=<error reading variable: value has been optimized out>)
at gc_egl_swap.c:4246#10 0x7535e708 in veglSwapBuffer_es3 (Dpy=<optimized out>,
Draw=<optimized out>, Callback=<optimized out>)
at src/glcore/gc_es_egl.c:354#11 0x74c38964 in eglSwapBuffers (Dpy=0x16dd00c, Draw=0x26bc6f4)
at gc_egl_swap.c:4400#12 0x72ffc9d8 in QEGLPlatformContext::swapBuffers (this=this@entry=0x26bf928,
surface=surface@entry=0x1bddca8)
at /usr/src/debug/qtbase/5.9.5+gitAUTOINC+f4c2fcc052-r08/git/src/platformsupport/eglconvenience/qeglplatformcontext.cpp:447#13 0x72fba380 in QEglFSContext::swapBuffers (this=0x26bf928,
surface=0x1bddca8)
at /usr/src/debug/qtbase/5.9.5+gitAUTOINC+f4c2fcc052-r08/git/src/plugins/platforms/eglfs/api/qeglfscontext.cpp:115#14 0x765da978 in QOpenGLContext::swapBuffers (this=0x26bc6a0,
surface=<optimized out>)
at /usr/src/debug/qtbase/5.9.5+gitAUTOINC+f4c2fcc052-r08/git/src/gui/kernel/qopenglcontext.cpp:1111#15 0x76a814d4 in QSGGuiThreadRenderLoop::renderWindow (this=0x1bd9a20,
window=0x350020)
at /usr/src/debug/qtdeclarative/5.9.5+gitAUTOINC+dfbe918537-r0/git/src/quick/scenegraph/qsgrenderloop.cpp:445#16 0x76af071c in QQuickWindow::event (this=0x1bd95a8, e=0x7ef912f4)
at /usr/src/debug/qtdeclarative/5.9.5+gitAUTOINC+dfbe918537-r0/git/src/quick/items/qquickwindow.cpp:1588#17 0x75d2285c in doNotify (event=<optimized out>, receiver=<optimized out>)
at /usr/src/debug/qtbase/5.9.5+gitAUTOINC+f4c2fcc052-r08/git/src/corelib/kernel/qcoreapplication.cpp:1099#18 QCoreApplication::notify (this=<optimized out>, receiver=<optimized out>,
event=<optimized out>)
at /usr/src/debug/qtbase/5.9.5+gitAUTOINC+f4c2fcc052-r08/git/src/corelib/kernel/qcoreapplication.cpp:1085#19 0x75d229bc in QCoreApplication::notifyInternal2 (
receiver=receiver@entry=0x1bd95a8, event=event@entry=0x7ef912f4)
at /usr/src/debug/qtbase/5.9.5+gitAUTOINC+f4c2fcc052-r08/git/src/corelib/kernel/qcoreapplication.cpp:1024#20 0x765aa600 in QCoreApplication::sendEvent (event=0x7ef912f4,
receiver=<optimized out>)
at /usr/src/debug/qtbase/5.9.5+gitAUTOINC+f4c2fcc052-r08/git/src/corelib/kernel/qcoreapplication.h:233#21 QWindowPrivate::deliverUpdateRequest (this=this@entry=0x1bd9618)
at /usr/src/debug/qtbase/5.9.5+gitAUTOINC+f4c2fcc052-r08/git/src/gui/kernel/qwindow.cpp:2305#22 0x765aadac in QWindow::event (this=this@entry=0x1bd95a8,
ev=ev@entry=0x7ef913f0)
at /usr/src/debug/qtbase/5.9.5+gitAUTOINC+f4c2fcc052-r08/git/src/gui/kernel/qwindow.cpp:2276#23 0x76af06e0 in QQuickWindow::event (this=0x1bd95a8, e=0x7ef913f0)
at /usr/src/debug/qtdeclarative/5.9.5+gitAUTOINC+dfbe918537-r0/git/src/quick/items/qquickwindow.cpp:1607#24 0x75d2285c in doNotify (event=<optimized out>, receiver=<optimized out>)
at /usr/src/debug/qtbase/5.9.5+gitAUTOINC+f4c2fcc052-r08/git/src/corelib/kernel/qcoreapplication.cpp:1099#25 QCoreApplication::notify (this=<optimized out>, receiver=<optimized out>,
event=<optimized out>)
at /usr/src/debug/qtbase/5.9.5+gitAUTOINC+f4c2fcc052-r08/git/src/corelib/kernel/qcoreapplication.cpp:1085#26 0x75d229bc in QCoreApplication::notifyInternal2 (receiver=0x1bd95a8,
event=event@entry=0x7ef913f0)
at /usr/src/debug/qtbase/5.9.5+gitAUTOINC+f4c2fcc052-r08/git/src/corelib/kernel/qcoreapplication.cpp:1024#27 0x75d7e208 in QCoreApplication::sendEvent (event=0x7ef913f0,
receiver=<optimized out>)
at /usr/src/debug/qtbase/5.9.5+gitAUTOINC+f4c2fcc052-r08/git/src/corelib/kernel/qcoreapplication.h:233#28 QTimerInfoList::activateTimers (this=0x16df7b4)
at /usr/src/debug/qtbase/5.9.5+gitAUTOINC+f4c2fcc052-r08/git/src/corelib/kernel/qtimerinfo_unix.cpp:643#29 0x75d7ea50 in timerSourceDispatch (source=<optimized out>)
at /usr/src/debug/qtbase/5.9.5+gitAUTOINC+f4c2fcc052-r08/git/src/corelib/kernel/qeventdispatcher_glib.cpp:182#30 idleTimerSourceDispatch (source=<optimized out>)
at /usr/src/debug/qtbase/5.9.5+gitAUTOINC+f4c2fcc052-r08/git/src/corelib/kernel/qeventdispatcher_glib.cpp:229#31 0x74ddcaec in g_main_dispatch (context=0x16df708)
at /usr/src/debug/glib-2.0/1_2.46.2-r0/glib-2.46.2/glib/gmain.c:3154#32 g_main_context_dispatch (context=context@entry=0x16df708)
at /usr/src/debug/glib-2.0/1_2.46.2-r0/glib-2.46.2/glib/gmain.c:3769#33 0x74ddcd14 in g_main_context_iterate (context=context@entry=0x16df708,
block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
at /usr/src/debug/glib-2.0/1_2.46.2-r0/glib-2.46.2/glib/gmain.c:3840#34 0x74ddcdc0 in g_main_context_iteration (context=0x16df708,
may_block=may_block@entry=1)
at /usr/src/debug/glib-2.0/1_2.46.2-r0/glib-2.46.2/glib/gmain.c:3901#35 0x75d7ecb4 in QEventDispatcherGlib::processEvents (this=0x146f2c0, flags=...)
at /usr/src/debug/qtbase/5.9.5+gitAUTOINC+f4c2fcc052-r08/git/src/corelib/kernel/qeventdispatcher_glib.cpp:423#36 0x75d208e0 in QEventLoop::exec (this=this@entry=0x7ef91524,
flags=flags@entry=...)
at /usr/src/debug/qtbase/5.9.5+gitAUTOINC+f4c2fcc052-r08/git/src/corelib/kernel/qeventloop.cpp:212#37 0x75d29d08 in QCoreApplication::exec ()
at /usr/src/debug/qtbase/5.9.5+gitAUTOINC+f4c2fcc052-r08/git/src/corelib/kernel/qcoreapplication.cpp:1297#38 0x00043c24 in ?? ()
#39 0x7576dcf8 in __libc_start_main () from /opt/btl/data/libc-2.23.so
#40 0x0034fd2c in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?) -
I am using Qt QML. I see some random GUI freezes. I was able to get the back trace of the hang and it looks as follows:
It looks like GUI/render thread is stuck in swapbuffers, which is basically the call to the graphics driver to execute the rest of the rendering commands to post the contents to the window.Has anybody faced this issue ? Any clue about what could be causing this?
#3 <signal handler called>
#4 0x75a88a0c in pthread_cond_wait () from /opt/btl/data/libpthread-2.23.so
#5 0x74af14ac in gcoOS_GetDisplayBackbuffer (Display=0x16dc710,
Window=<optimized out>, context=context@entry=0x7ef910b8,
surface=<optimized out>, Offset=0x7ef910c0, X=0x7ef910c4, Y=0x7ef910c8)
at gc_hal_user_fbdev.c:1015#6 0x74af2744 in gcoOS_GetDisplayBackbufferEx (Display=<optimized out>,
Window=<optimized out>, localDisplay=<optimized out>,
context=context@entry=0x7ef910b8, surface=<optimized out>,
surface@entry=0x7ef910bc, Offset=0x7ef910c4, Offset@entry=0x7ef910c0,
X=0x7ef910c8, X@entry=0x7ef910c4, Y=Y@entry=0x7ef910c8)
at gc_hal_user_fbdev.c:2401#7 0x74c3cb70 in veglGetDisplayBackBuffer (Display=Display@entry=0x16dd00c,
Surface=Surface@entry=0x26bc6f4, BackBuffer=0x7ef910b8,
BackBuffer@entry=0x7ef91138) at gc_egl_platform.c:217#8 0x74c37bc4 in _SwapBuffersRegion (Rects=<optimized out>, NumRects=1,
Draw=0x26bc6f4, Dpy=0x16dd00c, Thread=0x16dcb5c) at gc_egl_swap.c:3338#9 _eglSwapBuffersRegion (Dpy=0x16dd00c,
Dpy@entry=<error reading variable: value has been optimized out>,
Draw=0x26bc6f4,
Draw@entry=<error reading variable: value has been optimized out>,
NumRects=1,
NumRects@entry=<error reading variable: value has been optimized out>,
Rects=<optimized out>,
Rects@entry=<error reading variable: value has been optimized out>)
at gc_egl_swap.c:4246#10 0x7535e708 in veglSwapBuffer_es3 (Dpy=<optimized out>,
Draw=<optimized out>, Callback=<optimized out>)
at src/glcore/gc_es_egl.c:354#11 0x74c38964 in eglSwapBuffers (Dpy=0x16dd00c, Draw=0x26bc6f4)
at gc_egl_swap.c:4400#12 0x72ffc9d8 in QEGLPlatformContext::swapBuffers (this=this@entry=0x26bf928,
surface=surface@entry=0x1bddca8)
at /usr/src/debug/qtbase/5.9.5+gitAUTOINC+f4c2fcc052-r08/git/src/platformsupport/eglconvenience/qeglplatformcontext.cpp:447#13 0x72fba380 in QEglFSContext::swapBuffers (this=0x26bf928,
surface=0x1bddca8)
at /usr/src/debug/qtbase/5.9.5+gitAUTOINC+f4c2fcc052-r08/git/src/plugins/platforms/eglfs/api/qeglfscontext.cpp:115#14 0x765da978 in QOpenGLContext::swapBuffers (this=0x26bc6a0,
surface=<optimized out>)
at /usr/src/debug/qtbase/5.9.5+gitAUTOINC+f4c2fcc052-r08/git/src/gui/kernel/qopenglcontext.cpp:1111#15 0x76a814d4 in QSGGuiThreadRenderLoop::renderWindow (this=0x1bd9a20,
window=0x350020)
at /usr/src/debug/qtdeclarative/5.9.5+gitAUTOINC+dfbe918537-r0/git/src/quick/scenegraph/qsgrenderloop.cpp:445#16 0x76af071c in QQuickWindow::event (this=0x1bd95a8, e=0x7ef912f4)
at /usr/src/debug/qtdeclarative/5.9.5+gitAUTOINC+dfbe918537-r0/git/src/quick/items/qquickwindow.cpp:1588#17 0x75d2285c in doNotify (event=<optimized out>, receiver=<optimized out>)
at /usr/src/debug/qtbase/5.9.5+gitAUTOINC+f4c2fcc052-r08/git/src/corelib/kernel/qcoreapplication.cpp:1099#18 QCoreApplication::notify (this=<optimized out>, receiver=<optimized out>,
event=<optimized out>)
at /usr/src/debug/qtbase/5.9.5+gitAUTOINC+f4c2fcc052-r08/git/src/corelib/kernel/qcoreapplication.cpp:1085#19 0x75d229bc in QCoreApplication::notifyInternal2 (
receiver=receiver@entry=0x1bd95a8, event=event@entry=0x7ef912f4)
at /usr/src/debug/qtbase/5.9.5+gitAUTOINC+f4c2fcc052-r08/git/src/corelib/kernel/qcoreapplication.cpp:1024#20 0x765aa600 in QCoreApplication::sendEvent (event=0x7ef912f4,
receiver=<optimized out>)
at /usr/src/debug/qtbase/5.9.5+gitAUTOINC+f4c2fcc052-r08/git/src/corelib/kernel/qcoreapplication.h:233#21 QWindowPrivate::deliverUpdateRequest (this=this@entry=0x1bd9618)
at /usr/src/debug/qtbase/5.9.5+gitAUTOINC+f4c2fcc052-r08/git/src/gui/kernel/qwindow.cpp:2305#22 0x765aadac in QWindow::event (this=this@entry=0x1bd95a8,
ev=ev@entry=0x7ef913f0)
at /usr/src/debug/qtbase/5.9.5+gitAUTOINC+f4c2fcc052-r08/git/src/gui/kernel/qwindow.cpp:2276#23 0x76af06e0 in QQuickWindow::event (this=0x1bd95a8, e=0x7ef913f0)
at /usr/src/debug/qtdeclarative/5.9.5+gitAUTOINC+dfbe918537-r0/git/src/quick/items/qquickwindow.cpp:1607#24 0x75d2285c in doNotify (event=<optimized out>, receiver=<optimized out>)
at /usr/src/debug/qtbase/5.9.5+gitAUTOINC+f4c2fcc052-r08/git/src/corelib/kernel/qcoreapplication.cpp:1099#25 QCoreApplication::notify (this=<optimized out>, receiver=<optimized out>,
event=<optimized out>)
at /usr/src/debug/qtbase/5.9.5+gitAUTOINC+f4c2fcc052-r08/git/src/corelib/kernel/qcoreapplication.cpp:1085#26 0x75d229bc in QCoreApplication::notifyInternal2 (receiver=0x1bd95a8,
event=event@entry=0x7ef913f0)
at /usr/src/debug/qtbase/5.9.5+gitAUTOINC+f4c2fcc052-r08/git/src/corelib/kernel/qcoreapplication.cpp:1024#27 0x75d7e208 in QCoreApplication::sendEvent (event=0x7ef913f0,
receiver=<optimized out>)
at /usr/src/debug/qtbase/5.9.5+gitAUTOINC+f4c2fcc052-r08/git/src/corelib/kernel/qcoreapplication.h:233#28 QTimerInfoList::activateTimers (this=0x16df7b4)
at /usr/src/debug/qtbase/5.9.5+gitAUTOINC+f4c2fcc052-r08/git/src/corelib/kernel/qtimerinfo_unix.cpp:643#29 0x75d7ea50 in timerSourceDispatch (source=<optimized out>)
at /usr/src/debug/qtbase/5.9.5+gitAUTOINC+f4c2fcc052-r08/git/src/corelib/kernel/qeventdispatcher_glib.cpp:182#30 idleTimerSourceDispatch (source=<optimized out>)
at /usr/src/debug/qtbase/5.9.5+gitAUTOINC+f4c2fcc052-r08/git/src/corelib/kernel/qeventdispatcher_glib.cpp:229#31 0x74ddcaec in g_main_dispatch (context=0x16df708)
at /usr/src/debug/glib-2.0/1_2.46.2-r0/glib-2.46.2/glib/gmain.c:3154#32 g_main_context_dispatch (context=context@entry=0x16df708)
at /usr/src/debug/glib-2.0/1_2.46.2-r0/glib-2.46.2/glib/gmain.c:3769#33 0x74ddcd14 in g_main_context_iterate (context=context@entry=0x16df708,
block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
at /usr/src/debug/glib-2.0/1_2.46.2-r0/glib-2.46.2/glib/gmain.c:3840#34 0x74ddcdc0 in g_main_context_iteration (context=0x16df708,
may_block=may_block@entry=1)
at /usr/src/debug/glib-2.0/1_2.46.2-r0/glib-2.46.2/glib/gmain.c:3901#35 0x75d7ecb4 in QEventDispatcherGlib::processEvents (this=0x146f2c0, flags=...)
at /usr/src/debug/qtbase/5.9.5+gitAUTOINC+f4c2fcc052-r08/git/src/corelib/kernel/qeventdispatcher_glib.cpp:423#36 0x75d208e0 in QEventLoop::exec (this=this@entry=0x7ef91524,
flags=flags@entry=...)
at /usr/src/debug/qtbase/5.9.5+gitAUTOINC+f4c2fcc052-r08/git/src/corelib/kernel/qeventloop.cpp:212#37 0x75d29d08 in QCoreApplication::exec ()
at /usr/src/debug/qtbase/5.9.5+gitAUTOINC+f4c2fcc052-r08/git/src/corelib/kernel/qcoreapplication.cpp:1297#38 0x00043c24 in ?? ()
#39 0x7576dcf8 in __libc_start_main () from /opt/btl/data/libc-2.23.so
#40 0x0034fd2c in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?) -
Could be in my code. But the issue is very rare and random. Code has been extensively tested for more than a year and this issue was not found. We started automated testing using Squish recently. While executing squish test this issue was found.
How to debug such issues? backtrace doesn't give much clue. gc_hal_user_fbdev source code is also not easy to find.
Any idea what typically causes such hang? -