graesslin created this revision.
graesslin added reviewers: KWin, Plasma.
Restricted Application added a project: KWin.
Restricted Application added subscribers: kwin, plasma-devel.
graesslin requested review of this revision.
Restricted Application edited projects, added Plasma; removed KWin.

REVISION SUMMARY
  If the cursor theme failed to create KWin crashed due to an endless
  recursion. There are two reasons for this fault:
  
  1. When the physical size does not exist we perform a division by 0
  
  which results in an invalid size going into wl_cursor_theme_load
  
  2. We emit the signal that the cursor theme changed even if it didn't
  
  change thus creating an endless recursion
  
  This change addresses both problems: it checks that the size is not 0
  and changes the handling for theme update to only destroy the previous
  theme if the new theme could be created and only emits the signal if
  things change.
  
  BUG: 390314
  FIXED-IN: 5.12.2

TEST PLAN
  Added a new test case which crashed with old code

REPOSITORY
  R108 KWin

BRANCH
  dont-crash-cursor-theme-failure

REVISION DETAIL
  https://phabricator.kde.org/D10549

AFFECTED FILES
  autotests/integration/CMakeLists.txt
  autotests/integration/dont_crash_cursor_physical_size_empty.cpp
  wayland_cursor_theme.cpp

To: graesslin, #kwin, #plasma
Cc: plasma-devel, kwin, ZrenBot, progwolff, lesliezhai, ali-mohamed, 
jensreuterberg, abetts, sebas, apol, mart

Reply via email to