Bug 447958 - Discover hangs in "About" Dialog
Summary: Discover hangs in "About" Dialog
Status: RESOLVED FIXED
Alias: None
Product: Discover
Classification: Applications
Component: discover (show other bugs)
Version: 5.23.5
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Dan Leinir Turthra Jensen
URL:
Keywords:
: 452326 454915 456451 458733 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-01-05 07:23 UTC by Georg Grabler
Modified: 2022-09-07 10:34 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.94


Attachments
Screenshot of bug occuring/terminate dialog (263.73 KB, image/png)
2022-01-12 21:13 UTC, Georg Grabler
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Georg Grabler 2022-01-05 07:23:25 UTC
SUMMARY
Discover seems to be endlessly looping when clicking the "About" dialog.

STEPS TO REPRODUCE
1. Open Discover
2. Click the "About" dialog

OBSERVED RESULT
Hangs spamming this two messages in the console:
Qt Quick Layouts: Polish loop detected. Aborting after two iterations.
file:///usr/lib/qt/qml/org/kde/kirigami.2/AboutItem.qml:135:5: QML FormLayout: Binding loop detected for property "implicitHeight"
file:///usr/lib/qt/qml/org/kde/kirigami.2/AboutItem.qml:135:5: QML FormLayout: Binding loop detected for property "implicitHeight"
Qt Quick Layouts: Polish loop detected. Aborting after two iterations.
file:///usr/lib/qt/qml/org/kde/kirigami.2/AboutItem.qml:135:5: QML FormLayout: Binding loop detected for property "implicitHeight"
file:///usr/lib/qt/qml/org/kde/kirigami.2/AboutItem.qml:135:5: QML FormLayout: Binding loop detected for property "implicitHeight"
Qt Quick Layouts: Polish loop detected. Aborting after two iterations.
file:///usr/lib/qt/qml/org/kde/kirigami.2/AboutItem.qml:135:5: QML FormLayout: Binding loop detected for property "implicitHeight"
file:///usr/lib/qt/qml/org/kde/kirigami.2/AboutItem.qml:135:5: QML FormLayout: Binding loop detected for property "implicitHeight"


EXPECTED RESULT
Actually, not hanging :-).

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Linux 5.15.12-arch
KDE Plasma Version: 5.23.5
KDE Frameworks Version: 5.89.0 (within that, kirigami2 5.89.0)
Qt Version: 5.15.2
Comment 1 Georg Grabler 2022-01-05 20:13:21 UTC
One thing I realized:
This does not happen when the Discover window is maximized, only when it's in a non-maximized window. May be a Kirigami bug?
Comment 2 Nate Graham 2022-01-12 20:33:29 UTC
Cannot reproduce with current git master of everything.

Does the same thing happen in System Monitor? Or Just Discover?
Comment 3 Georg Grabler 2022-01-12 21:13:34 UTC
Created attachment 145382 [details]
Screenshot of bug occuring/terminate dialog

Hi Nate, thanks for looking into this. I attached a screenshot what it looks like when it crashes.

No, this does not happen in the System Monitor (Pressing the three "lines" and "About System Monitor".

Method used (discover git):
$ cmake .
$ make DESTDIR=/home/XXX/devel/deploy/discover install
$ export LD_LIBRARY_PATH=/home/XXX/devel/deploy/discover/usr/local/lib/:/home/XXX/devel/deploy/discover/usr/local/lib/plasma-discover/:/home/XXX/devel/deploy/discover/usr/local/lib/libexec/:/home/XXX/devel/deploy/discover/usr/local/lib/plugins/discover/:/home/XXX/devel/deploy/discover/usr/local/lib/plugins/discover-notifier/:/home/XXX/devel/deploy/discover/usr/local/lib/plugins/plasma/
$ cd /home/XXX/devel/deploy/discover/usr/local/bin
$ ./plasma-discover

That's enough to reproduce it, though, ofc, it does not properly find plugins etc, but the "about" dialog shows the same issue as if I run discover from archlinux.

I'm using two 1920x1080 monitors where the primary monitor is not the "primary" set in KDE; and they are switched sides (means the one detected left is the right one and the right one the left one, so I switched them in displays). If that may cause an issue.

Is there anything I can do to help debug the issue?

Best regards,
G
Comment 4 Georg Grabler 2022-01-12 21:13:57 UTC
PS: I replaced my username with XXX ofc ;-).
Comment 5 Nate Graham 2022-01-13 17:24:08 UTC
Thanks for the info. Still cannot reproduce with my git master version.
Comment 6 Georg Grabler 2022-01-16 05:47:44 UTC
Hi Nate, that's somewhat ... strange. Though, I actually succeeded reproducing this on KDE Neon (which I installed for that purpose), so it probably really has to do with my setup and being a corner case, and seriously - who presses the about dialog but me :D. This will be difficult and strange to find out.

I'd like to tackle this though. I have no former experience debugging kirigami, since looking at the code of  discover, I think it hardly is connected to that, since you just use KF5 and within that kirigami. But I'll give it a shot and see if I can come up with better information.

//G
Comment 7 nttkde 2022-01-16 10:24:51 UTC
@nate:
I tried and could reproduce this on X11 KDE Neon User Edition with Discover window size of about 830x650, or 810x630 in other case in VM. (Maybe depends on how big the UI items are because of a language; the latter case was in English language Discover)
Try if a size in that ballpark hangs the git master version.

( I used xdotool search --name "About – Discover" windowsize 810 630 )
Comment 8 Georg Grabler 2022-01-16 16:51:56 UTC
That's an interesting finding - I'm on the english language too, but I doubt it's the issue.

I did some more testing. If I delete my ~/.config/discoverrc and start discover it crashes in the About dialog. If I resize the window (and if just for a few pixels) it does not crash. It does not matter if i make the window bigger or smaller, after resizing it it never crashes again.
Comment 9 Georg Grabler 2022-01-19 00:49:17 UTC
I just realized: This does no always happen, but for me about 90 % of the time in KDE Neon.

Switching between the options "Installed", "Settings", "About" and "Up to date" reproduces it pretty well if I did not resize the window before.

If I resize the window before - this does not happen.
Comment 10 guimarcalsilva 2022-02-08 05:00:35 UTC
I believe I'm hitting a very similar, if not the same, bug. If I click on many app entries, on some rare occasions, the interface freezes until I resize the window. I captured the terminal log and right when it freezes it outputs: 

Qt Quick Layouts: Polish loop detected. Aborting after two iterations.

The same line is in this bug report (and this is how I found it too). 

If it's indeed the same bug, it means it's not only the About page that can trigger it, but app pages as well.

Googling about this error points to this page: https://bugreports.qt.io/browse/QTBUG-88339

They describe that that output can cause apps to freeze, just like Discover is doing here. There's a comment also saying that

>See https://codereview.qt-project.org/c/qt/qtdeclarative/+/299581 : a polish loop is when polish() is called within
updatePolish(). If you do too much of that, maybe polishing never completes and your UI will hang; so we have a conservative warning and abort the polishing early to avoid people reporting bugs that it's our fault that their UI hung. If you see this warning, the application probably needs work.

-------------------

(In reply to Georg Grabler from comment #9)
> I just realized: This does no always happen, but for me about 90 % of the
> time in KDE Neon.
> 
> Switching between the options "Installed", "Settings", "About" and "Up to
> date" reproduces it pretty well if I did not resize the window before.
> 
> If I resize the window before - this does not happen.

I managed to reproduce this issue by doing what you said, and the freeze looks exactly the same as when it happens when navigating applications. If you resize or maximize/unmaximize the window, it unfreezes.
Comment 11 Georg Grabler 2022-02-08 10:12:48 UTC
The ~/.config/discoverrc which I can reproduce this every time (this is on a fresh fedora install for testing purposes):

[Window]
geometry=1920,29,810,540
visibility=2


where I do not see this issue if i minimally resized the window (note, it's just 1px resized):
[Window]
geometry=1920,29,810,541
visibility=2

It does not matter if the discoverrc exists or not, it's definitely an issue with the exact size (which seems to be the default size on my computer).

I couldn't find what could make the difference in kirigami, kcoreaddons or discover why this would trigger polish() almost permanently (which seems to be the case). Seems like polish() is called too often, cancelled and then re-called by kirigami, but I couldn't find what could cause this in KAboutDialog.
Comment 12 Ben Cotton 2022-03-25 19:27:20 UTC
This is a Fedora Linux 36 final blocker: https://bugzilla.redhat.com/show_bug.cgi?id=2057563

I can reproduce this every time with Discover 5.24.3, except when the window is maximized.
Comment 13 Nate Graham 2022-03-31 19:02:43 UTC
99% sure this is another manifestation of bug 448784.

*** This bug has been marked as a duplicate of bug 448784 ***
Comment 14 Aleix Pol 2022-04-08 15:07:37 UTC
Git commit 57187b7e6a1c6396c95b9450ff4c8acb8e70f431 by Aleix Pol.
Committed on 08/04/2022 at 15:02.
Pushed by apol into branch 'master'.

AboutPage: Prevent infinite loop

Do not use the width of the item but the width of the page to decide if
we are on wide mode in the FormLayout.

For some reason our default height hits a perfect storm of:
- growing past the page height
- adds a scrollbar
- this narrows the view and we enable the compact mode
- this makes it fit again
- goto 0

M  +2    -0    src/controls/AboutItem.qml
M  +1    -0    src/controls/AboutPage.qml

https://invent.kde.org/frameworks/kirigami/commit/57187b7e6a1c6396c95b9450ff4c8acb8e70f431
Comment 15 Nate Graham 2022-04-08 23:34:31 UTC
*** Bug 452326 has been marked as a duplicate of this bug. ***
Comment 16 Nicolas Fella 2022-06-06 10:23:49 UTC
*** Bug 454915 has been marked as a duplicate of this bug. ***
Comment 17 Nate Graham 2022-07-13 18:18:30 UTC
*** Bug 456451 has been marked as a duplicate of this bug. ***
Comment 18 Nate Graham 2022-08-09 19:26:58 UTC
*** Bug 457675 has been marked as a duplicate of this bug. ***
Comment 19 Nicolas Fella 2022-09-07 10:34:59 UTC
*** Bug 458733 has been marked as a duplicate of this bug. ***