[kwin] [Bug 380865] kwin_x11 freezes with 100% CPU when using Desktop Grid with Present Windows and Fill Gaps enabled

2018-10-28 Thread Vlad Zagorodniy
https://bugs.kde.org/show_bug.cgi?id=380865

Vlad Zagorodniy  changed:

   What|Removed |Added

  Latest Commit|https://commits.kde.org/kwi |https://commits.kde.org/kwi
   |n/30ad58f559aa0cfc5dba649be |n/4348cd56834cb17da5aa9d95d
   |387578481e8db32 |16ddc27bf39e0e6

--- Comment #7 from Vlad Zagorodniy  ---
Git commit 4348cd56834cb17da5aa9d95d16ddc27bf39e0e6 by Vlad Zagorodniy, on
behalf of Erik Kurzinger.
Committed on 28/10/2018 at 22:02.
Pushed by vladz into branch 'Plasma/5.12'.

[effects/presentwindows] Avoid potential freeze during fill-gaps

Summary:
When using the natural layout algorithm with the fill-gaps option, a small
error (less than one) is introduced in windows' aspect ratio each time they are
enlarged due to floating-point roundoff.

Currently, the algorithm computes the width and height enlargement factors and
then attempts to enlarge in each of the four possible directions, repeating
until it can't enlarge any windows any further.  Hence, this aspect ratio error
can be multiplied by up to four. Especially for small, long, and narrow
windows, this can result in a total error of greater than one by the end of
that loop iteration. If this occurs, on subsequent iterations the height
enlargement factor might then be computed as negative violating some of the
core assumptions of the algorithm and resulting in the loop iterating endlessly
until one of the window dimensions overflows, freezing the program for up to
several minutes.

To fix this, the height enlargement factor should be re-computed based on the
new width each time the window is enlarged, ensuring the error introduced in
the aspect ratio never exceeds one.
Related: bug 364709, bug 368811

FIXED-IN: 5.15.0

Test Plan:
The most reliable way to reproduce the freeze seems to be to activate the
desktop-grid effect while a tool-tip window is fading in.
Ensure desktop-grid is configured to use present windows, and that present
windows is configured to use the natural layout algorithm with the fill gaps
option selected.

The freeze is still intermittent, but using this method should be able to be
triggered within about 10 tries without this fix.
After applying the fix, the freeze has never been observed.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: graesslin, kwin, zzag

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16278

M  +15   -3effects/presentwindows/presentwindows.cpp

https://commits.kde.org/kwin/4348cd56834cb17da5aa9d95d16ddc27bf39e0e6

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 380865] kwin_x11 freezes with 100% CPU when using Desktop Grid with Present Windows and Fill Gaps enabled

2018-10-20 Thread Vlad Zagorodniy
https://bugs.kde.org/show_bug.cgi?id=380865

Vlad Zagorodniy  changed:

   What|Removed |Added

 Resolution|--- |FIXED
  Latest Commit||https://commits.kde.org/kwi
   ||n/30ad58f559aa0cfc5dba649be
   ||387578481e8db32
   Version Fixed In||5.15.0
 Status|REPORTED|RESOLVED

--- Comment #6 from Vlad Zagorodniy  ---
Git commit 30ad58f559aa0cfc5dba649be387578481e8db32 by Vlad Zagorodniy, on
behalf of Erik Kurzinger.
Committed on 20/10/2018 at 15:37.
Pushed by vladz into branch 'master'.

[effects/presentwindows] Avoid potential freeze during fill-gaps

Summary:
When using the natural layout algorithm with the fill-gaps option, a small
error (less than one) is introduced in windows' aspect ratio each time they are
enlarged due to floating-point roundoff.

Currently, the algorithm computes the width and height enlargement factors and
then attempts to enlarge in each of the four possible directions, repeating
until it can't enlarge any windows any further.  Hence, this aspect ratio error
can be multiplied by up to four. Especially for small, long, and narrow
windows, this can result in a total error of greater than one by the end of
that loop iteration. If this occurs, on subsequent iterations the height
enlargement factor might then be computed as negative violating some of the
core assumptions of the algorithm and resulting in the loop iterating endlessly
until one of the window dimensions overflows, freezing the program for up to
several minutes.

To fix this, the height enlargement factor should be re-computed based on the
new width each time the window is enlarged, ensuring the error introduced in
the aspect ratio never exceeds one.
Related: bug 364709, bug 368811

FIXED-IN: 5.15.0

Test Plan:
The most reliable way to reproduce the freeze seems to be to activate the
desktop-grid effect while a tool-tip window is fading in.
Ensure desktop-grid is configured to use present windows, and that present
windows is configured to use the natural layout algorithm with the fill gaps
option selected.

The freeze is still intermittent, but using this method should be able to be
triggered within about 10 tries without this fix.
After applying the fix, the freeze has never been observed.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: graesslin, kwin, zzag

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16278

M  +15   -3effects/presentwindows/presentwindows.cpp

https://commits.kde.org/kwin/30ad58f559aa0cfc5dba649be387578481e8db32

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 380865] kwin_x11 freezes with 100% CPU when using Desktop Grid with Present Windows and Fill Gaps enabled

2018-02-19 Thread Martin Flöser
https://bugs.kde.org/show_bug.cgi?id=380865

Martin Flöser  changed:

   What|Removed |Added

 CC||marcel.is...@gmail.com

--- Comment #5 from Martin Flöser  ---
*** Bug 390743 has been marked as a duplicate of this bug. ***

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 380865] kwin_x11 freezes with 100% CPU when using Desktop Grid with Present Windows and Fill Gaps enabled

2017-08-14 Thread Achilleas Koutsou
https://bugs.kde.org/show_bug.cgi?id=380865

Achilleas Koutsou  changed:

   What|Removed |Added

 CC||achillea...@gmail.com

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 380865] kwin_x11 freezes with 100% CPU when using Desktop Grid with Present Windows and Fill Gaps enabled

2017-07-02 Thread Martin Flöser
https://bugs.kde.org/show_bug.cgi?id=380865

Martin Flöser  changed:

   What|Removed |Added

 CC||m...@elbmurf.de

--- Comment #4 from Martin Flöser  ---
*** Bug 381934 has been marked as a duplicate of this bug. ***

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 380865] kwin_x11 freezes with 100% CPU when using Desktop Grid with Present Windows and Fill Gaps enabled

2017-06-23 Thread Kelvie Wong
https://bugs.kde.org/show_bug.cgi?id=380865

Kelvie Wong  changed:

   What|Removed |Added

Summary|kwin_x11 freezes with 100%  |kwin_x11 freezes with 100%
   |CPU when using Desktop Grid |CPU when using Desktop Grid
   |with Present Windows|with Present Windows and
   ||Fill Gaps enabled

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 380865] kwin_x11 freezes with 100% CPU when using Desktop Grid with Present Windows

2017-06-23 Thread Kelvie Wong
https://bugs.kde.org/show_bug.cgi?id=380865

--- Comment #3 from Kelvie Wong  ---
OK, I did some further digging. In
PresentWindowsEffect::calculateWindowTransformationNatural, near the end, there
is a do-while loop (if "Fill Gaps" is enabled); it seems to loop on and on, and
doesn't ever exit this loop for several minutes, as mentioned by Mr. Kauffmann
above.

I turned off "Fill Gaps" to fix this, but someone should take a look at the
algorithm.

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 380865] kwin_x11 freezes with 100% CPU when using Desktop Grid with Present Windows

2017-06-17 Thread Martin Flöser
https://bugs.kde.org/show_bug.cgi?id=380865

--- Comment #2 from Martin Flöser  ---
not much to see unfortunately in the debug output. It could indicate that we
fail to calculate a layout.

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 380865] kwin_x11 freezes with 100% CPU when using Desktop Grid with Present Windows

2017-06-17 Thread Martin Flöser
https://bugs.kde.org/show_bug.cgi?id=380865

Martin Flöser  changed:

   What|Removed |Added

 Attachment #106103|text/x-log  |text/plain
  mime type||

-- 
You are receiving this mail because:
You are watching all bug changes.

[kwin] [Bug 380865] kwin_x11 freezes with 100% CPU when using Desktop Grid with Present Windows

2017-06-14 Thread Kelvie Wong
https://bugs.kde.org/show_bug.cgi?id=380865

Kelvie Wong  changed:

   What|Removed |Added

 CC||kel...@ieee.org

--- Comment #1 from Kelvie Wong  ---
Created attachment 106103
  --> https://bugs.kde.org/attachment.cgi?id=106103&action=edit
two backtraces on all threads on kwin_x11 while it's frozen, I let it run for a
few seconds before taking the second one

-- 
You are receiving this mail because:
You are watching all bug changes.