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

Deadlock in rendering loop on QNX target

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P1: Critical
    • Resolution: Out of scope
    • Affects Version/s: 5.5.0
    • Fix Version/s: None
    • Component/s: GUI: OpenGL, GUI: Painting
    • Labels:
    • Environment:
      QNX660 with Qt5.5.0
    • Platform/s:
      QNX

      Description

      The UI hangs (not responsive), all other threads continue working.

      I am using a QGLWidget that has a timer to call the update function to force a paintGL call. Next to that I have other UI elements drawn on a see-through UI widget that is layed on top of the QGLWidget.

      The problems is a race condition.
      When the interval of the timer is set to 15 then the problem does not occur, however when I set the interval higher (e.g. 60) then the problem occurs.
      It will also happen at a random moment, faster when there is a lot of UI interaction.

      The problem was also seen on Qt 5.4.2.
      A workaround is to set QSG_RENDER_LOOP=basic

      I build Qt 5.5.0 with

      ./configure -confirm-license -opensource -debug -force-debug-info -developer-build -opengl es2 -egl -no-cups -no-iconv -nomake tests -nomake examples -xplatform qnx-armle-v7-qcc -skip qtserialport -skip qtwebkit
      

      I debugged the target with gdb.
      Under normal circumstances I have the following threads:

        Id   Target Id         Frame 
        8    pid 991289 tid 8 name "buffer-swap-t..." (STOPPED) 0x010452a4 in MsgSend () from /opt/qnx660/target/qnx6/armle-v7/lib/libc.so.3
        7    pid 991289 tid 7 name "QSGRenderThread" (CONDVAR) 0x01045808 in SyncCondvarWait_r () from /opt/qnx660/target/qnx6/armle-v7/lib/libc.so.3
        6    pid 991289 tid 6 name "buffer-swap-t..." (STOPPED) 0x010452a4 in MsgSend () from /opt/qnx660/target/qnx6/armle-v7/lib/libc.so.3
        5    pid 991289 tid 5 name "QQmlThread" (SIGWAITINFO) 0x01045794 in SignalWaitinfo () from /opt/qnx660/target/qnx6/armle-v7/lib/libc.so.3
        4    pid 991289 tid 4 (STOPPED) 0x01045ba4 in TimerTimeout () from /opt/qnx660/target/qnx6/armle-v7/lib/libc.so.3
        3    pid 991289 tid 3 name "QQnxScreenEve..." (REPLY) 0x010452a4 in MsgSend () from /opt/qnx660/target/qnx6/armle-v7/lib/libc.so.3
        2    pid 991289 tid 2 (STOPPED) 0x010453c8 in MsgSendv () from /opt/qnx660/target/qnx6/armle-v7/lib/libc.so.3
      *thread     pid 991289 tid 1 (MUTEX) 0x01045890 in SyncMutexLock_r () from /opt/qnx660/target/qnx6/armle-v7/lib/libc.so.3
      

      Thread 7 - QSGRenderThread:

      #0  0x01045ba4 in TimerTimeout () from /opt/qnx660/target/qnx6/armle-v7/lib/libc.so.3
      #1  0x010462e8 in timer_timeout () from /opt/qnx660/target/qnx6/armle-v7/lib/libc.so.3
      #2  0x01024e28 in nanosleep () from /opt/qnx660/target/qnx6/armle-v7/lib/libc.so.3
      #3  0x79843d28 in qt_nanosleep (amount=...) at tools/qelapsedtimer_unix.cpp:185
      #4  0x797a3f06 in QThread::msleep (msecs=16) at thread/qthread_unix.cpp:470
      #5  0x7b095cd0 in QSGRenderThread::syncAndRender (this=0x9fe32c0) at scenegraph/qsgthreadedrenderloop.cpp:570
      #6  0x7b09684c in QSGRenderThread::run (this=0x9fe32c0) at scenegraph/qsgthreadedrenderloop.cpp:674
      #7  0x797a3bfa in QThreadPrivate::start (arg=0x9fe32c0) at thread/qthread_unix.cpp:331
      #8  0x010257bc in timer_settime () from /opt/qnx660/target/qnx6/armle-v7/lib/libc.so.3
      

      Thread 3 - QQnxScreenEvent:

      #0  0x010452a4 in MsgSend () from /opt/qnx660/target/qnx6/armle-v7/lib/libc.so.3
      #1  0x796b74e0 in screen_get_event () from /opt/qnx660/target/qnx6/armle-v7/usr/lib/libscreen.so.1
      #2  0x7a1a88ce in ?? ()
      #3  0x7a1a88ce in ?? ()
      

      And when the UI hangs:

        8    pid 978951 tid 8 name "buffer-swap-t..." (STOPPED) 0x010453c8 in MsgSendv () from /opt/qnx660/target/qnx6/armle-v7/lib/libc.so.3
        7    pid 978951 tid 7 name "QSGRenderThread" (CONDVAR) 0x01045808 in SyncCondvarWait_r () from /opt/qnx660/target/qnx6/armle-v7/lib/libc.so.3
        6    pid 978951 tid 6 name "buffer-swap-t..." (MUTEX) 0x01045890 in SyncMutexLock_r () from /opt/qnx660/target/qnx6/armle-v7/lib/libc.so.3
        5    pid 978951 tid 5 name "QQmlThread" (SIGWAITINFO) 0x01045794 in SignalWaitinfo () from /opt/qnx660/target/qnx6/armle-v7/lib/libc.so.3
        4    pid 978951 tid 4 (STOPPED) 0x01045ba4 in TimerTimeout () from /opt/qnx660/target/qnx6/armle-v7/lib/libc.so.3
      * 3    pid 978951 tid 3 name "QQnxScreenEve..." (CONDVAR) 0x01045808 in SyncCondvarWait_r () from /opt/qnx660/target/qnx6/armle-v7/lib/libc.so.3
        2    pid 978951 tid 2 (STOPPED) 0x010453c8 in MsgSendv () from /opt/qnx660/target/qnx6/armle-v7/lib/libc.so.3
        1    pid 978951 tid 1 (MUTEX) 0x01045890 in SyncMutexLock_r () from /opt/qnx660/target/qnx6/armle-v7/lib/libc.so.3
      

      Thread 7 - QSGRenderThread:

      #0  0x01045808 in SyncCondvarWait_r () from /opt/qnx660/target/qnx6/armle-v7/lib/libc.so.3
      #1  0x01025e58 in pthread_cond_wait () from /opt/qnx660/target/qnx6/armle-v7/lib/libc.so.3
      #2  0x797a5458 in QWaitConditionPrivate::wait (this=0x9f2f910, time=4294967295) at thread/qwaitcondition_unix.cpp:136
      #3  0x797a4ff4 in QWaitCondition::wait (this=0x9fe3318, mutex=0x9fe3314, time=4294967295) at thread/qwaitcondition_unix.cpp:208
      #4  0x7b09a3b6 in QSGRenderThreadEventQueue::takeEvent (this=0x9fe3310, wait=true) at scenegraph/qsgthreadedrenderloop.cpp:224
      #5  0x7b0965ce in QSGRenderThread::processEventsAndWaitForMore (this=0x9fe32c0) at scenegraph/qsgthreadedrenderloop.cpp:654
      #6  0x7b09691a in QSGRenderThread::run (this=0x9fe32c0) at scenegraph/qsgthreadedrenderloop.cpp:683
      #7  0x797a3bfa in QThreadPrivate::start (arg=0x9fe32c0) at thread/qthread_unix.cpp:331
      #8  0x010257bc in timer_settime () from /opt/qnx660/target/qnx6/armle-v7/lib/libc.so.3
      

      Thread 3 - QQnxScreenEvent:

      #0  0x01045808 in SyncCondvarWait_r () from /opt/qnx660/target/qnx6/armle-v7/lib/libc.so.3
      #1  0x01025e58 in pthread_cond_wait () from /opt/qnx660/target/qnx6/armle-v7/lib/libc.so.3
      #2  0x796b3e44 in __screen_flush () from /opt/qnx660/target/qnx6/armle-v7/usr/lib/libscreen.so.1
      #3  0x796b4566 in screen_flush_context () from /opt/qnx660/target/qnx6/armle-v7/usr/lib/libscreen.so.1
      #4  0x7a1a830e in ?? ()
      #5  0x7a1a830e in ?? ()
      

        Attachments

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

          Activity

            People

            Assignee:
            lagocs Laszlo Agocs
            Reporter:
            artalizian Dennis Logghe
            Votes:
            1 Vote for this issue
            Watchers:
            9 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes