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

Wayland Compositor + static build + LTO = crash

    XMLWordPrintable

Details

    • Linux/Wayland, Linux/X11
    • e1dd64908 (dev), 908a4c16b (6.10), 47f45e78c (6.9), 0ca6f5872 (tqtc/lts-6.8), dc8977cfc (tqtc/lts-6.5)

    Description

      Building Qt like that:

      FROM rockylinux:8
      ENV LANG=C.UTF-8
      ENV PATH=/opt/rh/gcc-toolset-12/root/usr/bin:$PATH
      ENV LD_LIBRARY_PATH=/opt/rh/gcc-toolset-12/root/usr/lib64:/opt/rh/gcc-toolset-12/root/usr/lib
      ENV PKG_CONFIG_PATH=/opt/rh/gcc-toolset-12/root/usr/lib64/pkgconfig:/opt/rh/gcc-toolset-12/root/usr/lib/pkgconfig
      
      RUN dnf -y install epel-release \
      	&& dnf config-manager --set-enabled powertools \
      	&& dnf -y install cmake git ninja-build pkgconf gcc-toolset-12-binutils \
      		gcc-toolset-12-gcc-c++ fontconfig-devel freetype-devel \
      		zlib-devel libxkbcommon-devel libxkbcommon-x11-devel \
      		libX11-devel wayland-devel libxcb-devel xcb-util-wm-devel \
      		xcb-util-image-devel xcb-util-keysyms-devel xcb-util-renderutil-devel \
      		xcb-util-cursor-devel mesa-libGL-devel mesa-libEGL-devel \
      		vulkan-devel glib2-devel at-spi2-core-devel \
      		gtk3-devel openssl-devel \
      	&& dnf clean all
      
      WORKDIR /usr/src
      
      RUN <<EOF
      git clone --depth=1 https://github.com/qt/qt5.git
      cd qt5
      git submodule update --init --recursive --depth=1 qtbase qtdeclarative qtwayland qtshadertools
      cmake -GNinja -B build . \
      	-DCMAKE_BUILD_TYPE=RelWithDebInfo \
      	-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \
      	-DBUILD_SHARED_LIBS=OFF \
      	-DQT_BUILD_EXAMPLES=ON \
      	-DFEATURE_no_prefix=ON
      cmake --build build --parallel
      EOF
      

      I see warnings on link step:

      /usr/src/qt5/qtwayland/src/hardwareintegration/compositor/wayland-eglstream-controller/waylandeglstreamintegration.cpp:109: warning: type ‘struct BufferState’ violates the C++ One Definition Rule [-Wodr]
        109 | struct BufferState
            | 
      /usr/src/qt5/qtwayland/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp:118: note: a different type is defined in another translation unit
        118 | struct BufferState
            | 
      /usr/src/qt5/qtwayland/src/hardwareintegration/compositor/wayland-eglstream-controller/waylandeglstreamintegration.cpp:114: note: the first difference of corresponding definitions is field ‘textures’
        114 |     QOpenGLTexture *textures[3] = {nullptr, nullptr, nullptr};
            | 
      /usr/src/qt5/qtwayland/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp:129: note: a field with different name is defined in another translation unit
        129 |     QVarLengthArray<EGLImageKHR, 3> egl_images;
            | 
      /usr/src/qt5/qtwayland/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp:120: warning: type of ‘__ct_comp ’ does not match original declaration [-Wlto-type-mismatch]
        120 |     BufferState() = default;
            | 
      /usr/src/qt5/qtwayland/src/hardwareintegration/compositor/wayland-eglstream-controller/waylandeglstreamintegration.cpp:111: note: ‘__ct_comp ’ was previously declared here
        111 |     BufferState() = default;
            | 
      /usr/src/qt5/qtwayland/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp:120: warning: type of ‘__ct_base ’ does not match original declaration [-Wlto-type-mismatch]
        120 |     BufferState() = default;
            | 
      /usr/src/qt5/qtwayland/src/hardwareintegration/compositor/wayland-eglstream-controller/waylandeglstreamintegration.cpp:111: note: ‘__ct_base ’ was previously declared here
        111 |     BufferState() = default;
            | 
      

      Then, copying any WaylandCompositor example to the host with docker cp and trying to run it like QT_XCB_GL_INTEGRATION=xcb_egl XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR/qt ./minimal-qml + any application using OpenGL like XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR/qt WAYLAND_DISPLAY=wayland-0 elisa results in the following crash of the compositor example:

      #0  std::__atomic_base<int>::fetch_sub (__m=<optimized out>, __i=<optimized out>, this=<optimized out>, this=<optimized out>, __i=<optimized out>, __m=<optimized out>) at /opt/rh/gcc-toolset-12/root/usr/include/c++/12/bits/atomic_base.h:626
      #1  QAtomicOps<int>::deref<int> (_q_value=..., _q_value=...) at /usr/src/qt5/qtbase/src/corelib/thread/qatomic_cxx11.h:266
      #2  QBasicAtomicInteger<int>::deref (this=<optimized out>, this=<optimized out>) at /usr/src/qt5/qtbase/src/corelib/thread/qbasicatomic.h:48
      #3  QObjectPrivate::Connection::deref (this=0xffffffff) at /usr/src/qt5/qtbase/src/corelib/kernel/qobject_p_p.h:114
      #4  QMetaObject::Connection::~Connection (this=<optimized out>, this=<optimized out>) at /usr/src/qt5/qtbase/src/corelib/kernel/qobject.cpp:5744
      #5  0x00000000014da490 in WaylandEglClientBufferIntegrationPrivate::setupBufferAndCleanup(BufferState*, QOpenGLTexture*, int) [clone .constprop.0] (bs=0x39a48b20, texture=texture@entry=0x794b4c32e120, plane=plane@entry=0, this=<optimized out>)
          at /usr/src/qt5/qtwayland/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp:305
      #6  0x0000000000dfa9ab in WaylandEglClientBuffer::toOpenGlTexture (this=0x39a0efa0, plane=0) at /usr/src/qt5/qtwayland/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp:609
      #7  0x0000000000e7f0b5 in QWaylandBufferRef::toOpenGLTexture (plane=0, this=0x794b53ffe7a8) at /usr/src/qt5/qtwayland/src/compositor/compositor_api/qwaylandbufferref.cpp:283
      #8  QWaylandSurfaceTextureProvider::setBufferRef (buffer=..., surfaceItem=0x39a0b3c0, this=<optimized out>) at /usr/src/qt5/qtwayland/src/compositor/compositor_api/qwaylandquickitem.cpp:400
      #9  QWaylandQuickItem::updatePaintNode (this=0x39a0b3c0, oldNode=<optimized out>, data=<optimized out>) at /usr/src/qt5/qtwayland/src/compositor/compositor_api/qwaylandquickitem.cpp:1532
      #10 0x0000000000eecde5 in QQuickWindowPrivate::updateDirtyNode (item=<optimized out>, this=0x395a9760) at /usr/src/qt5/qtdeclarative/src/quick/items/qquickwindow.cpp:2297
      #11 QQuickWindowPrivate::updateDirtyNodes (this=0x395a9760) at /usr/src/qt5/qtdeclarative/src/quick/items/qquickwindow.cpp:2039
      #12 QQuickWindowPrivate::syncSceneGraph (this=<optimized out>) at /usr/src/qt5/qtdeclarative/src/quick/items/qquickwindow.cpp:562
      #13 0x0000000001008314 in QSGRenderThread::sync (inExpose=false, this=0x396a9d40) at /usr/src/qt5/qtdeclarative/src/quick/scenegraph/qsgthreadedrenderloop.cpp:564
      #14 QSGRenderThread::syncAndRender (this=0x396a9d40) at /usr/src/qt5/qtdeclarative/src/quick/scenegraph/qsgthreadedrenderloop.cpp:733
      #15 QSGRenderThread::run (this=0x396a9d40) at /usr/src/qt5/qtdeclarative/src/quick/scenegraph/qsgthreadedrenderloop.cpp:992
      #16 0x00000000005627d0 in operator() (__closure=<optimized out>) at /usr/src/qt5/qtbase/src/corelib/thread/qthread_unix.cpp:434
      #17 (anonymous namespace)::terminate_on_exception<QThreadPrivate::start(void*)::<lambda()> > (t=...) at /usr/src/qt5/qtbase/src/corelib/thread/qthread_unix.cpp:366
      #18 QThreadPrivate::start (arg=0x396a9d40) at /usr/src/qt5/qtbase/src/corelib/thread/qthread_unix.cpp:394
      #19 0x0000794b9cc97e63 in start_thread (arg=<optimized out>) at pthread_create.c:447
      #20 0x0000794b9cd1bdbc in __GI___clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Attachments

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

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            ilya-fedin Ilya Fedin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes