Public bug reported:
[ Impact ]
* On Ubuntu 24.04 X11 sessions, a GTK3 window can permanently stop
repainting after the X server sends a ConfigureNotify whose width or
height is outside Cairo's valid Xlib-surface range (0 through 32767).
* Input and the GLib main loop continue to work. In virt-viewer this looks
like a frozen guest display even though keyboard and mouse events still
reach the guest. Resizing the viewer appears to recover only because it
creates a new display configuration/window state; the affected Cairo
surface itself remains in a sticky CAIRO_STATUS_INVALID_SIZE error state.
* This is intermittent in normal use because the invalid ConfigureNotify is
produced during a transient display/window-management race. KVM/display
switching, monitor reconfiguration, scaling, and maximized virt-viewer
windows make it more visible. A deterministic X11 reproducer is attached.
* The proposed update backports the upstream GTK3 fix. It clamps the X11
Cairo surface dimensions before cairo_xlib_surface_set_size() is called,
preventing an invalid size from poisoning the surface.
[ Test Plan ]
All dependencies and packages in this plan come from Ubuntu. Run the test in
an X11-capable Noble VM; it uses Xvfb, so no physical display is required.
1. Install the test build/runtime dependencies:
sudo apt update
sudo apt install build-essential pkg-config libgtk-3-dev xvfb xdotool
x11-utils
2. Download the two attached files gtk-cairo-freeze-probe.c and
run-gtk-cairo-freeze-probe.sh into an empty directory, then build the probe:
cc -Wall -Wextra -O2 -o gtk-cairo-freeze-probe \
gtk-cairo-freeze-probe.c $(pkg-config --cflags --libs gtk+-3.0)
chmod +x run-gtk-cairo-freeze-probe.sh
3. With the current Noble-updates GTK version 3.24.41-4ubuntu1.3 installed,
run:
DISPLAY=:99 ./run-gtk-cairo-freeze-probe.sh buggy
The program creates a GTK drawing window, resizes it through X11 to
40000x600, restores it to 640x480, and continues queueing draws. The
current package must print a RESULT line in which tick_delta continues to
increase but draw_delta is 0 (or at most 1), followed by:
PASS reproduced sticky draw freeze while the main loop continued
4. Enable noble-proposed and install every binary package built by the
proposed gtk+3.0 source that is already installed on the test system.
Confirm that libgtk-3-0t64 reports the proposed version, then run:
DISPLAY=:99 ./run-gtk-cairo-freeze-probe.sh fixed
The proposed package must print a RESULT line with tick_delta at least 10
and draw_delta at least 5, followed by:
PASS drawing continued after restoring a valid window size
5. Perform common-use regression checks under X11:
* Open gtk3-demo and exercise ordinary window maximize, restore, and edge
resizing at several normal sizes.
* Open a virt-viewer console, confirm that its guest display updates and
that keyboard and pointer input work, then maximize, restore, and resize
it repeatedly.
* Confirm that no new GTK/Cairo drawing errors or crashes appear in the
journal during those checks.
6. Confirm package consistency:
sudo apt-get check
sudo dpkg --audit
[ Where problems could occur ]
* The changed function is in the GDK X11 backend and is used by every GTK3
application drawing through an Xlib Cairo surface. If the clamp were
applied incorrectly, X11 GTK3 applications could draw at the wrong size,
clip content, or fail to repaint during normal resizing. The ordinary
resize/maximize and virt-viewer smoke tests above exercise that risk.
* For a real X11 window dimension outside Cairo's representable range, GDK's
stored unscaled dimension is clamped to 32767. Such a surface cannot be
represented correctly by Cairo without the patch; the intended behavior is
bounded/clipped drawing instead of a permanent sticky error. Extreme
multi-monitor/scaling configurations are therefore the most relevant place
to watch for unexpected clipping or geometry behavior.
* gtk+3.0 builds a widely used library and many binary packages. A misbuild
could affect applications unrelated to virt-viewer. The source package's
full build test suite, symbol checks, archive builds on all supported
architectures, autopkgtests, and the common-use smoke tests mitigate this
packaging-wide risk. The patch does not add or remove API/ABI symbols.
[ Other Info ]
* Upstream fix:
https://gitlab.gnome.org/GNOME/gtk/-/commit/90390d6493c68fa41a95e3b82a78e1f942c79aeb
* Upstream explains that an out-of-range ConfigureNotify puts the Cairo
surface in CAIRO_STATUS_INVALID_SIZE. Cairo errors are sticky; without a
clipping region, GTK stops emitting draw signals while input/main-loop work
continues. The patch adds ten lines to clamp width and height to 0..32767.
* The development/future-release requirement is satisfied. Ubuntu 26.04
(Resolute) released with gtk+3.0 3.24.50-1ubuntu3, whose verified upstream
source already contains the exact clamp. No Resolute SRU is required.
* Local Noble validation before submission:
- the unmodified 3.24.41-4ubuntu1.3 package reproducibly produced
tick_delta=21 and draw_delta=0;
- a clean 3.24.41-4ubuntu1.3 build with only this upstream patch produced
tick_delta=20 and draw_delta=21;
- all 194 package build tests passed;
- all exported dynamic symbols and SONAME/NEEDED interfaces matched the
official package set;
- the complete offline downgrade rollback was exercised successfully.
* The local results above establish the reproducer and candidate behavior;
formal SRU verification must still be repeated using binaries from
noble-proposed as described in the Test Plan.
** Affects: gtk+3.0 (Ubuntu)
Importance: Undecided
Status: New
** Tags: noble sru
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2162853
Title:
[SRU] GTK3 X11 windows can permanently stop repainting after an
oversized ConfigureNotify
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gtk+3.0/+bug/2162853/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs