Bug 426567 - Crash in clientshape
Summary: Crash in clientshape
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: git master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-15 15:25 UTC by David Edmundson
Modified: 2020-11-03 15:20 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.20.3


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Edmundson 2020-09-15 15:25:19 UTC
(gdb) 
#0  QScopedPointer<KWaylandServer::SurfaceInterfacePrivate, QScopedPointerDeleter<KWaylandServer::SurfaceInterfacePrivate> >::operator->() const (this=0x10) at /opt/qt5/include/QtCore/qscopedpointer.h:118
#1  0x00007f2653ca48d9 in KWaylandServer::SurfaceInterface::size() const (this=0x0) at /home/david/projects/kde5/src/kde/workspace/kwayland-server/src/server/surface_interface.cpp:807
#2  0x00007f26567a08d0 in KWin::WindowPixmap::shape() const (this=0x56436e79f060) at /home/david/projects/kde5/src/kde/workspace/kwin/scene.cpp:1278
#3  0x00007f265679fa6b in KWin::Scene::Window::makeContentsQuads() const (this=0x56436dd25650) at /home/david/projects/kde5/src/kde/workspace/kwin/scene.cpp:1030
#4  0x00007f265679f44b in KWin::Scene::Window::buildQuads(bool) const (this=0x56436dd25650, force=false) at /home/david/projects/kde5/src/kde/workspace/kwin/scene.cpp:903
#5  0x00007f265679b88d in KWin::Scene::paintSimpleScreen(int, QRegion const&) (this=0x56436cc10e20, orig_mask=0, region=...) at /home/david/projects/kde5/src/kde/workspace/kwin/scene.cpp:295
#6  0x00007f264c1e0c42 in KWin::SceneOpenGL2::paintSimpleScreen(int, QRegion const&) (this=0x56436cc10e20, mask=0, region=...) at /home/david/projects/kde5/src/kde/workspace/kwin/plugins/scenes/opengl/scene_opengl.cpp:1010
#7  0x00007f265679a93a in KWin::Scene::finalPaintScreen(int, QRegion const&, KWin::ScreenPaintData&) (this=0x56436cc10e20, mask=0, region=..., data=...) at /home/david/projects/kde5/src/kde/workspace/kwin/scene.cpp:188
#8  0x00007f265669e6ff in KWin::EffectsHandlerImpl::paintScreen(int, QRegion const&, KWin::ScreenPaintData&) (this=0x56436d457000, mask=0, region=..., data=...)
    at /home/david/projects/kde5/src/kde/workspace/kwin/effects.cpp:386
#9  0x00007f26561f934d in KWin::Effect::paintScreen(int, QRegion const&, KWin::ScreenPaintData&) (this=0x56436d432b20, mask=0, region=..., data=...)



I'm not sure I get the current code

QRegion WindowPixmap::shape() const
{
    if (subSurface())
        return QRect(QPoint(), surface()->size());
    return m_window->clientShape();
}

Is it meaning to check surface and is a typo?
Comment 1 Vlad Zahorodnii 2020-09-21 07:52:25 UTC
Hmm, this crash is really strange. My assumption was that the surface tree never contains inert sub-surfaces.

As for the WindowPixmap::shape() method, it returns the shape of the pixmap. For X11 windows, it corresponds to the bounding shape. For Wayland surfaces, it is QRect(QPoint(0, 0), size) since the Shape extension is X11-only.
Comment 2 Lewis Lakerink 2020-11-02 07:10:40 UTC
My backtrace for https://invent.kde.org/plasma/kwin/-/merge_requests/408 is identical to David's.
Comment 3 Lewis Lakerink 2020-11-02 07:14:24 UTC
FWIW, I found that checking only for surface() without subSurface() lead to black window decorations on XWayland clients.