Marco Trevisan (Treviño) has proposed merging 
~3v1n0/ubuntu/+source/glib2.0:ubuntu/bionic+gsubprocess-fix into 
~ubuntu-desktop/ubuntu/+source/glib2.0:ubuntu/bionic.

Requested reviews:
  Ubuntu Desktop (ubuntu-desktop)
Related bugs:
  Bug #1789476 in glib2.0 (Ubuntu): "glib apps using GSubprocess communicate 
might crash on g_subprocess_communicate_cancelled"
  https://bugs.launchpad.net/ubuntu/+source/glib2.0/+bug/1789476

For more details, see:
https://code.launchpad.net/~3v1n0/ubuntu/+source/glib2.0/+git/glib2.0/+merge/354012
-- 
Your team Ubuntu Desktop is requested to review the proposed merge of 
~3v1n0/ubuntu/+source/glib2.0:ubuntu/bionic+gsubprocess-fix into 
~ubuntu-desktop/ubuntu/+source/glib2.0:ubuntu/bionic.
diff --git a/debian/changelog b/debian/changelog
index d5989ce..91afd50 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+glib2.0 (2.56.2-0ubuntu0.18.04.2) bionic; urgency=medium
+
+  * d/p/subprocess-Fix-communicate_cancelled-signature.patch:
+    - Fix crash on subprocess communicate cancellation (LP: #1789476)
+
+ -- Marco Trevisan (Treviño) <[email protected]>  Wed, 29 Aug 2018 18:21:34 -0500
+
 glib2.0 (2.56.2-0ubuntu0.18.04.1) bionic; urgency=medium
 
   * New upstream release (LP: #1789472, LP: #1764779)
diff --git a/debian/patches/series b/debian/patches/series
index 4f622de..2ffcbae 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -17,3 +17,4 @@ exp_git_default_per_desktop1.patch
 exp_git_default_per_desktop2.patch
 exp_git_default_per_desktop3.patch
 exp_git_default_per_desktop4.patch
+subprocess-Fix-communicate_cancelled-signature.patch
diff --git a/debian/patches/subprocess-Fix-communicate_cancelled-signature.patch b/debian/patches/subprocess-Fix-communicate_cancelled-signature.patch
new file mode 100644
index 0000000..1c6100e
--- /dev/null
+++ b/debian/patches/subprocess-Fix-communicate_cancelled-signature.patch
@@ -0,0 +1,43 @@
+From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <[email protected]>
+Date: Fri, 24 Aug 2018 06:05:03 +0200
+Subject: subprocess: Fix communicate_cancelled signature
+
+The source callback for a GCancellable should have the cancellable itself
+as first argument.
+This was not the case, and when this code was hit, we were instead trying
+to treat the pointer as a CommunicateState reference and thus wrongly
+deferencing it, causing a memory error and a crash.
+
+Origin: https://gitlab.gnome.org/GNOME/glib/merge_requests/278
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/glib2.0/+bug/1789476
+Applied-upstream: yes, 2.56.3
+
+---
+ gio/gsubprocess.c | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/gio/gsubprocess.c b/gio/gsubprocess.c
+index 31822e5..2ce2428 100644
+--- a/gio/gsubprocess.c
++++ b/gio/gsubprocess.c
+@@ -1528,7 +1528,8 @@ g_subprocess_communicate_made_progress (GObject      *source_object,
+ }
+ 
+ static gboolean
+-g_subprocess_communicate_cancelled (gpointer user_data)
++g_subprocess_communicate_cancelled (GCancellable *cancellable,
++                                    gpointer      user_data)
+ {
+   CommunicateState *state = user_data;
+ 
+@@ -1580,7 +1581,9 @@ g_subprocess_communicate_internal (GSubprocess         *subprocess,
+     {
+       state->cancellable_source = g_cancellable_source_new (cancellable);
+       /* No ref held here, but we unref the source from state's free function */
+-      g_source_set_callback (state->cancellable_source, g_subprocess_communicate_cancelled, state, NULL);
++      g_source_set_callback (state->cancellable_source,
++                             (GSourceFunc) g_subprocess_communicate_cancelled,
++                             state, NULL);
+       g_source_attach (state->cancellable_source, g_main_context_get_thread_default ());
+     }
+ 
-- 
ubuntu-desktop mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-desktop

Reply via email to