Bug 454507

Summary: Krunner freezes if a runner's output is longer than three lines
Product: [Plasma] krunner Reporter: Björn Bidar (Thaodan) <bjorn.bidar>
Component: generalAssignee: Alexander Lohnau <alexander.lohnau>
Status: RESOLVED FIXED    
Severity: normal CC: ahiemstra, isma.af, kde, nate, plasma-bugs
Priority: NOR    
Version: 5.24.5   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 5.24.6
Attachments: Krunnner journal while triggering the bug

Description Björn Bidar (Thaodan) 2022-05-27 21:50:26 UTC
Created attachment 149273 [details]
Krunnner journal while triggering the bug

SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***

If a runner's match output is longer than 3 lines krunners freezes because of a binding loop detected.
I used the translator runner with setMultiline result enabled from here:
https://github.com/Thaodan/krunner-translator/tree/multiline



Operating System: Arch Linux
KDE Plasma Version: 5.24.5
KDE Frameworks Version: 5.94.0
Qt Version: 5.15.4
Kernel Version: 5.17.0-pf1-1 (64-bit)
Graphics Platform: X11
Processors: 64 × AMD Ryzen Threadripper 3970X 32-Core Processor
Memory: 94.2 GiB of RAM
Graphics Processor: AMD Radeon RX 6900 XT
Comment 1 Alexander Lohnau 2022-05-28 05:43:42 UTC
What query do you run to trigger the issue? When typing the example queries from the readme, it works as expected.
Comment 2 Björn Bidar (Thaodan) 2022-05-28 06:52:39 UTC
(In reply to Alexander Lohnau from comment #1)
> What query do you run to trigger the issue? When typing the example queries
> from the readme, it works as expected.

Something that is longer than 3 lines, also make sure you have the version build that sets setMultiline(true);
Comment 3 Björn Bidar (Thaodan) 2022-05-28 07:10:00 UTC
E.g. try this line: fi-en  voisin väittää että ukuritsat ja malinat on ainakin venäläistä alkuperää, voisin väittää että perunasta puhuvat kartoskana
Comment 4 Alexander Lohnau 2022-05-28 08:35:30 UTC
The issue seems that with the text and the wrap mode set to WordWrap the height of the displayLabel and height of the labelWrapper have a binding loop. 

I honestly have no idea how to fix that. In the help runner some texts are more than 3 lines long, but have explicit linebreaks with the styled text markup.
Comment 5 Bug Janitor Service 2022-05-29 10:17:16 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/milou/-/merge_requests/41
Comment 6 Ismael Asensio 2022-05-29 10:33:55 UTC
Git commit 19dc0f02871664b0d1211b0d17b6e4335870b838 by Ismael Asensio.
Committed on 29/05/2022 at 10:19.
Pushed by iasensio into branch 'master'.

ResultDelegate: Fix height binding loop on multiline

This binding loop was making krunner freeze when the
text expanded more than 3 lines

We shouldn't be setting the `height` on an item based on their
childrens height. Luckily, the Layout automatically calculates
this for us
FIXED-IN: 5.24.6

M  +3    -1    lib/qml/ResultDelegate.qml

https://invent.kde.org/plasma/milou/commit/19dc0f02871664b0d1211b0d17b6e4335870b838
Comment 7 Ismael Asensio 2022-05-29 10:34:55 UTC
Git commit 2a735f5f80a1c5b436685739af51ff19647a50fa by Ismael Asensio.
Committed on 29/05/2022 at 10:33.
Pushed by iasensio into branch 'Plasma/5.24'.

ResultDelegate: Fix height binding loop on multiline

This binding loop was making krunner freeze when the
text expanded more than 3 lines

We shouldn't be setting the `height` on an item based on their
childrens height. Luckily, the Layout automatically calculates
this for us
FIXED-IN: 5.24.6
(cherry picked from commit 19dc0f02871664b0d1211b0d17b6e4335870b838)

M  +3    -1    lib/qml/ResultDelegate.qml

https://invent.kde.org/plasma/milou/commit/2a735f5f80a1c5b436685739af51ff19647a50fa
Comment 8 Ismael Asensio 2022-05-29 10:36:01 UTC
Git commit 5fb4b00f494b004b1f3428df09640f6b0fbbbb83 by Ismael Asensio.
Committed on 29/05/2022 at 10:35.
Pushed by iasensio into branch 'Plasma/5.25'.

ResultDelegate: Fix height binding loop on multiline

This binding loop was making krunner freeze when the
text expanded more than 3 lines

We shouldn't be setting the `height` on an item based on their
childrens height. Luckily, the Layout automatically calculates
this for us
FIXED-IN: 5.24.6
(cherry picked from commit 19dc0f02871664b0d1211b0d17b6e4335870b838)

M  +3    -1    lib/qml/ResultDelegate.qml

https://invent.kde.org/plasma/milou/commit/5fb4b00f494b004b1f3428df09640f6b0fbbbb83
Comment 9 Björn Bidar (Thaodan) 2022-05-29 10:50:32 UTC
(In reply to Ismael Asensio from comment #6)
> Git commit 19dc0f02871664b0d1211b0d17b6e4335870b838 by Ismael Asensio.
> Committed on 29/05/2022 at 10:19.
> Pushed by iasensio into branch 'master'.
> 
> ResultDelegate: Fix height binding loop on multiline
> 
> This binding loop was making krunner freeze when the
> text expanded more than 3 lines
> 
> We shouldn't be setting the `height` on an item based on their
> childrens height. Luckily, the Layout automatically calculates
> this for us
> FIXED-IN: 5.24.6
> 
> M  +3    -1    lib/qml/ResultDelegate.qml
> 
> https://invent.kde.org/plasma/milou/commit/
> 19dc0f02871664b0d1211b0d17b6e4335870b838

I tried the commit, it is better  however krunner still looks up after the commit.
Comment 10 Ismael Asensio 2022-05-29 11:14:09 UTC
(In reply to Thaodan from comment #9)
> (In reply to Ismael Asensio from comment #6)
> > Git commit 19dc0f02871664b0d1211b0d17b6e4335870b838 by Ismael Asensio.
> > Committed on 29/05/2022 at 10:19.
> > Pushed by iasensio into branch 'master'.
> > 
> > ResultDelegate: Fix height binding loop on multiline
> > 
> > This binding loop was making krunner freeze when the
> > text expanded more than 3 lines
> > 
> > We shouldn't be setting the `height` on an item based on their
> > childrens height. Luckily, the Layout automatically calculates
> > this for us
> > FIXED-IN: 5.24.6
> > 
> > M  +3    -1    lib/qml/ResultDelegate.qml
> > 
> > https://invent.kde.org/plasma/milou/commit/
> > 19dc0f02871664b0d1211b0d17b6e4335870b838
> 
> I tried the commit, it is better  however krunner still looks up after the
> commit.

What do you mean that it  'looks up'? This is suppose to fix the freezing due to the binding loop
Comment 11 Björn Bidar (Thaodan) 2022-06-24 20:05:41 UTC
(In reply to Ismael Asensio from comment #10)
> (In reply to Thaodan from comment #9)
> > (In reply to Ismael Asensio from comment #6)
> > > Git commit 19dc0f02871664b0d1211b0d17b6e4335870b838 by Ismael Asensio.
> > > Committed on 29/05/2022 at 10:19.
> > > Pushed by iasensio into branch 'master'.
> > > 
> > > ResultDelegate: Fix height binding loop on multiline
> > > 
> > > This binding loop was making krunner freeze when the
> > > text expanded more than 3 lines
> > > 
> > > We shouldn't be setting the `height` on an item based on their
> > > childrens height. Luckily, the Layout automatically calculates
> > > this for us
> > > FIXED-IN: 5.24.6
> > > 
> > > M  +3    -1    lib/qml/ResultDelegate.qml
> > > 
> > > https://invent.kde.org/plasma/milou/commit/
> > > 19dc0f02871664b0d1211b0d17b6e4335870b838
> > 
> > I tried the commit, it is better  however krunner still looks up after the
> > commit.
> 
> What do you mean that it  'looks up'? This is suppose to fix the freezing
> due to the binding loop

When I just applied the commit above to the version mentioned in the bug report krunner still die freeze after three lines but now everything is fine.