Priority: P1: Critical
Affects Version/s: 5.15.2, 6.0.0
Component/s: QPA: Wayland
Commits:b19b0fbaf775e8b8eda1e03c265a5393d618c6c0 (qt/qtwayland/dev) a3ee3b1ac6752cb1e1bf86f8ef972f7d410e1d50 (qt/tqtc-qtwayland/5.15) c0ef4aa9529453197245f2db36df1d6b064e8532 (qt/qtwayland/6.1)
When running the following snippet, the program will segfault as soon as the instantiated window is hidden by the timer:
I'm running the snippet with the following command:
AFAIK this was working fine in Qt 5.9. What we see is that the platform window is destroyed after a call to setVisible(false), which triggers the destruction of the wl_egl_window and wl_surface. But the scenegraph thread is still using the window for rendering (ie calling swapBuffers), so the process crashes. I can reproduce this on both GNOME/wayland with up to date mesa drivers and also on embedded devices with proprietary drivers.
I can reproduce the issue with both Qt 5.15 and Qt 6.0.
Here's the stack trace with Qt6:
|For Gerrit Dashboard: QTBUG-90037|
|338145,2||Client: Send SurfaceAboutToBeDestroyed before hide||dev||qt/qtwayland||Status: ABANDONED||-1||0|
|344802,4||client: Gracefully handle shutdown and window hiding||dev||qt/qtwayland||Status: MERGED||+2||0|
|351172,3||client: Gracefully handle shutdown and window hiding||6.1||qt/qtwayland||Status: MERGED||+2||0|
|351173,1||client: Gracefully handle shutdown and window hiding||6.0||qt/qtwayland||Status: ABANDONED||0||0|
|351175,3||client: Gracefully handle shutdown and window hiding||tqtc/lts-5.15||qt/tqtc-qtwayland||Status: MERGED||+2||0|