Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 676098 - gnome-base/gnome-control-center-3.26.2-r1 with x11-libs/gtk+-3.24.4: Infinite window width
Summary: gnome-base/gnome-control-center-3.26.2-r1 with x11-libs/gtk+-3.24.4: Infinite...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Linux Gnome Desktop Team
URL: https://gitlab.gnome.org/GNOME/gtk/me...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-23 10:27 UTC by Bernd Feige
Modified: 2019-02-07 11:26 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Try non-unicode GtkSwitch glyphs too (0001-Add-non-unicode-fallbacks-for-GtkSwitch-state-labels.patch,831 bytes, patch)
2019-01-23 12:24 UTC, Mart Raudsepp
Details | Diff
Screen shot in chromium (Bildschirmfoto von »2019-01-23 14-32-06«.png,86.36 KB, image/png)
2019-01-23 13:34 UTC, Bernd Feige
Details
Screen shot in firefox (Bildschirmfoto von »2019-01-23 14-33-58«.png,51.54 KB, image/png)
2019-01-23 13:37 UTC, Bernd Feige
Details
Screenshot of the GTK Inspector (Bildschirmfoto von »2019-01-23 15-41-37«.png,45.94 KB, image/png)
2019-01-23 14:43 UTC, Bernd Feige
Details
Screenshot with GtkSwitch'es (Archive Manager settings) (Bildschirmfoto von »2019-01-23 20-24-28«.png,24.82 KB, image/png)
2019-01-23 19:35 UTC, Bernd Feige
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bernd Feige 2019-01-23 10:27:27 UTC
With GDK_BACKEND=wayland we get:

(gnome-control-center:15499): Pango-CRITICAL **: 11:23:18.476: pango_layout_get_pixel_extents: assertion 'PANGO_IS_LAYOUT (layout)' failed
(gnome-control-center:27758): Gdk-WARNING **: 11:11:37.384: Native Windows wider than 65535 pixels are not supported
(gnome-control-center:27758): Gdk-CRITICAL **: 11:11:37.418: (gnome-control-center:30959): Gdk-CRITICAL **: 11:13:39.987: /var/tmp/portage/x11-libs/gtk+-3.24.4/work/gtk+-3.24.4/gdk/wayland/gdkdisplay-wayland.c:1321: Truncating shared memory file failed: Invalid argument

Followed by a segfault.

With GDK_BACKEND=x11 we get:

(gnome-control-center:5689): Pango-CRITICAL **: 11:17:51.242: pango_layout_get_pixel_extents: assertion 'PANGO_IS_LAYOUT (layout)' failed
(gnome-control-center:1963): Gdk-WARNING **: 11:15:45.701: Native Windows wider or taller than 32767 pixels are not supported
(gnome-control-center:1963): Gtk-WARNING **: 11:15:45.744: infinite surface size not supported

And then no window actually appears (in gnome shell an outline can sometimes be seen in overview mode).

Both issues happen about every second time gnome-control-center is started on one system and every time on another. The pango layout assertion failure occurs always however, even in cases the window finally shows.

Downgrading to x11-libs/gtk+-3.24.1 fixes it. I tried to recompile pango and gnome libraries but this did not help.
Comment 1 Mart Raudsepp gentoo-dev 2019-01-23 10:33:22 UTC
There's some sort of combobox placement fixes in 3.24.4 (and I think in the 3.24.3-r1 patchset too) for wayland; maybe those are bad - should discuss with upstream. Probably this isn't an issue with newer gnome-control-center, but gtk+ shouldn't be breaking apps regardless, unless they are relying on some undefined behaviour or something.

Do you have some long text comboboxes in there, that maybe most people don't?
Comment 2 Mart Raudsepp gentoo-dev 2019-01-23 10:34:02 UTC
To know where to look for upstream gnome-control-center past 3.26 to possibly backporting something, would be good to know at least in which panel you have such comboboxes, to find the relevant stuff quicker; if that's the problem in the first place, that is.
Comment 3 Bernd Feige 2019-01-23 11:15:27 UTC
Thanks for the quick response!

As I wrote, it's not a problem with wayland but apparently with the pango layout engine. Only the effect is slightly different (wayland segfaulting, X11 not showing a usable window). It's interesting that most other gnome programs work without problems. I tried several gnome games, gnome-disks, gnome-editor, gnome-calculator - no trace of a pango layout problem.

I don't understand what you mean by me having long text comboboxes in gnome-control-center. It appears to be a problem of the main window, which is subdivided in an icon/text bar on the left and an (originally empty) settings box on the right. I did suspect it to depend upon German umlauts being present in the left box but when I set LANG=C the problem persists despite the language being English in those instances in which the window becomes visible.
Comment 4 Bernd Feige 2019-01-23 11:34:09 UTC
I found one more program with problems: gnome-base/dconf-editor-3.28.0

Here I get the pango layout messages when using the software, usually not directly at startup. Within the /system/locale/region panel for example, the switch to use default values appeared empty at first and then, upon clicking became so large that it covered the whole window.

Same fix here: Downgrade to x11-libs/gtk+-3.24.1.
Comment 5 Mart Raudsepp gentoo-dev 2019-01-23 11:40:12 UTC
I meant that this went into 3.24.4, and it felt relevant to the problem (as it was about long text comboboxes):
https://gitlab.gnome.org/GNOME/gtk/merge_requests/514

But I guess it only would be something that affects things once you actually click on a combobox to open up the popup, so nevermind that.
Can you try with 3.24.3 without the patchset I had in -r1, and if that still fails, then also 3.24.2? So we can narrow down when things changed for the worse for you. I think blind copies of the ebuilds should work good enough for testing purposes.

I assume this isn't a problem on X11 at all, but only native wayland?
Comment 6 Bernd Feige 2019-01-23 12:11:13 UTC
I have now narrowed everything down specifically to GtkSwitch elements!
gnome-control-center's topmost entry here is 'bluetooth' with a switch in the upper right corner, which will cause the problem.

x11-libs/gtk+-3.24.2: Working fine
x11-libs/gtk+-3.24.3: All GtkSwitch'es show strange glyphs where the labels should be but no pango warnings
x11-libs/gtk+-3.24.4: Reported pango layout engine warnings, GtkSwitch not visible if the window shows at all

"I assume this isn't a problem on X11 at all, but only native wayland?":
No, as I wrote the problem occurs with both X11 and wayland renderers, only with different symptoms.
Comment 7 Mart Raudsepp gentoo-dev 2019-01-23 12:24:52 UTC
Created attachment 562570 [details, diff]
Try non-unicode GtkSwitch glyphs too

What happens if you apply this test patch to gtk+-3.24.4?

On that note, the file that it patches - do you see at least some of the glyphs in those arrays with gedit (not the ones that this patch add) or some such in tarball sources unpack?
Comment 8 Mart Raudsepp gentoo-dev 2019-01-23 12:26:44 UTC
(In reply to Mart Raudsepp from comment #7)
> Created attachment 562570 [details, diff] [details, diff]
> Try non-unicode GtkSwitch glyphs too
> 
> What happens if you apply this test patch to gtk+-3.24.4?
> 
> On that note, the file that it patches - do you see at least some of the
> glyphs in those arrays with gedit (not the ones that this patch add) or some
> such in tarball sources unpack?

Actually - looking at the patch in your browser should be sufficient too for that glyph check - do you see some visible glyphs in the quotes in front of the U+xxxx comments, or boxes with hex inside?
Comment 9 Mart Raudsepp gentoo-dev 2019-01-23 12:27:18 UTC
basically a screenshot of looking at the attached patch in firefox would be nice to see :)
Comment 10 Bernd Feige 2019-01-23 13:34:33 UTC
Created attachment 562580 [details]
Screen shot in chromium
Comment 11 Mart Raudsepp gentoo-dev 2019-01-23 13:37:50 UTC
Odd. This suggests the problem isn't what I'm thinking. Can you try the patch regardless?
Comment 12 Bernd Feige 2019-01-23 13:37:54 UTC
Created attachment 562582 [details]
Screen shot in firefox

So here are screenshots in both chromium and firefox.
At least the first glyph seems missing when seen in firefox.

But the patch fixes the error, thanks a lot!
Doesn't look particularly pretty but no more pango layout warnings or crashes.
Can you tell me why this error occurs now? In 3.24.2 these glyphs worked, didn't they? Should I add or enable specific fonts?
Comment 13 Mart Raudsepp gentoo-dev 2019-01-23 13:42:00 UTC
I don't see the primary glyhs either; just the fallback glyphs (the middle one after the patch). Same for you, but for me there are no crashes.
For me I end up using cantarell font; what font is used can be checked with the live GtkInspector, but fallbacks are enabled there, so if that font doesn't have it, then pango/freetype/fontconfig should find a font that does have it, just like you see in firefox.

The patch was to test if things work if some basic characters are used instead, which all fonts have. But that shouldn't have been the case for you, as you do see them in firefox. Maybe try in gedit or something, in case chromium and firefox are shipping extra fonts locally that have it, but your system doesn't have them.
Comment 14 Bernd Feige 2019-01-23 14:03:07 UTC
gedit displays the middle glyph fine as well...

There must have been a change in the logic how the glyphs are checked for acceptability, right? Within GTK+, and in a way that is fairly specific to GtkSwitch. After all, downgrading GTK+ without any change in Locale or installed fonts (or pango or fontconfig) fixes it.

Wait: In 3.24.2 the GtkSwitch'es normally show localised text labels instead of the fallback glyphs. That is they show ON/OFF or AN/AUS.

Maybe the fallback problem would actually hit most people, but because "ON/OFF" are normally used it doesn't show. Now why are the localised labels not used with 3.24.3 or 3.24.4 on this system?
Comment 15 Mart Raudsepp gentoo-dev 2019-01-23 14:23:26 UTC
3.24.2 has translatable ON/OFF, and many languages translated it to those fallback glyphs that you do see in firefox.

3.24.3 was going to switch to outright these glyphs you see, but instead it got merged with the new primary glyphs instead (IEC power control unicode glyphs from unicode 9.0 standard), so 3.24.3 for many people (mainly those that don't have noto fonts installed) saw the fallback hex glyphs instead, as no font provided the glyphs. 3.24.4 (and my 3.24.3-r1 patchset) added the fallback logic, which starts calling these pango_layout_* APIs to find out if the tried glyphs were found, or the fallback hex box used - and tries them in order in the arrays.
For you, it appears as if both upstream glyphs for each are found to fallback (even though they appear present in gedit and firefox), and then you probably hit some problems in the code not gracefully handling none of the glyphs found to be existing (which is why my patch "fixes" it - by using ASCII chars that all textual fonts should have).

Can you find out what font you are using there in GTK+, as it doesn't appear to be cantarell?

https://wiki.gnome.org/Projects/GTK/Inspector tells how to open up the gtk inspector.

With the top-left button ("Select an Object") choose a GtkSwitch; then in the inspector instead of "Miscellaneous", look at "CSS nodes"; a "switch" node should already be selected, then on the right there are CSS properties listed - what's the value for "font-family" for you, when it doesn't work?
Comment 16 Bernd Feige 2019-01-23 14:43:36 UTC
Created attachment 562592 [details]
Screenshot of the GTK Inspector

That's "Cantarell".

But look at the screen shot of the "Misc" window for the switch - that's also full of awkward glyphs...
Comment 17 Mart Raudsepp gentoo-dev 2019-01-23 14:47:59 UTC
and you do have cantarell installed?
Comment 18 Bernd Feige 2019-01-23 14:51:47 UTC
Yes, media-fonts/cantarell-0.111

qlist cantarell
/usr/share/fonts/cantarell/encodings.dir
/usr/share/fonts/cantarell/fonts.dir
/usr/share/fonts/cantarell/fonts.scale
/usr/share/fonts/cantarell/Cantarell-Thin.otf
/usr/share/fonts/cantarell/Cantarell-Regular.otf
/usr/share/fonts/cantarell/Cantarell-Light.otf
/usr/share/fonts/cantarell/Cantarell-ExtraBold.otf
/usr/share/fonts/cantarell/Cantarell-Bold.otf
/usr/share/doc/cantarell-0.111/NEWS.bz2
/usr/share/doc/cantarell-0.111/README.md.bz2
/usr/share/metainfo/org.gnome.cantarell.metainfo.xml
Comment 19 Mart Raudsepp gentoo-dev 2019-01-23 17:36:12 UTC
Can you please try the patch from upstream, that fallbacks to empty glyphs for now?

https://gitlab.gnome.org/GNOME/gtk/commit/6a4ce55a69c5ecbbf06bc905ac0bfdd04f64bb66.patch

Ideally reporting back on the upstream MR link (link I put in URL)

Looking closer, it seems like cantarell doesn't have either of the ON glyphs (the pipe-like one), only the secondary OFF circle.
So this would be an issue, when no other fonts ship them, but clearly for you something does, as you can see the glyphs in gedit. Why it behaves like that for you remains a mystery.
But that patch should at least solve it breaking things fully - to simply not have one or both of the glyphs instead, yet still see if it's ON or OFF at least based on the color and position.

A future gtk version may instead start using icons there, to not hit such issues.
Comment 20 Bernd Feige 2019-01-23 19:35:42 UTC
Created attachment 562620 [details]
Screenshot with GtkSwitch'es (Archive Manager settings)

That patch interestingly works as well and does not lead to empty labels but I/O labels (see shapshot). Dunno why.
Comment 21 Mart Raudsepp gentoo-dev 2019-01-23 20:16:42 UTC
Are you sure something else didn't change? Like in debugging having some fonts installed or something?
Or put otherwise - is it broken again if all you do is re-emerge gtk without any of the gtkswitch patches?
Comment 22 Bernd Feige 2019-01-24 09:52:38 UTC
I now checked back and forth - the unpatched x11-libs/gtk+-3.24.4 from the tree produces the error, and the version with the patch (empty strings) shows the apparently correct I/O symbols (the second entries). I was pretty sure that there must be an off-by-one error somewhere but checking gtkswitch.c it is clear that the first glyph with unknown_glyphs_count==0 is taken.

I'm on gcc 8.2.0, but this would be too "unsubtle" for a compiler bug at this stage I guess.

Are you sure that G_N_ELEMENTS (on_glyphs) really returns 2 and not 1 in the unpatched case? Should I check?
Comment 23 Mart Raudsepp gentoo-dev 2019-01-24 19:37:47 UTC
Sorry, I'm rather busy personally until Sunday or so. I suggest to take the discussion to the upstream merge request found in the URL field of this bug. Or maybe as it's merged now, a new issue.
Comment 24 Larry the Git Cow gentoo-dev 2019-02-07 11:26:23 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=218e1198f3988f587725d166430b16332ca47a5f

commit 218e1198f3988f587725d166430b16332ca47a5f
Author:     Mart Raudsepp <leio@gentoo.org>
AuthorDate: 2019-02-07 09:49:49 +0000
Commit:     Mart Raudsepp <leio@gentoo.org>
CommitDate: 2019-02-07 11:25:54 +0000

    x11-libs/gtk+: Further fallback fixes for GtkSwitch unicode glyphs
    
    Add a final fallback to no glyphs at all, so if the glyphs aren't
    found, it'll at least just not use any and not mess up layout and
    stomp on some memory, etc. The ON or OFF position should still be
    visible from color and position, at least, but for most people at
    least the secondary glyphs should be available.
    gtk+-3.22.5 changes all this to icons, but it also changes the
    default theme look, so we do this simpler patch for 3.22.4 for
    that to be the next stable candidate soon, instead of theme
    changing 3.22.5.
    
    Closes: https://bugs.gentoo.org/676098
    Package-Manager: Portage-2.3.52, Repoman-2.3.12
    Signed-off-by: Mart Raudsepp <leio@gentoo.org>

 .../files/3.24.4-more-gtkswitch-fallback.patch     | 34 ++++++++++++++++++++++
 .../{gtk+-3.24.4.ebuild => gtk+-3.24.4-r1.ebuild}  |  5 ++++
 2 files changed, 39 insertions(+)

Additionally, it has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=eea11c992629ffb545ef4f0561bb2282b5391117

commit eea11c992629ffb545ef4f0561bb2282b5391117
Author:     Mart Raudsepp <leio@gentoo.org>
AuthorDate: 2019-02-07 11:25:35 +0000
Commit:     Mart Raudsepp <leio@gentoo.org>
CommitDate: 2019-02-07 11:25:57 +0000

    x11-libs/gtk+: bump to 3.24.5; includes theme refreshes
    
    Uses icons for GtkSwitch now; though the default theme hides
    them with its refresh and redesign - but other themes will
    shown them from icon files now, instead of problematic
    unicode glyphs.
    
    Bug: https://bugs.gentoo.org/676098
    Package-Manager: Portage-2.3.52, Repoman-2.3.12
    Signed-off-by: Mart Raudsepp <leio@gentoo.org>

 x11-libs/gtk+/Manifest           |   2 +
 x11-libs/gtk+/gtk+-3.24.5.ebuild | 234 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 236 insertions(+)