Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QT GUi app hang
QtWS25 Last Chance

QT GUi app hang

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
6 Posts 3 Posters 707 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    manny_lp
    wrote on 5 Aug 2022, 06:43 last edited by
    #1

    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?)

    M 1 Reply Last reply 6 Aug 2022, 11:48
    0
    • M manny_lp
      5 Aug 2022, 06:43

      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?)

      M Offline
      M Offline
      mvuori
      wrote on 6 Aug 2022, 11:48 last edited by
      #2

      Clue: since all people don't see this all the time, the first thing to suspect is your code

      1 Reply Last reply
      0
      • M Offline
        M Offline
        manny_lp
        wrote on 7 Aug 2022, 16:51 last edited by
        #3

        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?

        1 Reply Last reply
        0
        • M Offline
          M Offline
          manny_lp
          wrote on 9 Aug 2022, 09:51 last edited by
          #4

          One more observation:
          Before this hang occurs I see a significant drop in available memory of the system

          1 Reply Last reply
          0
          • M Offline
            M Offline
            manny_lp
            wrote on 11 Aug 2022, 10:06 last edited by
            #5

            Issue happens only if FB_MULTI_BUFFER = 4, if I set FB_MULTI_BUFFER = 2 there is no hang.
            Can anyone explain on what basis FB_MULTI_BUFFER should be set?

            1 Reply Last reply
            0
            • J Offline
              J Offline
              JoeCFD
              wrote on 11 Aug 2022, 13:32 last edited by
              #6

              @manny_lp said in QT GUi app hang:

              FB_MULTI_BUFFER

              https://stackoverflow.com/questions/7859809/opengl-tearing-effect-when-rendering-on-egl

              1 Reply Last reply
              0

              5/6

              11 Aug 2022, 10:06

              • Login

              • Login or register to search.
              5 out of 6
              • First post
                5/6
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved