• Méven Car's avatar
    Avoid crash in KWin::DrmOutput::updateCursor · e8a1f8ec
    Méven Car authored
    Summary:
    BUG: 420077
    
    Sample stack traces :
    
    From bug:
    
      #2  QImage::copy (this=this@entry=0x558117775e20, r=...) at image/qimage.cpp:1172
      #3  0x00007f22d0a24cdf in QImage::detach (this=this@entry=0x558117775e20) at image/qimage.cpp:1091
      #4  0x00007f22d0a25ae0 in QImage::fill (this=0x558117775e20, color=...) at image/qimage.cpp:1806
      #5  0x00007f22d0a25f5f in QImage::fill (this=this@entry=0x558117775e20, color=color@entry=Qt::transparent) at image/qimage.cpp:1780
      #6  0x00007f22bf3bdffd in KWin::DrmOutput::updateCursor (this=0x5581176fb780) at ./plugins/platforms/drm/drm_output.cpp:175
      #7  0x00007f22bf3b0e55 in KWin::DrmBackend::updateCursor (this=0x558117669b60) at ./plugins/platforms/drm/drm_backend.cpp:701
    
    Locally reproduced:
    
      #0  0x00007f360611e159 in KWayland::Server::OutputDeviceInterface::transform() const (this=<optimized out>)
          at /home/meven/kde/src/kwayland/src/server/outputdevice_interface.cpp:590
      #1  0x00007f3607438059 in KWin::AbstractWaylandOutput::transform() const (this=this@entry=0x5645bed10f90) at /home/meven/kde/src/kwin/abstract_wayland_output.cpp:317
      #2  0x00007f35ecd8acd3 in KWin::DrmOutput::matrixDisplay(QSize const&) const (this=0x5645bed10f90, s=...)
          at /home/meven/kde/src/kwin/plugins/platforms/drm/drm_output.cpp:155
      #3  0x00007f35ecd8efa9 in KWin::DrmOutput::updateCursor() (this=<optimized out>) at /home/meven/kde/src/kwin/plugins/platforms/drm/drm_output.cpp:179
      #4  0x00007f35ecd81db5 in KWin::DrmBackend::updateCursor() (this=0x5645bec743a0) at /home/meven/kde/src/kwin/plugins/platforms/drm/drm_backend.cpp:701
      #5  0x00007f36049e7fe7 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
      #6  0x00007f36075ee43f in KWin::Cursors::currentCursorChanged(KWin::Cursor*) (this=<optimized out>, _t1=<optimized out>)
          at /home/meven/kde/build/kwin/kwin_autogen/EWIEGA46WW/moc_cursor.cpp:385
    
    Test Plan: Could not reproduce
    
    Reviewers: #kwin, zzag, davidedmundson
    
    Reviewed By: #kwin, davidedmundson
    
    Subscribers: ngraham, apol, kwin
    
    Tags: #kwin
    
    Differential Revision: https://phabricator.kde.org/D28889
    e8a1f8ec
drm_output.cpp 34.5 KB