public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/gtk4] f44: Backport fix for GtkDragSource memory corruption (gtk#8191)
@ 2026-08-27  6:47 villasanticiro
  0 siblings, 0 replies; only message in thread
From: villasanticiro @ 2026-08-27  6:47 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/gtk4
            Branch : f44
            Commit : 7fcf0e2e16031455e04fe6b082b684c0bc15a777
            Author : villasanticiro <villasanticiro@gmail.com>
            Date   : 2026-08-26T13:30:21-03:00
            Stats  : +37/-0 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/gtk4/c/7fcf0e2e16031455e04fe6b082b684c0bc15a777?branch=f44

            Log:
            Backport fix for GtkDragSource memory corruption (gtk#8191)

Upstream commit 180d7ef4 (GTK 4.23.1, gtk!9913); backport to gtk-4-22
pending in gtk!10188. Fixes frequent nautilus crashes.

Resolves: rhbz#2524550

---
diff --git a/0002-dragsource-Fix-memory-corruption-due-to-uncancelled-source.patch b/0002-dragsource-Fix-memory-corruption-due-to-uncancelled-source.patch
new file mode 100644
index 0000000..018868a
--- /dev/null
+++ b/0002-dragsource-Fix-memory-corruption-due-to-uncancelled-source.patch
@@ -0,0 +1,33 @@
+From f022874b8974e60854a2d57d0f09e2d7c0f0af52 Mon Sep 17 00:00:00 2001
+From: Khalid Abu Shawarib <khalid.shawarib@gmail.com>
+Date: Wed, 6 May 2026 02:44:13 +0300
+Subject: [PATCH] dragsource: Fix memory corruption due to uncancelled source
+
+Drag begin was called multiple times before the timeout expired,
+overwriting the existing id and not be able to cancel it. This led to a
+hard to debug race condition that caused memory corruption and crashes.
+
+I've confirmed that crashes only occur if a GtkDragSource controller
+was present, and that this change stops crashes from happening.
+
+Fixes: #8191
+Part-of: <https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/9913>
+---
+ gtk/gtkdragsource.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/gtk/gtkdragsource.c b/gtk/gtkdragsource.c
+index 72a680e92a8..ce649fe083d 100644
+--- a/gtk/gtkdragsource.c
++++ b/gtk/gtkdragsource.c
+@@ -286,6 +286,7 @@ gtk_drag_source_begin (GtkGesture       *gesture,
+   GdkEventSequence *current;
+ 
+   current = gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));
++  g_clear_handle_id (&source->timeout_id, g_source_remove);
+   source->timeout_id = g_timeout_add (MIN_TIME_TO_DND, drag_timeout, source);
+ 
+   gtk_gesture_get_point (gesture, current, &source->start_x, &source->start_y);
+-- 
+GitLab
+

diff --git a/gtk4.spec b/gtk4.spec
index c5096b6..09c68e2 100644
--- a/gtk4.spec
+++ b/gtk4.spec
@@ -76,6 +76,10 @@ Source0:        https://download.gnome.org/sources/gtk/4.22/gtk-%{version}.tar.x
 # https://bugzilla.redhat.com/show_bug.cgi?id=2450986
 Patch:          0001-gtkapplication-wayland-null-check.patch
 
+# https://bugzilla.redhat.com/show_bug.cgi?id=2524550
+# https://gitlab.gnome.org/GNOME/gtk/-/issues/8191
+Patch:          0002-dragsource-Fix-memory-corruption-due-to-uncancelled-source.patch
+
 BuildRequires:  cups-devel
 BuildRequires:  desktop-file-utils
 BuildRequires:  docbook-style-xsl

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-27  6:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-27  6:47 [rpms/gtk4] f44: Backport fix for GtkDragSource memory corruption (gtk#8191) villasanticiro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox