Bug#987587: libpango1.0-udeb: hangs the installer in various situations

Simon McVittie smcv at debian.org
Thu May 13 12:29:24 BST 2021


On Tue, 04 May 2021 at 15:47:03 +0200, Cyril Brulebois wrote:
> would it seem reasonable to add a hack in whatever would make sense
> (pango1.0, harfbuzz, and/or gtk+2.0), but only in the udeb build, so
> that we dodge the issue for Bullseye without impacting installed
> systems/deb packages? If git bisecting yields a prospective (set of)
> patch(es) of course…

Adding a udeb-specific hack in one of those packages seems reasonable,
*if* we can find a suitable hack.

pango1.0 just has one build shared between the udeb and the full .deb,
so if the hack goes there, a prerequisite would be to build it twice
(fairly straightforward, just annoying). gtk+2.0 and harfbuzz already
build twice, so it would be easy to add -DDEBIAN_INSTALLER to the udeb
build, or similar.

The problem is finding the right hack. I don't think bisecting Pango is
necessarily going to get you very far: if you arrive at the version/commit
where Pango switched from doing text layout internally to using Harfbuzz
for everything, then that'll be a dead end. Conditionally reverting the
switch from internal layout engines to Harfbuzz doesn't seem likely to
yield a reasonable patch - the internal layout engines were deleted about
2 years ago and the rest of the pango codebase has moved on since then.

I've added some printf debugging to GTK2 (attached) and it looks as
though the problem is that the layout code flaps between two different
pixel sizes for the same "line" of text (GTK calls it a "line" but
it's really more like a paragraph - it will be line-wrapped to fit the
available width). With the test-case of going back to language selection
and choosing Sinhala, which I've been using because it's an easy one
to reproduce:

May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: GtkTextLayout 0x560b7b142110: validating near anchor 0x7f28cd080e20 from 0px to 576px
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: anchor 0x7f28cd080e20 is in line 0
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: validating a subsequent line 0
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: line content: තේරූ භාෂාව සඳහා ස්ථාපකයේ පරිවර්තනය අසම්පූර්ණයි.
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: was 72x102px
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: now 73x119px
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: validating a subsequent line 1
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: line content:
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: was 0x16px
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: now 0x16px
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: validating a subsequent line 2
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: line content: මෙහි තේරුම සමහර සංවාද ඉංග්<200d>රීසියෙන් පෙනීමේ සැලකිය යුතු ඉඩක් ඇති බවයි.
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: was 66x153px
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: now 66x153px
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: validating a subsequent line 3
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: line content:
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: was 0x16px
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: now 0x16px
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: validating a subsequent line 4
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: line content: ඔබට විකල්ප භාෂාව පිළිබඳ හොඳ අවබෝධයක් නොමැති නම්, එක්කෝ වෙනස් භාෂාවක් තෝරා ගැනීම හෝ ස්ථාපනය නැවැත්වීමට නිර්දේශ කරයි.
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: was 72x289px
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: now 70x323px
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: Revalidated invalid lines from 0 to 4
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: Top of first line y=0
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: First line 0, y=0
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: Last line 4, y=627
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: Delta height 51
...
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: GtkTextLayout 0x560b7b142110: validating near anchor 0x7f28cd080e20 from 0px to 627px
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: anchor 0x7f28cd080e20 is in line 0
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: validating a subsequent line 0
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: line content: තේරූ භාෂාව සඳහා ස්ථාපකයේ පරිවර්තනය අසම්පූර්ණයි.
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: was 73x119px
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: now 72x102px
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: validating a subsequent line 1
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: line content:
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: was 0x16px
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: now 0x16px
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: validating a subsequent line 2
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: line content: මෙහි තේරුම සමහර සංවාද ඉංග්<200d>රීසියෙන් පෙනීමේ සැලකිය යුතු ඉඩක් ඇති බවයි.
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: was 66x153px
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: now 66x153px
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: validating a subsequent line 3
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: line content:
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: was 0x16px
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: now 0x16px
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: validating a subsequent line 4
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: line content: ඔබට විකල්ප භාෂාව පිළිබඳ හොඳ අවබෝධයක් නොමැති නම්, එක්කෝ වෙනස් භාෂාවක් තෝරා ගැනීම හෝ ස්ථාපනය නැවැත්වීමට නිර්දේශ කරයි.
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: was 70x323px
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: now 72x289px
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: Revalidated invalid lines from 0 to 4
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: Top of first line y=0
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: First line 0, y=0
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: Last line 4, y=576
May 13 10:24:18 debconf: cdebconf_gtk (process:4590): Gtk - DEBUG: IA__gtk_text_layout_validate_yrange: Delta height -51

Obviously I can't read Sinhala, but
"තේරූ භාෂාව සඳහා ස්ථාපකයේ පරිවර්තනය අසම්පූර්ණයි."
presumably ought to be one size or the other, if everything else (e.g.
font) is kept constant: it shouldn't flap between 73x119px and 72x102px
on consecutive layout runs. I think the next step is to trace into how GTK
is arriving at those sizes, and where the size flapping is taking place
(probably in GTK, Pango or Harfbuzz).

The given sizes also seem weird: the width is a lot less than I would have
expected, as though the text is getting wrapped one character per line or
something like that... perhaps if we managed to escape from this infinite
loop, GTK would allocate more width for the GtkTextView and the text would
get re-wrapped at a sensible width?

Another possible route to look at might be to force the GtkTextView to
fill the whole width of the window, so that a narrow layout is never
considered?

> ISTR you proposed then implemented changes to alleviate one of the
> blockers for GTK3 in d-i (vte vs. libstdc++ if memory serves), but I
> haven't managed to look at it during the bullseye cycle; we definitely
> should look into gtk3-ifying (perhaps gtk4-ifying, time flies) d-i at
> some point, but that's very likely bookworm material at this stage…

The steps to use GTK 3 in d-i would be:

- convert cdebconf-gtk-udeb from GTK 2 to GTK 3
- convert cdebconf-gtk-entropy from GTK 2 to GTK 3
- convert cdebconf-gtk-terminal from GTK 2 to GTK 3 and, simultaneously,
  from libvte9-udeb to libvte-2.91-0-udeb

The big blocker for libvte-2.91-0-udeb used to be that it's written in
C++, but I've switched it to be built with -static-libstdc++ so that we
don't need a libstdc++6-udeb (its public API/ABI is GLib-flavoured C,
only the internals are C++). The result is that libvte-2.91-0-udeb isn't
much larger than libvte9-udeb.

matchbox-keyboard-udeb also uses GTK 2 (#967624), but if it's a separate
GUI program then it doesn't *necessarily* have to move to GTK 3 at the
same time that cdebconf-gtk does. I'm also not sure whether it's actively
used for anything?

    smcv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-d-rules-Build-udeb-with-debug.patch
Type: text/x-diff
Size: 699 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-gnome-maintainers/attachments/20210513/67b2f89a/attachment-0006.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-gtkcontainer-Add-extra-debugging-for-987587.patch
Type: text/x-diff
Size: 19763 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-gnome-maintainers/attachments/20210513/67b2f89a/attachment-0007.patch>


More information about the pkg-gnome-maintainers mailing list