Bug 336301 - Opening configuration dialog eats CPU (QQuickWindow: possible QQuickItem::polish() loop)
Summary: Opening configuration dialog eats CPU (QQuickWindow: possible QQuickItem::pol...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Desktop Containment (show other bugs)
Version: master
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: 1.0
Assignee: Sebastian Kügler
URL: https://bugreports.qt-project.org/bro...
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-16 01:56 UTC by Elias Probst
Modified: 2014-06-20 01:45 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Screenshot of hanging plasmashell config dialog after trying to resize it (399.44 KB, image/png)
2014-06-16 01:56 UTC, Elias Probst
Details
Screenshot of hanging activity switcher (425.78 KB, image/png)
2014-06-16 19:47 UTC, Elias Probst
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Elias Probst 2014-06-16 01:56:07 UTC
Created attachment 87214 [details]
Screenshot of hanging plasmashell config dialog after trying to resize it

Opening the desktop configuration dialog shows a non-responsive window for ~5 minutes.
When it is finally rendered, plasmashell's journal shows this error message:

QQuickWindow: possible QQuickItem::polish() loop

Any further operation in the dialog (e.g. resize it) leads to the same happening again.
The wallpaper thumbnails in the configuration dialog look slightly too big (see attachment), overlapping each other - I don't know if that's related to the polish() loop.

Running KF5/Plasma 5 latest from git and Qt 5.3.0.

Please let me know if there are any values I could provide from a GDB session at the moment the dialog hangs.
Comment 1 Marco Martin 2014-06-16 08:31:43 UTC
try it:
* with another widget style than the oxygen
* with another window decoration than Breeze

very important the las one, since Aurorae window decorations in kwin5 are known to have many bugs and are not really supported
Comment 2 David Edmundson 2014-06-16 11:43:16 UTC
Marking as needs info from Marco's comment.
Comment 3 Elias Probst 2014-06-16 11:55:13 UTC
Using now 'Oxygen' win deco and 'Fusion' widget style.
The dialog opens now immediately, but resizing it still hangs and shows after a while:

QQuickWindow: possible QQuickItem::polish() loop
Comment 4 Elias Probst 2014-06-16 19:17:43 UTC
Seeing this now also when opening the activity switcher. Looks like this is not necessarily an issue isolated to the config dialog.

When trying to show the activity switcher, plasmashell hangs for ~3 minutes, then logs "QQuickWindow: possible QQuickItem::polish() loop" and then shows the activity switcher.
Comment 5 Elias Probst 2014-06-16 19:20:18 UTC
https://bugreports.qt-project.org/browse/QTBUG-31632 is possibly  related - I miss the knowledge to tell whether there'd be any workarounds for this.
Comment 6 Elias Probst 2014-06-16 19:21:19 UTC
Looks like this are cases of some kind of undetected binding loops…
Comment 7 Elias Probst 2014-06-16 19:38:47 UTC
Some more details:

I usually open the activity switcher on my 2nd screen (see qtdiag output below). There it works just fine.
When I try to launch it on my primary laptop screen, the described issue (hanging, then  "QQuickWindow: possible QQuickItem::polish() loop") occurs.

qtdiag:
Qt 5.3.0 (Jun  3 2014, GCC 4.8.2, 64 bit, release build) on "xcb" little endian/

Library info:
  PrefixPath: /usr
  DocumentationPath: /usr/share/doc/qt-5.3.0
  HeadersPath: /usr/include/qt5
  LibrariesPath: /usr/lib64
  LibraryExecutablesPath: /usr/lib64/qt5/libexec
  BinariesPath: /usr/lib64/qt5/bin
  PluginsPath: /usr/lib64/qt5/plugins
  ImportsPath: /usr/lib64/qt5/imports
  Qml2ImportsPath: /usr/lib64/qt5/qml
  ArchDataPath: /usr/lib64/qt5
  DataPath: /usr/share/qt5
  TranslationsPath: /usr/share/qt5/translations
  ExamplesPath: /usr/share/qt5/examples
  TestsPath: /usr/share/qt5/tests

Standard paths:
  DesktopLocation: "Desktop" /home/elias/Desktop
  DocumentsLocation: "Documents" /home/elias
  FontsLocation: "Fonts" /home/elias/.fonts
  ApplicationsLocation: "Applications" /home/elias/.local/share/applications,/usr/local/share/applications,/usr/share/applications
  MusicLocation: "Music" /home/elias/Music
  MoviesLocation: "Movies" /home/elias/Videos
  PicturesLocation: "Pictures" /home/elias/Pictures
  TempLocation: "Temporary Directory" /tmp
  HomeLocation: "Home" /home/elias
  DataLocation: "Application Data" /home/elias/.local/share/Qt Project/qtdiag,/usr/local/share/Qt Project/qtdiag,/usr/share/Qt Project/qtdiag
  CacheLocation: "Cache" /home/elias/.cache/Qt Project/qtdiag
  GenericDataLocation: "Shared Data" /home/elias/.local/share,/usr/local/share,/usr/share
  RuntimeLocation: "Runtime" /run/user/1000
  ConfigLocation: "Configuration" /home/elias/.config,/etc/xdg
  DownloadLocation: "Download" /home/elias/Downloads
  GenericCacheLocation: "Shared Cache" /home/elias/.cache

Platform capabilities: ThreadedPixmaps OpenGL WindowMasks MultipleWindows ForeignWindows

Style hints:
  mouseDoubleClickInterval: 400
  startDragDistance: 10
  startDragTime: 500
  startDragVelocity: 0
  keyboardInputInterval: 400
  keyboardAutoRepeatRate: 30
  cursorFlashTime: 1000
  showIsFullScreen: 0
  passwordMaskDelay: 0
  fontSmoothingGamma: 1.7
  useRtlExtensions: 0
  mousePressAndHoldInterval: 800

Theme:
  Styles: oxygen,oxygen,fusion,windows
  Icon theme: breeze, hicolor from /usr/share/icons
  System font: "Sans Serif" 10
  General font : "Sans Serif" 10
  Fixed font   : "Oxygen Mono" 9
  Title font   : "Sans Serif" 10
  Smallest font: "Sans Serif" 8

  Native file dialog

Screens: 2
*# 0 "eDP1" Depth: 24
  Geometry: 1920x1080+520+1440 Available: 1920x1050+520+1440
  Virtual geometry: 2560x2520+0+0 Available: 2560x2460+0+30
  2 virtual siblings
  Physical size: 294x165 mm  Refresh: 60 Hz
  Physical DPI: 165.878,166.255 Logical DPI: 96.0473,96.1081
  DevicePixelRatio: 1 Primary orientation: 2
  Orientation: 2 OrientationUpdateMask: 0

 # 1 "DP1" Depth: 24
  Geometry: 2560x1440+0+0 Available: 2560x1410+0+30
  Virtual geometry: 2560x2520+0+0 Available: 2560x2460+0+30
  2 virtual siblings
  Physical size: 597x336 mm  Refresh: 60 Hz
  Physical DPI: 108.918,108.857 Logical DPI: 96.0473,96.1081
  DevicePixelRatio: 1 Primary orientation: 2
  Orientation: 2 OrientationUpdateMask: 0

LibGL Vendor: Intel Open Source Technology Center
Renderer: Mesa DRI Intel(R) Ivybridge Mobile
Version: 3.0 Mesa 10.0.4
Shading language: 1.30
Format: Version: 3.0 Profile: 0 Swap behavior: 0 Buffer size (RGBA): 8,8,8,8
Comment 8 Elias Probst 2014-06-16 19:47:20 UTC
Created attachment 87224 [details]
Screenshot of hanging activity switcher

Sorry for spamming this bug report, but I just add things as I notice them… :)

I feel like this could be related to the scaling of the activity thumbnails (see also attached screenshot).
When the activity switcher shows up, it keeps hanging but the thumbnails move/adjust their position + size every 2 minutes or so - every time something changes, the "QQuickWindow: possible QQuickItem::polish() loop" message is logged.
The first thumbnail is never positioned correctly when opening the hanging activitiy switcher on my primary display, always being hidden by 1/3rd on the left side.
Comment 9 Elias Probst 2014-06-19 21:49:35 UTC
I got rid of the hanging plasmashell desktop config dialog by simply doing this:

> diff --git a/wallpapers/image/imagepackage/contents/ui/config.qml b/wallpapers/image/imagepackage/contents/ui/config.qml
> index 82c16ec..a8eae26 100644
> --- a/wallpapers/image/imagepackage/contents/ui/config.qml
> +++ b/wallpapers/image/imagepackage/contents/ui/config.qml
> @@ -233,8 +233,8 @@ ColumnLayout {
>                  model: imageWallpaper.wallpaperModel
>                  currentIndex: -1
>  
> -                cellWidth: Math.floor(wallpapersGrid.width / Math.max(Math.floor(wallpapersGrid.width / (units.gridUnit*12)), 3))
> -                cellHeight: cellWidth / (imageWallpaper.width / imageWallpaper.height)
> +                cellWidth: 40
> +                cellHeight: 30
>  
>                  anchors.margins: 4
>                  boundsBehavior: Flickable.StopAtBounds

That's for sure no solution, but it clearly shows where the problem comes from - so if anyone knows how this binding loop can be properly resolved, this bug should be fixed:

file:///usr/share/plasma/wallpapers/org.kde.image/contents/ui/config.qml:231:13: QML GridView: Binding loop detected for property "cellWidth"
Comment 10 David Edmundson 2014-06-20 01:45:15 UTC
Git commit 6e6cec3a5662fdece3ec1b0c0c8695214dd7739d by David Edmundson.
Committed on 20/06/2014 at 01:45.
Pushed by davidedmundson into branch 'master'.

Always show vertical scrollbar in image selection

M  +12   -0    wallpapers/image/imagepackage/contents/ui/config.qml

http://commits.kde.org/plasma-workspace/6e6cec3a5662fdece3ec1b0c0c8695214dd7739d