<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>457675</bug_id>
          
          <creation_ts>2022-08-09 12:28:17 +0000</creation_ts>
          <short_desc>AboutItem freezes with certain font/content combinations</short_desc>
          <delta_ts>2022-08-16 16:01:11 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>Frameworks and Libraries</classification>
          <product>frameworks-kirigami</product>
          <component>general</component>
          <version>Master</version>
          <rep_platform>Kubuntu</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Not decided</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Connor Carney">kbugs</reporter>
          <assigned_to name="kdelibs bugs">kdelibs-bugs-null</assigned_to>
          <cc>kbugs</cc>
    
    <cc>nate</cc>
    
    <cc>notmart</cc>
          
          <cf_commitlink>https://invent.kde.org/frameworks/kirigami/commit/2676403e803d84e4963fa4e5f3779012e001bf24</cf_commitlink>
          <cf_versionfixedin>5.98</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2144557</commentid>
    <comment_count>0</comment_count>
      <attachid>151192</attachid>
    <who name="Connor Carney">kbugs</who>
    <bug_when>2022-08-09 12:28:17 +0000</bug_when>
    <thetext>Created attachment 151192
qml example

SUMMARY
Certain font settings cause Kirigami::AboutItem (and AboutPage) to enter an infinite loop when the homepage URL is the widest thing in the form.

STEPS TO REPRODUCE
1. run the attached file with qmlscene

OBSERVED RESULT
Test application freezes with repeated warnings:

Qt Quick Layouts: Polish loop detected. Aborting after two iterations.
file:///home/connor/Projects/kde/usr/lib/x86_64-linux-gnu/qml/org/kde/kirigami.2/AboutItem.qml:150:5: QML FormLayout (parent or ancestor of QQuickLayoutAttached): Binding loop detected for property &quot;preferredHeight&quot;
file:///home/connor/Projects/kde/usr/lib/x86_64-linux-gnu/qml/org/kde/kirigami.2/AboutItem.qml:150:5: QML FormLayout (parent or ancestor of QQuickLayoutAttached): Binding loop detected for property &quot;preferredHeight&quot;
file:///home/connor/Projects/kde/usr/lib/x86_64-linux-gnu/qml/org/kde/kirigami.2/AboutItem.qml:150:5: QML FormLayout: Binding loop detected for property &quot;implicitHeight&quot;

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Kubuntu 20.04
KDE Plasma Version: 5.24
KDE Frameworks Version: master
Qt Version: 5.15.3</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2144641</commentid>
    <comment_count>1</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2022-08-09 19:26:58 +0000</bug_when>
    <thetext>Fixed in Frameworks 5.94; IIRC Kubuntu has 5.92, right?

*** This bug has been marked as a duplicate of bug 447958 ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2144682</commentid>
    <comment_count>2</comment_count>
    <who name="Connor Carney">kbugs</who>
    <bug_when>2022-08-09 21:59:54 +0000</bug_when>
    <thetext>This looks similar to that discover bug, but I don&apos;t think it&apos;s actually a duplicate: that one was working around binding loops with the scroll bar in AboutPage.  My attached example just has a raw AboutItem in a window with no pages or scroll bars in sight.  (It happens with AboutPage too, it&apos;s just not necessary to trigger the bug)

In any case, it&apos;s not fixed: I tested it against a source build of master, and I can also reproduce it in the current flatpak runtime e.g.

flatpak run --socket=x11 --device=dri --filesystem=home org.kde.Sdk
[📦 org.kde.Sdk ~]$ qmlscene about-page-freeze.qml</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2144827</commentid>
    <comment_count>3</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2022-08-10 14:33:35 +0000</bug_when>
    <thetext>Darn.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2144838</commentid>
    <comment_count>4</comment_count>
      <attachid>151226</attachid>
    <who name="Connor Carney">kbugs</who>
    <bug_when>2022-08-10 15:00:13 +0000</bug_when>
    <thetext>Created attachment 151226
formlayout-freeze

I dug into the AboutItem QML and it seems like all that&apos;s necessary to recreate the freeze is FormLayout+UrlButton.  I&apos;ve attached an even more minimal example.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2144887</commentid>
    <comment_count>5</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2022-08-10 17:40:30 +0000</bug_when>
    <thetext>What font and/or font size are necessary to reproduce the bug? That qml file doesn&apos;t freeze for me (Wayland, 200% scale, 11pt Noto Sans font).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2144908</commentid>
    <comment_count>6</comment_count>
    <who name="Connor Carney">kbugs</who>
    <bug_when>2022-08-10 17:57:10 +0000</bug_when>
    <thetext>That QML file explicitly sets Ubuntu 10 pt on the ApplicationWindow, so it shouldn&apos;t depend on your font settings, although it does depend on having that font installed.  I normally use kwin-wayland @ 100%, but it also happens in an X session.

It takes some trial and error to find specific combinations of font+size+text that trigger the issue for me, but when I find one it freezes consistently.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2144944</commentid>
    <comment_count>7</comment_count>
      <attachid>151234</attachid>
    <who name="Connor Carney">kbugs</who>
    <bug_when>2022-08-10 21:33:25 +0000</bug_when>
    <thetext>Created attachment 151234
formlayout-freeze-notosans

Here&apos;s a case that freezes for me with Noto Sans.

It&apos;s interesting that Noto Sans is much less prone to this issue than the Ubuntu font.  I could find cases for Ubuntu by just randomly typing stuff; with Noto Sans I had to actually write a script to find one.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2145160</commentid>
    <comment_count>8</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2022-08-11 17:25:13 +0000</bug_when>
    <thetext>Can confirm the freeze with that file.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2146143</commentid>
    <comment_count>9</comment_count>
    <who name="Nate Graham">nate</who>
    <bug_when>2022-08-16 16:01:11 +0000</bug_when>
    <thetext>Git commit 2676403e803d84e4963fa4e5f3779012e001bf24 by Nate Graham, on behalf of Connor Carney.
Committed on 16/08/2022 at 16:01.
Pushed by ngraham into branch &apos;master&apos;.

FormLayout: Explicitly round up implicit sizes

The implicit size of an item may not be an integral number of pixels.
GridLayout internally `ceil`s the implicitHeight and implicitWidth 
properties, but not the Layout.* attached properties, so we need to 
call Math.ceil ourselves whenever we set a Layout property based on the 
implicit size.

If a non-integral layout parameter has a fractional part &lt;0.5 then the 
layout engine will end up rounding it down to a pixel-aligned value that 
is not quite large enough to fit the contents (see included test case).

For word-wrapped text, the slightly-too-small size causes the text to
inappropriately wrap. If the implicit size of the wrapped text gets 
rounded differently it causes an infinite loop in the layout.

This changes the behavior of existing clients:  items with non-integral
implicit widths will sometimes lay out  exactly 1 pixel larger. This
won&apos;t be an actual problem for existing code. Implicit  sizes already
get rounded up about half the time and layouts should already  be
prepared for that.
FIXED-IN: 5.98

M  +1    -0    autotests/CMakeLists.txt
A  +50   -0    autotests/tst_formlayout.qml  *
M  +2    -2    src/controls/FormLayout.qml

The files marked with a * at the end have a non valid license. Please read: https://community.kde.org/Policies/Licensing_Policy and use the headers which are listed at that page.


https://invent.kde.org/frameworks/kirigami/commit/2676403e803d84e4963fa4e5f3779012e001bf24</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>151192</attachid>
            <date>2022-08-09 12:28:17 +0000</date>
            <delta_ts>2022-08-09 12:28:17 +0000</delta_ts>
            <desc>qml example</desc>
            <filename>about-page-freeze.qml</filename>
            <type>text/x-qml</type>
            <size>812</size>
            <attacher name="Connor Carney">kbugs</attacher>
            
              <data encoding="base64">aW1wb3J0IG9yZy5rZGUua2lyaWdhbWkgMi4xOQoKQXBwbGljYXRpb25XaW5kb3cgewogICAgZm9u
dC5mYW1pbHk6ICJVYnVudHUiCiAgICBmb250LnBvaW50U2l6ZTogMTAKICAgIEFib3V0SXRlbSB7
CiAgICAgICAgYW5jaG9ycy5maWxsOiBwYXJlbnQKICAgICAgICAKICAgICAgICBhYm91dERhdGE6
ICh7CiAgICAgICAgICAgIGRpc3BsYXlOYW1lOiAiU2hvcnQiLAogICAgICAgICAgICBwcm9kdWN0
TmFtZTogIlNob3J0IiwKICAgICAgICAgICAgY29tcG9uZW50TmFtZTogIlNob3J0IiwKICAgICAg
ICAgICAgc2hvcnREZXNjcmlwdGlvbjogIlNob3J0IiwKICAgICAgICAgICAgaG9tZXBhZ2U6ICJo
dHRwOi8vd3d3LmF1cmx0aGF0aXN0aGVsb25nZXN0dGhpbmdpbnRoZWZvcm0uY29tIiwKICAgICAg
ICAgICAgYnVnQWRkcmVzczogIiIsCiAgICAgICAgICAgIHZlcnNpb246ICIxLjAiLAogICAgICAg
ICAgICBvdGhlclRleHQ6ICIiLAogICAgICAgICAgICBhdXRob3JzOiBbXSwKICAgICAgICAgICAg
Y3JlZGl0czogW10sCiAgICAgICAgICAgIHRyYW5zbGF0b3JzOiBbXSwKICAgICAgICAgICAgbGlj
ZW5zZXM6IFsKICAgICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgICBuYW1lOiAiIiwK
ICAgICAgICAgICAgICAgICAgICB0ZXh0OiAiIiwKICAgICAgICAgICAgICAgICAgICBzcGR4OiAi
IgogICAgICAgICAgICAgICAgfQogICAgICAgICAgICBdLAogICAgICAgICAgICBjb3B5cmlnaHRT
dGF0ZW1lbnQ6ICLCqTIwMjIiLAogICAgICAgICAgICBkZXNrdG9wRmlsZU5hbWU6ICIiCiAgICAg
ICAgfSkKICAgIH0KfQo=
</data>

          </attachment>
          <attachment
              isobsolete="1"
              ispatch="0"
              isprivate="0"
          >
            <attachid>151226</attachid>
            <date>2022-08-10 15:00:13 +0000</date>
            <delta_ts>2022-08-10 21:33:25 +0000</delta_ts>
            <desc>formlayout-freeze</desc>
            <filename>formlayout-freeze.qml</filename>
            <type>text/x-qml</type>
            <size>512</size>
            <attacher name="Connor Carney">kbugs</attacher>
            
              <data encoding="base64">aW1wb3J0IFF0UXVpY2sgMi4xCmltcG9ydCBvcmcua2RlLmtpcmlnYW1pIDIuMTkKaW1wb3J0IFF0
UXVpY2suTGF5b3V0cyAxLjMKaW1wb3J0IFF0UXVpY2suQ29udHJvbHMgMi4xNSBhcyBRUUMyCgpR
UUMyLkFwcGxpY2F0aW9uV2luZG93IHsKICAgIGZvbnQuZmFtaWx5OiAiVWJ1bnR1IgogICAgZm9u
dC5wb2ludFNpemU6IDEwCiAgICAKICAgIC8vIG11c3QgYmUgbGFyZ2UgZW5vdWdoIHRvIGZpdCB0
aGUgZW50aXJlIHRleHQKICAgIHdpZHRoOiA0MDAKICAgIGhlaWdodDogNDAwCiAgICAKICAgIEZv
cm1MYXlvdXQgewogICAgICAgIGFuY2hvcnMuZmlsbDogcGFyZW50CiAgICAgICAgCiAgICAgICAg
VXJsQnV0dG9uIHsKICAgICAgICAgICAgdXJsOiAiaHR0cDovL3d3dy5hdXJsdGhhdGlzdGhlbG9u
Z2VzdHRoaW5naW50aGVmb3JtLmNvbSIKICAgICAgICAgICAgd3JhcE1vZGU6IFRleHQuV29yZFdy
YXAKICAgICAgICAgICAgTGF5b3V0LmZpbGxXaWR0aDogdHJ1ZQogICAgICAgIH0KICAgIH0KfQo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>151234</attachid>
            <date>2022-08-10 21:33:25 +0000</date>
            <delta_ts>2022-08-10 21:33:25 +0000</delta_ts>
            <desc>formlayout-freeze-notosans</desc>
            <filename>formlayout-freeze-notosans.qml</filename>
            <type>text/x-qml</type>
            <size>492</size>
            <attacher name="Connor Carney">kbugs</attacher>
            
              <data encoding="base64">aW1wb3J0IFF0UXVpY2sgMi4xCmltcG9ydCBvcmcua2RlLmtpcmlnYW1pIDIuMTkKaW1wb3J0IFF0
UXVpY2suTGF5b3V0cyAxLjMKaW1wb3J0IFF0UXVpY2suQ29udHJvbHMgMi4xNSBhcyBRUUMyCgpR
UUMyLkFwcGxpY2F0aW9uV2luZG93IHsKICAgIGZvbnQuZmFtaWx5OiAiTm90byBTYW5zIgogICAg
Zm9udC5wb2ludFNpemU6IDkKICAgIAogICAgLy8gbXVzdCBiZSBsYXJnZSBlbm91Z2ggdG8gZml0
IHRoZSBlbnRpcmUgdGV4dAogICAgd2lkdGg6IDYwMAogICAgaGVpZ2h0OiA0MDAKICAgIAogICAg
Rm9ybUxheW91dCB7CiAgICAgICAgYW5jaG9ycy5maWxsOiBwYXJlbnQKICAgICAgICAKICAgICAg
ICBVcmxCdXR0b24gewogICAgICAgICAgICB1cmw6ICJodHRwOi8vd3d3LnVNQnFQaEZZdWxvMS5j
b20iCiAgICAgICAgICAgIHdyYXBNb2RlOiBUZXh0LldvcmRXcmFwCiAgICAgICAgICAgIExheW91
dC5maWxsV2lkdGg6IHRydWUKICAgICAgICB9CiAgICB9Cn0K
</data>

          </attachment>
      

    </bug>

</bugzilla>