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

Crash in QWaylandCursor depending on ordering of interfaces

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.6.0 RC
    • 5.4.1
    • QPA: Wayland
    • None
    • Linux on commit 8458e06b25c07ebc8cf6b210fc1ea4cc9aeb42eb

    Description

      Depending on the ordering of the interfaces in the Wayland server QWaylandCursor might crash on application startup. This happens if the server announces wl_output before wl_shm. I am able to trigger this with a KWayland demo server.

      E.g. with weston-info returning the following we get a crash:
      interface: 'wl_compositor', version: 3, name: 1
      interface: 'wl_shell', version: 1, name: 2
      interface: 'wl_output', version: 2, name: 3
      x: 0, y: 0,
      physical_width: 10 mm, physical_height: 10 mm,
      make: 'org.kde.kwin', model: 'none',
      subpixel_orientation: unknown, output_transform: normal,
      mode:
      width: 1024 px, height: 768 px, refresh: 60 Hz,
      flags: current
      interface: 'wl_shm', version: 1, name: 4
      formats: XRGB8888 ARGB8888

      While with weston-info returning the following we don't get a crash:
      interface: 'wl_shm', version: 1, name: 1
      formats: XRGB8888 ARGB8888
      interface: 'wl_compositor', version: 3, name: 2
      interface: 'wl_shell', version: 1, name: 3
      interface: 'wl_output', version: 2, name: 4
      x: 0, y: 0,
      physical_width: 10 mm, physical_height: 10 mm,
      make: 'org.kde.kwin', model: 'none',
      subpixel_orientation: unknown, output_transform: normal,
      mode:
      width: 1024 px, height: 768 px, refresh: 60 Hz,
      flags: current

      The backtrace of the crash if wl_output is announced before wl_shm:
      Program received signal SIGSEGV, Segmentation fault.
      0x00007fffef167ea6 in wl_proxy_marshal_constructor (proxy=0x0, opcode=0, interface=0x7ffff62aea60 <wl_shm_pool_interface>) at ../src/wayland-client.c:625
      625 ../src/wayland-client.c: No such file or directory.
      (gdb) bt
      #0 0x00007fffef167ea6 in wl_proxy_marshal_constructor (proxy=0x0, opcode=0, interface=0x7ffff62aea60 <wl_shm_pool_interface>) at ../src/wayland-client.c:625
      #1 0x00007fffeef5b543 in wl_cursor_theme_load () from /usr/lib/x86_64-linux-gnu/libwayland-cursor.so.0
      #2 0x00007ffff7f38270 in QWaylandCursor::QWaylandCursor (this=0x61a9d0, screen=0x61edb0) at qwaylandcursor.cpp:68
      #3 0x00007ffff7f45635 in QWaylandScreen::QWaylandScreen (this=0x61edb0, waylandDisplay=0x619cb0, version=2, id=3) at qwaylandscreen.cpp:68
      #4 0x00007ffff7f3cd2f in QWaylandDisplay::registry_global (this=0x619cb0, id=3, interface=..., version=2) at qwaylanddisplay.cpp:232
      #5 0x00007ffff7f54da5 in QtWayland::wl_registry::handle_global (data=0x619cc0, object=0x6134a0, name=3, interface=0x7fffe8007a20 "wl_output", version=2) at qwayland-wayland.cpp:67
      #6 0x00007ffff2a63dc0 in ffi_call_unix64 () from /usr/lib/x86_64-linux-gnu/libffi.so.6
      #7 0x00007ffff2a63828 in ffi_call () from /usr/lib/x86_64-linux-gnu/libffi.so.6
      #8 0x00007fffef16a52d in wl_closure_invoke (closure=closure@entry=0x7fffe8007940, flags=flags@entry=1, target=target@entry=0x6134a0, opcode=opcode@entry=0, data=0x619cc0) at ../src/connection.c:934
      #9 0x00007fffef16786b in dispatch_event (display=display@entry=0x7fffe8003320, queue=0x6127b0) at ../src/wayland-client.c:1136
      #10 0x00007fffef1678ec in dispatch_queue (display=display@entry=0x7fffe8003320, queue=queue@entry=0x6127b0) at ../src/wayland-client.c:1261
      #11 0x00007fffef1685f4 in wl_display_dispatch_queue_pending (display=0x7fffe8003320, queue=0x6127b0) at ../src/wayland-client.c:1479
      #12 0x00007ffff7f3c745 in QWaylandDisplay::flushRequests (this=0x619cb0) at qwaylanddisplay.cpp:174
      #13 0x00007ffff7f5b8aa in QWaylandDisplay::qt_static_metacall (_o=0x619cb0, _c=QMetaObject::InvokeMetaMethod, _id=1, _a=0x7fffe80075c0) at .moc/moc_qwaylanddisplay_p.cpp:73
      #14 0x00007ffff71e4d0f in QMetaCallEvent::placeMetaCall (this=0x7fffe8007c30, object=0x619cb0) at kernel/qobject.cpp:485
      #15 0x00007ffff71e5dd8 in QObject::event (this=0x619cb0, e=0x7fffe8007c30) at kernel/qobject.cpp:1245
      #16 0x00007ffff71a97d0 in QCoreApplicationPrivate::notify_helper (this=0x60ef80, receiver=0x619cb0, event=0x7fffe8007c30) at kernel/qcoreapplication.cpp:1052
      #17 0x00007ffff71a94b2 in QCoreApplication::notify (this=0x7fffffffdcd0, receiver=0x619cb0, event=0x7fffe8007c30) at kernel/qcoreapplication.cpp:997
      #18 0x00007ffff71a93bc in QCoreApplication::notifyInternal (this=0x7fffffffdcd0, receiver=0x619cb0, event=0x7fffe8007c30) at kernel/qcoreapplication.cpp:935
      #19 0x00007ffff71ad01d in QCoreApplication::sendEvent (receiver=0x619cb0, event=0x7fffe8007c30) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:228
      #20 0x00007ffff71aa6f5 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x607740) at kernel/qcoreapplication.cpp:1552
      #21 0x00007ffff71aa0a4 in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0) at kernel/qcoreapplication.cpp:1410
      #22 0x00007ffff7221ee2 in postEventSourceDispatch (s=0x6074e0) at kernel/qeventdispatcher_glib.cpp:271
      #23 0x00007ffff30dbc5d in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
      #24 0x00007ffff30dbf48 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
      #25 0x00007ffff30dbffc in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
      #26 0x00007ffff722269d in QEventDispatcherGlib::processEvents (this=0x6043a0, flags=...) at kernel/qeventdispatcher_glib.cpp:418
      #27 0x00007ffff7f3dbbd in QWaylandDisplay::forceRoundTrip (this=0x619cb0) at qwaylanddisplay.cpp:344
      #28 0x00007ffff7f3c4c4 in QWaylandDisplay::QWaylandDisplay (this=0x619cb0, waylandIntegration=0x613050) at qwaylanddisplay.cpp:159
      #29 0x00007ffff7f2ec71 in QWaylandIntegration::QWaylandIntegration (this=0x613050) at qwaylandintegration.cpp:127
      #30 0x00007ffff7ff144a in QWaylandIntegrationPlugin::create (this=0x612ad0, system=..., paramList=...) at main.cpp:59
      #31 0x00007ffff759db3d in QPlatformIntegrationPlugin::create (this=0x612ad0, key=..., paramList=..., argc=@0x7fffffffdc4c: 1, argv=0x7fffffffdec8) at kernel/qplatformintegrationplugin.cpp:58
      #32 0x00007ffff759cf72 in loadIntegration (loader=0x7ffff7b6e520 <ZZN12_GLOBAL_N_112Q_QGS_loader13innerFunctionEvE6holder>, key=..., parameters=..., argc=@0x7fffffffdc4c: 1, argv=0x7fffffffdec8)
      at kernel/qplatformintegrationfactory.cpp:56
      #33 0x00007ffff759d02a in QPlatformIntegrationFactory::create (platform=..., paramList=..., argc=@0x7fffffffdc4c: 1, argv=0x7fffffffdec8, platformPluginPath=...) at kernel/qplatformintegrationfactory.cpp:73
      #34 0x00007ffff75a8adb in init_platform (pluginArgument=..., platformPluginPath=..., platformThemeName=..., argc=@0x7fffffffdc4c: 1, argv=0x7fffffffdec8) at kernel/qguiapplication.cpp:1010
      #35 0x00007ffff75a9d0e in QGuiApplicationPrivate::createPlatformIntegration (this=0x60ef80) at kernel/qguiapplication.cpp:1165
      #36 0x00007ffff75a9efd in QGuiApplicationPrivate::eventDispatcherReady (this=0x60ef80) at kernel/qguiapplication.cpp:1193
      #37 0x00007ffff71a906b in QCoreApplication::init (this=0x7fffffffdcd0) at kernel/qcoreapplication.cpp:739
      #38 0x00007ffff71a8d55 in QCoreApplication::QCoreApplication (this=0x7fffffffdcd0, p=...) at kernel/qcoreapplication.cpp:655
      #39 0x00007ffff75a7879 in QGuiApplication::QGuiApplication (this=0x7fffffffdcd0, argc=@0x7fffffffdc4c: 1, argv=0x7fffffffdec8, flags=328706) at kernel/qguiapplication.cpp:548
      #40 0x0000000000402917 in main (argc=1, argv=0x7fffffffdec8) at /home/martin/src/kf5/kde/workspace/kwayland/tests/waylandservertest.cpp:123

      Attachments

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

        Activity

          People

            giucam Giulio Camuffo
            mgraesslin Martin Gräßlin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes