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

Wayland freeze when re-showing a hidden window

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.5.1
    • 5.5.0 RC
    • QPA: Wayland
    • None
    • Debian sid and Ubuntu 14.04, both against the distro's weston, running without any options as an X11 client.
    • 10fd51a3e69a0a2ee6b8cd151fa6c847f684253c

    Description

      Note: this affects not only 5.5: I can reproduce this with Qt 5.2.1 up to dev

      When calling hide() on a window that is currently rendered (e.g. by running a QML animation) in a weston compositor there's a chance the whole process will freeze when trying to show() it again.

      I can reproduce this on my Debian Sid machine, where the freeze occurs roughly every 10th hide()/show() cycle. On another machine (Ubuntu 14.04) the freeze always happens after the first hide()/show().

      It seems like something goes wrong in the communication with weston when hiding the window while being busy rendering the last frame.

      Please see the attached example - just run:

      qmake && make
      weston &
      gdb --args ./wayland-freeze -platform wayland-egl
      

      This will show()/hide() an animated QML window in an endless loop (well not endless – at least until it freezes )

      (gdb)
      #0  0xb7fdcd3c in __kernel_vsyscall ()
      #1  0xb671bc4b in pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_wait.S:187
      #2  0xb67fd43b in QWaitConditionPrivate::wait (this=0x87864f8, time=4294967295) at /home/sandman/git/qt5/qtbase/src/corelib/thread/qwaitcondition_unix.cpp:136
      #3  0xb67fd225 in QWaitCondition::wait (this=0x84d4e20, mutex=0x84d4e1c, time=4294967295) at /home/sandman/git/qt5/qtbase/src/corelib/thread/qwaitcondition_unix.cpp:208
      #4  0xb7c6fc2c in QSGThreadedRenderLoop::polishAndSync (this=0x808d650, w=0x8787510, inExpose=true)
          at /home/sandman/git/qt5/qtdeclarative/src/quick/scenegraph/qsgthreadedrenderloop.cpp:1172
      #5  0xb7c6e7c2 in QSGThreadedRenderLoop::handleExposure (this=0x808d650, window=0xbffff414)
          at /home/sandman/git/qt5/qtdeclarative/src/quick/scenegraph/qsgthreadedrenderloop.cpp:968
      #6  0xb7c6dd24 in QSGThreadedRenderLoop::exposureChanged (this=0x808d650, window=0xbffff414)
          at /home/sandman/git/qt5/qtdeclarative/src/quick/scenegraph/qsgthreadedrenderloop.cpp:879
      #7  0xb7c9f666 in QQuickWindow::exposeEvent (this=0xbffff414) at /home/sandman/git/qt5/qtdeclarative/src/quick/items/qquickwindow.cpp:207
      #8  0xb75944b3 in QWindow::event (this=0xbffff414, ev=0xbffff0f8) at /home/sandman/git/qt5/qtbase/src/gui/kernel/qwindow.cpp:2028
      #9  0xb7ca40a9 in QQuickWindow::event (this=0xbffff414, e=0xbffff0f8) at /home/sandman/git/qt5/qtdeclarative/src/quick/items/qquickwindow.cpp:1413
      #10 0xb69c0141 in QCoreApplicationPrivate::notify_helper (this=0x804b528, receiver=0xbffff414, event=0xbffff0f8)
          at /home/sandman/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1081
      #11 0xb69bfe3b in QCoreApplication::notify (this=0xbffff428, receiver=0xbffff414, event=0xbffff0f8) at /home/sandman/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1026
      #12 0xb758382d in QGuiApplication::notify (this=0xbffff428, object=0xbffff414, event=0xbffff0f8) at /home/sandman/git/qt5/qtbase/src/gui/kernel/qguiapplication.cpp:1540
      #13 0xb69bfd48 in QCoreApplication::notifyInternal (this=0xbffff428, receiver=0xbffff414, event=0xbffff0f8)
          at /home/sandman/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:964
      #14 0xb758b4d8 in QCoreApplication::sendSpontaneousEvent (receiver=0xbffff414, event=0xbffff0f8)
          at ../../include/QtCore/../../../../qt5/qtbase/src/corelib/kernel/qcoreapplication.h:227
      #15 0xb7588357 in QGuiApplicationPrivate::processExposeEvent (e=0x847e480) at /home/sandman/git/qt5/qtbase/src/gui/kernel/qguiapplication.cpp:2646
      #16 0xb7583aff in QGuiApplicationPrivate::processWindowSystemEvent (e=0x847e480) at /home/sandman/git/qt5/qtbase/src/gui/kernel/qguiapplication.cpp:1647
      #17 0xb756d53d in QWindowSystemInterface::sendWindowSystemEvents (flags=...) at /home/sandman/git/qt5/qtbase/src/gui/kernel/qwindowsysteminterface.cpp:615
      #18 0xb43c87fa in userEventSourceDispatch (source=0x81a6c78) at /home/sandman/git/qt5/qtbase/src/platformsupport/eventdispatchers/qeventdispatcher_glib.cpp:70
      #19 0xb48bdda4 in g_main_context_dispatch () from /lib/i386-linux-gnu/libglib-2.0.so.0
      #20 0xb48be0c9 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
      #21 0xb48be196 in g_main_context_iteration () from /lib/i386-linux-gnu/libglib-2.0.so.0
      #22 0xb6a2ccbd in QEventDispatcherGlib::processEvents (this=0x814e598, flags=...) at /home/sandman/git/qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:417
      #23 0xb43c8a19 in QPAEventDispatcherGlib::processEvents (this=0x814e598, flags=...)
          at /home/sandman/git/qt5/qtbase/src/platformsupport/eventdispatchers/qeventdispatcher_glib.cpp:115
      #24 0xb69bc99b in QEventLoop::processEvents (this=0xbffff3b0, flags=...) at /home/sandman/git/qt5/qtbase/src/corelib/kernel/qeventloop.cpp:128
      #25 0xb69bcc4d in QEventLoop::exec (this=0xbffff3b0, flags=...) at /home/sandman/git/qt5/qtbase/src/corelib/kernel/qeventloop.cpp:204
      #26 0xb69c045c in QCoreApplication::exec () at /home/sandman/git/qt5/qtbase/src/corelib/kernel/qcoreapplication.cpp:1217
      #27 0xb75837e0 in QGuiApplication::exec () at /home/sandman/git/qt5/qtbase/src/gui/kernel/qguiapplication.cpp:1531
      #28 0x08048ee8 in main (argc=1, argv=0xbffff514) at main.cpp:19
      (gdb) info thr
        Id   Target Id         Frame
        4    Thread 0xb1b65b40 (LWP 7269) "QSGRenderThread" 0xb7fdcd3c in __kernel_vsyscall ()
        3    Thread 0xb2f09b40 (LWP 7268) "QQmlThread" 0xb7fdcd3c in __kernel_vsyscall ()
        2    Thread 0xb3f53b40 (LWP 7267) "QtWayland" 0xb7fdcd3c in __kernel_vsyscall ()
      * 1    Thread 0xb47db700 (LWP 7263) "wayland-freeze" 0xb7fdcd3c in __kernel_vsyscall ()
      (gdb) thr 4
      [Switching to thread 4 (Thread 0xb1b65b40 (LWP 7269))]
      #0  0xb7fdcd3c in __kernel_vsyscall ()
      (gdb) bt
      #0  0xb7fdcd3c in __kernel_vsyscall ()
      #1  0xb64ef5bb in poll () at ../sysdeps/unix/syscall-template.S:81
      #2  0xb6742273 in poll (__timeout=-1, __nfds=1, __fds=0xb1b649ac) at /usr/include/i386-linux-gnu/bits/poll2.h:46
      #3  wl_display_dispatch_queue (display=0xb3603310, queue=0x80727c0) at ../src/wayland-client.c:1432
      #4  0xb415bae4 in get_back_bo (dri2_surf=dri2_surf@entry=0xb1202a80) at ../../../../../../src/egl/drivers/dri2/platform_wayland.c:321
      #5  0xb415bc46 in update_buffers (dri2_surf=dri2_surf@entry=0xb1202a80) at ../../../../../../src/egl/drivers/dri2/platform_wayland.c:421
      #6  0xb415be14 in image_get_buffers (driDrawable=0xb1202c10, format=4099, stamp=0xb1202c30, loaderPrivate=0xb1202a80, buffer_mask=1, buffers=0xb1b64ab0)
          at ../../../../../../src/egl/drivers/dri2/platform_wayland.c:537
      #7  0xb32270e8 in ?? () from /usr/lib/i386-linux-gnu/dri/i965_dri.so
      #8  0xb322757c in ?? () from /usr/lib/i386-linux-gnu/dri/i965_dri.so
      #9  0xb321a279 in ?? () from /usr/lib/i386-linux-gnu/dri/i965_dri.so
      #10 0xb2f43eed in ?? () from /usr/lib/i386-linux-gnu/dri/i965_dri.so
      #11 0xb7c1d357 in QOpenGLFunctions::glClear (this=0xb1203248, mask=17664)
          at /home/sandman/git/x11-5/qtbase/include/QtGui/../../../../qt5/qtbase/src/gui/opengl/qopenglfunctions.h:592
      #12 0xb7c2e942 in QSGBindable::clear (this=0xb1b65034, mode=...) at /home/sandman/git/qt5/qtdeclarative/src/quick/scenegraph/coreapi/qsgrenderer.cpp:55
      #13 0xb7c184e2 in QSGBatchRenderer::Renderer::renderBatches (this=0xb1203990) at /home/sandman/git/qt5/qtdeclarative/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp:2474
      #14 0xb7c19c50 in QSGBatchRenderer::Renderer::render (this=0xb1203990) at /home/sandman/git/qt5/qtdeclarative/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp:2696
      #15 0xb7c2efbb in QSGRenderer::renderScene (this=0xb1203990, bindable=...) at /home/sandman/git/qt5/qtdeclarative/src/quick/scenegraph/coreapi/qsgrenderer.cpp:208
      #16 0xb7c2eda3 in QSGRenderer::renderScene (this=0xb1203990, fboId=0) at /home/sandman/git/qt5/qtdeclarative/src/quick/scenegraph/coreapi/qsgrenderer.cpp:168
      #17 0xb7c49384 in QSGRenderContext::renderNextFrame (this=0x8056630, renderer=0xb1203990, fboId=0) at /home/sandman/git/qt5/qtdeclarative/src/quick/scenegraph/qsgcontext.cpp:554
      #18 0xb7ca00ea in QQuickWindowPrivate::renderSceneGraph (this=0x8443790, size=...) at /home/sandman/git/qt5/qtdeclarative/src/quick/items/qquickwindow.cpp:382
      #19 0xb7c6c4af in QSGRenderThread::syncAndRender (this=0x84d4df8) at /home/sandman/git/qt5/qtdeclarative/src/quick/scenegraph/qsgthreadedrenderloop.cpp:618
      #20 0xb7c6cef0 in QSGRenderThread::run (this=0x84d4df8) at /home/sandman/git/qt5/qtdeclarative/src/quick/scenegraph/qsgthreadedrenderloop.cpp:699
      #21 0xb67fbda4 in QThreadPrivate::start (arg=0x84d4df8) at /home/sandman/git/qt5/qtbase/src/corelib/thread/qthread_unix.cpp:331
      #22 0xb6717efb in start_thread (arg=0xb1b65b40) at pthread_create.c:309
      #23 0xb64f9dfe in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:129
      (gdb) thr 2
      [Switching to thread 2 (Thread 0xb3f53b40 (LWP 7267))]
      #0  0xb7fdcd3c in __kernel_vsyscall ()
      (gdb) bt
      #0  0xb7fdcd3c in __kernel_vsyscall ()
      #1  0xb64ef5bb in poll () at ../sysdeps/unix/syscall-template.S:81
      #2  0xb48cd0b0 in g_poll () from /lib/i386-linux-gnu/libglib-2.0.so.0
      #3  0xb48be054 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
      #4  0xb48be196 in g_main_context_iteration () from /lib/i386-linux-gnu/libglib-2.0.so.0
      #5  0xb6a2ccbd in QEventDispatcherGlib::processEvents (this=0xb3600468, flags=...) at /home/sandman/git/qt5/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:417
      #6  0xb69bc99b in QEventLoop::processEvents (this=0xb3f532b8, flags=...) at /home/sandman/git/qt5/qtbase/src/corelib/kernel/qeventloop.cpp:128
      #7  0xb69bcc4d in QEventLoop::exec (this=0xb3f532b8, flags=...) at /home/sandman/git/qt5/qtbase/src/corelib/kernel/qeventloop.cpp:204
      #8  0xb67f4cfe in QThread::exec (this=0x804f9f8) at /home/sandman/git/qt5/qtbase/src/corelib/thread/qthread.cpp:502
      #9  0xb67f4ea7 in QThread::run (this=0x804f9f8) at /home/sandman/git/qt5/qtbase/src/corelib/thread/qthread.cpp:569
      #10 0xb67fbda4 in QThreadPrivate::start (arg=0x804f9f8) at /home/sandman/git/qt5/qtbase/src/corelib/thread/qthread_unix.cpp:331
      #11 0xb6717efb in start_thread (arg=0xb3f53b40) at pthread_create.c:309
      #12 0xb64f9dfe in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:129
      

      Attachments

        1. wayland-freeze.tgz
          0.8 kB
          Robert Griebl

        Issue Links

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

          Activity

            People

              jolind Jorgen Lind
              rgriebl Robert Griebl
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes