Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at
Bug 2071228 - Various GTK4 apps can trigger Gtk-CRITICAL "gtk_widget_measure: assertion 'for_size >= -1' failed" error in various circumstances
Summary: Various GTK4 apps can trigger Gtk-CRITICAL "gtk_widget_measure: assertion 'fo...
Alias: None
Product: Fedora
Classification: Fedora
Component: gtk4
Version: 36
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Kalev Lember
QA Contact: Fedora Extras Quality Assurance
Whiteboard: AcceptedBlocker
Depends On:
Blocks: F36FinalBlocker
TreeView+ depends on / blocked
Reported: 2022-04-02 09:40 UTC by Hedayat Vatankhah
Modified: 2023-09-15 01:23 UTC (History)
17 users (show)

Fixed In Version: gtk4-4.6.2-3.fc36
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2022-04-28 22:25:37 UTC
Type: Bug

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
GNOME Gitlab GNOME gtk issues 4517 0 None opened gtk_widget_measure errors when trying to open app details page 2022-04-26 16:11:47 UTC

Description Hedayat Vatankhah 2022-04-02 09:40:29 UTC
Description of problem:
I don't know if it is a gnome-shell bug, or related to some other components (gtk?). Anyway one of the easiest ways to reproduce this bug is using gnome-text-editor. 

Also note that this bug doesn't happen if only gnome-text-editor is being run under fa_IR locale; you should log in to Gnome in fa_IR locale. Also happens in settings app. 

If you open gnome text editor, and print some chars so that it'll go in 'modified' state, and then try to close gnome-text-editor, it hangs (when it is supposed to ask if I want to save my changes). And it repeatedly prints the following error in the logs:

Gtk-CRITICAL **: 13:52:43.425: gtk_widget_measure: assertion 'for_size >= -1' failed

The same error happens if I go to gnome settings->keyboard and click the last box (keyboard shortcuts). 

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Select "Persian" language in gnome settings
2. Logout and login again
3. Run gnome text editor
4. print a few chars
5. Try to close gnome text editor window

Actual results:
Gnome text editor hangs, and you'll need to force-kill it. You see following error in logs:
Gtk-CRITICAL **: 13:52:43.425: gtk_widget_measure: assertion 'for_size >= -1' failed

Expected results:
Should show if I want to save or discard changes and then close normally.

Additional info:
Another reproduction: Open gnome settings, go to keyboard settings (صفحه کلید) and then click the last box to open keyboard shortcut settings.

Comment 1 Fedora Blocker Bugs Application 2022-04-26 08:44:37 UTC
Proposed as a Freeze Exception for 36-final by Fedora user hedayat using the blocker tracking app because:

 This bug causes some basic functionality to freeze in at least one locale (I'd guess it can happen in other locales too): text editor will freeze on closing when a new file is being edited; and clicking in at least one section of the gnome settings app will make it freeze completely.

Comment 2 Ben Cotton 2022-04-26 13:15:50 UTC
Proposing as a blocker. This sounds like a conditional violation of the default application functionality criterion:

Comment 3 Ben Cotton 2022-04-26 13:58:52 UTC
I tried to reproduce the Gnome Text Editor behavior with no luck (maybe because my gtk and gnome-shell packages are slightly newer?). However, I can replicate the keyboard shortcut settings behavior.

Comment 4 Michael Catanzaro 2022-04-26 14:03:39 UTC
(In reply to Ben Cotton from comment #3)
> I tried to reproduce the Gnome Text Editor behavior with no luck (maybe
> because my gtk and gnome-shell packages are slightly newer?).

Maybe depends on window size.

Comment 5 Ben Cotton 2022-04-26 14:14:36 UTC
So far I've only been able to replicate the keyboard shortcut settings hang with Persian. English (US), French, German, and Czech all work as expected. Chinese (Mandarin) does as well, but most of the strings were untranslated, so I'm not sure if that's a reliable indicator.

Comment 6 Kamil Páral 2022-04-26 14:28:52 UTC
With current stable package versions, I'm unable to replicate any of aforementioned two issues under the fa_IR locale.


Hedayat, can you update to latest packages and try again?

Comment 7 Jens Petersen 2022-04-26 14:38:59 UTC
I also don't know how to reproduce this (with F36 RC1.1).

Does anyone know of a corresponding upstream issue.

Comment 8 Ondřej Míchal 2022-04-26 14:40:09 UTC
Could this be related to

Comment 9 Adam Williamson 2022-04-26 15:23:24 UTC
Seems likely, yeah. We did run into that earlier in the cycle with GNOME Software; digging into the upstream issues and downstream builds, it looks like we backported a GNOME Software-specific workaround:

but we did not adopt any fix/workaround on the GTK side yet.

GNOME folks - Matthias, Michael - how do you feel about this issue, both this specific manifestation of it and the general concern that there may still be other cases of it lurking outside of the GNOME Software one we worked around?

Comment 10 Adam Williamson 2022-04-26 16:09:11 UTC
Hey, this is random - another weird bug I happened to see on my new laptop is...*this bug*.

If I boot F36 RC1 Workstation Live on it, *do not* connect to wifi, and try to run gnome-control-center, it never launches. Run from a console I see this same "for_size >= -1 failed" error (at "gnome-control-center:3900"). If I connect to the wifi, then g-c-c launches fine. The first pane it shows is the WiFi one, so presumably when I have no wifi connections that pane does something that triggers the problem.

The laptop has a 1920x1200 internal display.

Comment 11 Michael Catanzaro 2022-04-26 16:16:49 UTC
The best person to ask is Benjamin (Company), who I see you're discussing this with already in

Comment 12 Adam Williamson 2022-04-26 18:12:18 UTC
Here's Benjamin's proposed workaround:

Here's a scratch build with Benjamin's proposed workaround:

Can folks who are able to reproduce this please test the scratch build and see how it behaves? Our expectation is that it should prevent apps from outright hanging, but the affected elements will likely appear a bit wrong - show up in the wrong place, overlap other elements, or be entirely off-screen.

Comment 13 Adam Williamson 2022-04-26 18:25:14 UTC
Good news, the workaround does work for my gnome-control-center case. The expected warning message appears - the specific values it gives are "reports a minimum width of 18, but minimum width for height of 1048576 is 26". I don't see anything obviously overlapping or out of place - I guess the values imply a difference of 8 pixels which would be a bit hard to spot.

Comment 14 Fedora Update System 2022-04-26 19:05:18 UTC
FEDORA-2022-a25fbbc152 has been submitted as an update to Fedora 36.

Comment 15 Adam Williamson 2022-04-26 20:56:14 UTC
+5 in , marking accepted blocker. Note, this could still potentially be waived as a late blocker; we'll discuss that on Thursday at the Go/No-Go meeting. I will request an RC2 with the fix, and we can decide which to ship on Thursday (assuming no other blockers).

Comment 16 Hedayat Vatankhah 2022-04-26 21:06:18 UTC
Yeah, I confirm that the proposed workaround fixes my problems without any apparent UI issues.

Comment 17 Fedora Update System 2022-04-26 22:02:03 UTC
FEDORA-2022-a25fbbc152 has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-a25fbbc152`
You can provide feedback for this update here:

See also for more information on how to test updates.

Comment 18 Adam Williamson 2022-04-26 23:00:44 UTC
Thanks, Hedayat - marking VERIFIED, then. Could you give the update some karma too?

Comment 19 Geraldo Simião 2022-04-27 03:03:41 UTC
(In reply to Adam Williamson from comment #18)
> Thanks, Hedayat - marking VERIFIED, then. Could you give the update some
> karma too?

Tested now on VM, with persian language. Update is working fine.

Comment 20 Hedayat Vatankhah 2022-04-27 07:38:44 UTC
Sorry for being somewhat late, but I added my karma. 

Thanks for all the work everybody. :)

And sorry for not raising the issue's visibility sooner; I thought filling the bug should make it visible enough :(

Comment 21 Adam Williamson 2022-04-27 15:31:00 UTC
That's quite OK, we actually knew about it before from the GNOME Software case anyway; it just sort of fell off my radar that the general issue still existed after we worked around the known gnome-software trigger :|

Comment 22 Fedora Update System 2022-04-28 22:25:37 UTC
FEDORA-2022-a25fbbc152 has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 23 Red Hat Bugzilla 2023-09-15 01:23:03 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 500 days

Note You need to log in before you can comment on or make changes to this bug.