public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: villasanticiro <villasanticiro@gmail.com>
To: git-commits@fedoraproject.org
Subject: [rpms/gtk4] f44: Backport fix for GtkDragSource memory corruption (gtk#8191)
Date: Thu, 27 Aug 2026 06:47:41 GMT	[thread overview]
Message-ID: <178781326174.1.1985528418339381109.rpms-gtk4-7fcf0e2e1603@fedoraproject.org> (raw)

            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

                 reply	other threads:[~2026-08-27  6:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178781326174.1.1985528418339381109.rpms-gtk4-7fcf0e2e1603@fedoraproject.org \
    --to=villasanticiro@gmail.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox