#998064 sm: fails to display text containing letter 'e' due to errors in libfreetype after upgrade

#998064#5
Date:
2021-10-29 10:14:56 UTC
From:
To:
Not sure if this issue is a bug in sm or freetype, please reassign.

Since the upgrade of freetype from 2.10.4+dfsg-1 to 2.11.0+dfsg-1,
whenever I attempt to display a string in sm containing letter e,
either via the command-line or by typing it into the text input,
the entire string does not display, I get errors in the terminal
and I cannot type any more input except for pressing Esc twice.

   $ sm e
   (sm:2529177): Gtk-WARNING **: 13:23:34.553: drawing failure for widget 'GtkDrawingArea': error occurred in libfreetype

   (sm:2529177): Gtk-WARNING **: 13:23:34.574: drawing failure for widget 'GtkBox': error occurred in libfreetype

   (sm:2529177): Gtk-WARNING **: 13:23:34.574: drawing failure for widget 'GtkWindow': error occurred in libfreetype

The problem stops happening if I downgrade freetype to 2.10.4+dfsg-1.

The problem happens with some fonts but not every single font.

The problem happens for rotating 180° or 360° but not 90° or 270°.

The problem happens with "e" "ea" "eaa" "eaaa" but not "eaaaa".

The problem happens for me with GNOME Wayland and if I force X11.

The problem only happens with my existing user account, not a new one.

The problem still happens if I delete my fontconfig cache files.

Folks on IRC say this does not happen in X11 KDE/MATE/Xfce/openbox/dwm
and Wayland/X11 GNOME. One person found it does happen in X11 LXQt.

When I compare the ltrace output, when the issue occurs, the function
pango_cairo_show_layout returns 40 while it returns 0 otherwise.

I tried recompiling freetype with support for the FT2_DEBUG environment
variable but I can't find the error in the log output.

#998064#10
Date:
2021-10-29 12:31:40 UTC
From:
To:
On 29 October 2021 at 18:14, Paul Wise wrote:
| Package: sm, libfreetype6
| Version: 0.26-1, 2.11.0+dfsg-1
| Severity: important
| File: /usr/games/sm
| Usertags: regression

Maintainer of _source package_ sm here: bad habit, 15 years ago binary
packages like r-cran-sm used their upstream source name as their Debian
source name.  You wanted _source package_ screen-message for binary package
sm.

Dirk

|
| Not sure if this issue is a bug in sm or freetype, please reassign.
|
| Since the upgrade of freetype from 2.10.4+dfsg-1 to 2.11.0+dfsg-1,
| whenever I attempt to display a string in sm containing letter e,
| either via the command-line or by typing it into the text input,
| the entire string does not display, I get errors in the terminal
| and I cannot type any more input except for pressing Esc twice.
|
|    $ sm e
|    (sm:2529177): Gtk-WARNING **: 13:23:34.553: drawing failure for widget 'GtkDrawingArea': error occurred in libfreetype
|
|    (sm:2529177): Gtk-WARNING **: 13:23:34.574: drawing failure for widget 'GtkBox': error occurred in libfreetype
|
|    (sm:2529177): Gtk-WARNING **: 13:23:34.574: drawing failure for widget 'GtkWindow': error occurred in libfreetype
|
| The problem stops happening if I downgrade freetype to 2.10.4+dfsg-1.
|
| The problem happens with some fonts but not every single font.
|
| The problem happens for rotating 180° or 360° but not 90° or 270°.
|
| The problem happens with "e" "ea" "eaa" "eaaa" but not "eaaaa".
|
| The problem happens for me with GNOME Wayland and if I force X11.
|
| The problem only happens with my existing user account, not a new one.
|
| The problem still happens if I delete my fontconfig cache files.
|
| Folks on IRC say this does not happen in X11 KDE/MATE/Xfce/openbox/dwm
| and Wayland/X11 GNOME. One person found it does happen in X11 LXQt.
|
| When I compare the ltrace output, when the issue occurs, the function
| pango_cairo_show_layout returns 40 while it returns 0 otherwise.
|
| I tried recompiling freetype with support for the FT2_DEBUG environment
| variable but I can't find the error in the log output.
|
| -- System Information:
| Debian Release: bookworm/sid
|   APT prefers testing-debug
|   APT policy: (900, 'testing-debug'), (900, 'testing'), (860, 'testing-proposed-updates-debug'), (860, 'testing-proposed-updates'), (800, 'unstable-debug'), (800, 'unstable'), (790, 'buildd-unstable'), (700, 'experimental-debug'), (700, 'experimental'), (690, 'buildd-experimental')
| Architecture: amd64 (x86_64)
|
| Kernel: Linux 5.14.0-3-amd64 (SMP w/8 CPU threads)
| Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
| Locale: LANG=en_AU.utf8, LC_CTYPE=en_AU.utf8 (charmap=UTF-8), LANGUAGE=en_AU:en
| Shell: /bin/sh linked to /bin/dash
| Init: systemd (via /run/systemd/system)
| LSM: AppArmor: enabled
|
| Versions of packages sm depends on:
| ii  libc6                2.32-4
| ii  libcairo2            1.16.0-5
| ii  libglib2.0-0         2.70.0-1+b1
| ii  libgtk-3-0           3.24.30-3
| ii  libpango-1.0-0       1.48.10+ds1-1
| ii  libpangocairo-1.0-0  1.48.10+ds1-1
|
| sm recommends no packages.
|
| sm suggests no packages.
|
| -- no debconf information
|
| Versions of packages libfreetype6 depends on:
| ii  libbrotli1   1.0.9-2+b2
| ii  libc6        2.32-4
| ii  libpng16-16  1.6.37-3
| ii  zlib1g       1:1.2.11.dfsg-2
|
| libfreetype6 recommends no packages.
|
| libfreetype6 suggests no packages.
|
| -- no debconf information
|
| --
| bye,
| pabs
|
| https://wiki.debian.org/PaulWise
|
| x[DELETED ATTACHMENT signature.asc, application/pgp-signature]

#998064#15
Date:
2021-10-29 12:31:40 UTC
From:
To:
On 29 October 2021 at 18:14, Paul Wise wrote:
| Package: sm, libfreetype6
| Version: 0.26-1, 2.11.0+dfsg-1
| Severity: important
| File: /usr/games/sm
| Usertags: regression

Maintainer of _source package_ sm here: bad habit, 15 years ago binary
packages like r-cran-sm used their upstream source name as their Debian
source name.  You wanted _source package_ screen-message for binary package
sm.

Dirk

|
| Not sure if this issue is a bug in sm or freetype, please reassign.
|
| Since the upgrade of freetype from 2.10.4+dfsg-1 to 2.11.0+dfsg-1,
| whenever I attempt to display a string in sm containing letter e,
| either via the command-line or by typing it into the text input,
| the entire string does not display, I get errors in the terminal
| and I cannot type any more input except for pressing Esc twice.
|
|    $ sm e
|    (sm:2529177): Gtk-WARNING **: 13:23:34.553: drawing failure for widget 'GtkDrawingArea': error occurred in libfreetype
|
|    (sm:2529177): Gtk-WARNING **: 13:23:34.574: drawing failure for widget 'GtkBox': error occurred in libfreetype
|
|    (sm:2529177): Gtk-WARNING **: 13:23:34.574: drawing failure for widget 'GtkWindow': error occurred in libfreetype
|
| The problem stops happening if I downgrade freetype to 2.10.4+dfsg-1.
|
| The problem happens with some fonts but not every single font.
|
| The problem happens for rotating 180° or 360° but not 90° or 270°.
|
| The problem happens with "e" "ea" "eaa" "eaaa" but not "eaaaa".
|
| The problem happens for me with GNOME Wayland and if I force X11.
|
| The problem only happens with my existing user account, not a new one.
|
| The problem still happens if I delete my fontconfig cache files.
|
| Folks on IRC say this does not happen in X11 KDE/MATE/Xfce/openbox/dwm
| and Wayland/X11 GNOME. One person found it does happen in X11 LXQt.
|
| When I compare the ltrace output, when the issue occurs, the function
| pango_cairo_show_layout returns 40 while it returns 0 otherwise.
|
| I tried recompiling freetype with support for the FT2_DEBUG environment
| variable but I can't find the error in the log output.
|
| -- System Information:
| Debian Release: bookworm/sid
|   APT prefers testing-debug
|   APT policy: (900, 'testing-debug'), (900, 'testing'), (860, 'testing-proposed-updates-debug'), (860, 'testing-proposed-updates'), (800, 'unstable-debug'), (800, 'unstable'), (790, 'buildd-unstable'), (700, 'experimental-debug'), (700, 'experimental'), (690, 'buildd-experimental')
| Architecture: amd64 (x86_64)
|
| Kernel: Linux 5.14.0-3-amd64 (SMP w/8 CPU threads)
| Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
| Locale: LANG=en_AU.utf8, LC_CTYPE=en_AU.utf8 (charmap=UTF-8), LANGUAGE=en_AU:en
| Shell: /bin/sh linked to /bin/dash
| Init: systemd (via /run/systemd/system)
| LSM: AppArmor: enabled
|
| Versions of packages sm depends on:
| ii  libc6                2.32-4
| ii  libcairo2            1.16.0-5
| ii  libglib2.0-0         2.70.0-1+b1
| ii  libgtk-3-0           3.24.30-3
| ii  libpango-1.0-0       1.48.10+ds1-1
| ii  libpangocairo-1.0-0  1.48.10+ds1-1
|
| sm recommends no packages.
|
| sm suggests no packages.
|
| -- no debconf information
|
| Versions of packages libfreetype6 depends on:
| ii  libbrotli1   1.0.9-2+b2
| ii  libc6        2.32-4
| ii  libpng16-16  1.6.37-3
| ii  zlib1g       1:1.2.11.dfsg-2
|
| libfreetype6 recommends no packages.
|
| libfreetype6 suggests no packages.
|
| -- no debconf information
|
| --
| bye,
| pabs
|
| https://wiki.debian.org/PaulWise
|
| x[DELETED ATTACHMENT signature.asc, application/pgp-signature]

#998064#20
Date:
2021-10-30 10:26:30 UTC
From:
To:
Hi Paul,

With which fonts are you seeing the problem?

I'm not seeing any issues or warnings using Cinnamon and X11 on Debian
Sid on these letter combinations or rotations.

I'll spin up a GNOME VM and report back.

#998064#25
Date:
2021-10-30 10:30:32 UTC
From:
To:
Lots of different ones, DejaVu Sans for example.

I figured out that this command causes the issue:

   $ gsettings set org.gnome.desktop.interface font-antialiasing rgba

and this command fixes the issue:

   $ gsettings set org.gnome.desktop.interface font-antialiasing grayscale

#998064#30
Date:
2021-10-31 10:08:21 UTC
From:
To:
also tested 'rgba' out of interest.

I didn't encounter any rendering issues with either value (note: I
restarted between test runs).

I also didn't get any terminal output with any combination of text or rotation.

I'll keep investigating. There's a few options to try yet.

#998064#35
Date:
2021-10-31 10:28:11 UTC
From:
To:
Thanks.

If it helps I'm not using a VM and I am using an Intel GPU.

If you have any idea how to trace the error with FT2_DEBUG,
I will be happy to recompile freetype and provide the logs.

#998064#40
Date:
2021-11-03 11:42:13 UTC
From:
To:
following macros:

#define FT_DEBUG_LEVEL_ERROR
#define FT_DEBUG_LEVEL_TRACE
#define FT_DEBUG_LOGGING
#define FT_CONFIG_OPTION_ERROR_STRINGS

Then just build as normal via sbuild, pbuilder etc. You'll need to
install libfreetype6 and libfreetype-dev.

As a starting point:
    FT2_DEBUG="any:7 -vt" <program>

You can also log the output to a file:
   FT_LOGGING_FILE="/tmp/path.log" or similar.

docs/DEBUG in the FreeType2 source package has more information.

Note that output might be limited if the upstream source does not use
the debug or tracing APIs.

#998064#45
Date:
2021-11-04 05:29:42 UTC
From:
To:
I've attached the results of this command for grayscale and rgba:

   env FT2_DEBUG="any:7 -vt" FT_LOGGING_FILE="log" sm e

I compared the result after stripping the timestamps from the logs
and I wasn't able to see any errors nor any indicator of a problem.