[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

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



Hi Simon,

Simon McVittie <smcv@debian.org> (2021-05-13):
> 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.

Yeah, that's what I had in mind.

> 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 fear this might be the case, yes…

> 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?

I haven't looked into that at all (at least yet)…

> > 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.

Based on the (perceived) unlikeliness that we might find a fix for GTK 2
(yeah, inertia… but it had been working so neatly for so long that
moving away from it just hadn't happened…), I've checked what would
happen with GTK 3 in cdebconf and cdebconf-gtk-terminal (I had forgotten
about cdebconf-gtk-entropy until writing this reply).

The installer seems to be working somewhat. I'm seeing strange things
regarding layout, regarding widget expansion (basically we have some
wasted vertical space). I'm also seeing a different behaviour regarding
the expose (GTK 2) vs. draw (GTK 3) event handling, meaning the banner
doesn't get repainted automatically; trying to do that on my own results
on it being painted over and over again (that happens with a
pango_cairo_show_layout), meaning “Mode de récupération” (fr) gets
rendered on top of “Rescue mode” (en) after selecting French. I wouldn't
call any of those two issues a blocker for 11.0 *if we were to go the
“Switch to GTK 3” route*.

I'm also seeing a warning when spawning a shell, that comes from
vte2.91; again, not a blocker. But exiting the shell leads to a crash,
and the installer gets restarted. The syslog has this:

    May 17 15:28:46 debconf: cdebconf_gtk (process:257): GLib - DEBUG: setenv()/putenv() are not thread-safe and should not be used after threads are created
    May 17 15:28:46 debconf: cdebconf_gtk (process:257): VTE - WARNING: (../src/vtepty.cc:670):bool _vte_pty_spawn_sync(VtePty*, const char*, const char* const*, const char* const*, GSpawnFlags, GSpawnChildSetupFunc, gpointer, GDestroyNotify, GPid*, int, GCancellable*, GError**): runtime check failed: ((spawn_flags & forbidden_spawn_flags()) == 0)
    May 17 15:31:14 kernel: [  218.924148] event_listener[263]: segfault at 0 ip 00007f2ecb006500 sp 00007f2ecaf12a98 error 4 in plugin-terminal.so[7f2ecb006000+2000]

I'm assuming the DEBUG/WARNING parts aren't too scary, and that the
segfault upon exit might be unrelated. I would call that a blocker for a
new release candidate of the installer since that would leave /target
mounted, possibly with other filesystems, and one couldn't re-enter the
shell.

I'll check what needs to happen with cdebconf-gtk-entropy, and whether
that might have a link with the segfault…

> 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?

It seems safe to ignore at the moment. (ISTR that was an optional
component that could be used on some devices, rather than something we
rely on in most cases, but I could be wrong.)


Cheers,
-- 
Cyril Brulebois (kibi@debian.org)            <https://debamax.com/>
D-I release manager -- Release team member -- Freelance Consultant

Attachment: signature.asc
Description: PGP signature


Reply to: