Merge ~3v1n0/ubuntu/+source/glib2.0:ubuntu/bionic+gsubprocess-fix into ~ubuntu-desktop/ubuntu/+source/glib2.0:ubuntu/bionic

Proposed by Marco Trevisan (Treviño)
Status: Rejected
Rejected by: Iain Lane
Proposed branch: ~3v1n0/ubuntu/+source/glib2.0:ubuntu/bionic+gsubprocess-fix
Merge into: ~ubuntu-desktop/ubuntu/+source/glib2.0:ubuntu/bionic
Diff against target: 73 lines (+51/-0)
3 files modified
debian/changelog (+7/-0)
debian/patches/series (+1/-0)
debian/patches/subprocess-Fix-communicate_cancelled-signature.patch (+43/-0)
Reviewer Review Type Date Requested Status
Ubuntu Desktop Pending
Review via email: mp+354012@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Iain Lane (laney) wrote :

thanks for the great work! :)

this is going to be in 2.56.4 though, so we'll get it via that route

😼

Unmerged commits

d37138b... by Marco Trevisan (Treviño)

Finalise changelog

78c1b38... by Marco Trevisan (Treviño)

d/p/subprocess-Fix-communicate_cancelled-signature.patch

Fix crash on subprocess communicate cancellation

Fixes LP: #1789476

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/debian/changelog b/debian/changelog
index d5989ce..91afd50 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
1glib2.0 (2.56.2-0ubuntu0.18.04.2) bionic; urgency=medium
2
3 * d/p/subprocess-Fix-communicate_cancelled-signature.patch:
4 - Fix crash on subprocess communicate cancellation (LP: #1789476)
5
6 -- Marco Trevisan (Treviño) <marco@ubuntu.com> Wed, 29 Aug 2018 18:21:34 -0500
7
1glib2.0 (2.56.2-0ubuntu0.18.04.1) bionic; urgency=medium8glib2.0 (2.56.2-0ubuntu0.18.04.1) bionic; urgency=medium
29
3 * New upstream release (LP: #1789472, LP: #1764779)10 * 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
17exp_git_default_per_desktop2.patch17exp_git_default_per_desktop2.patch
18exp_git_default_per_desktop3.patch18exp_git_default_per_desktop3.patch
19exp_git_default_per_desktop4.patch19exp_git_default_per_desktop4.patch
20subprocess-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
20new file mode 10064421new file mode 100644
index 0000000..1c6100e
--- /dev/null
+++ b/debian/patches/subprocess-Fix-communicate_cancelled-signature.patch
@@ -0,0 +1,43 @@
1From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail@3v1n0.net>
2Date: Fri, 24 Aug 2018 06:05:03 +0200
3Subject: subprocess: Fix communicate_cancelled signature
4
5The source callback for a GCancellable should have the cancellable itself
6as first argument.
7This was not the case, and when this code was hit, we were instead trying
8to treat the pointer as a CommunicateState reference and thus wrongly
9deferencing it, causing a memory error and a crash.
10
11Origin: https://gitlab.gnome.org/GNOME/glib/merge_requests/278
12Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/glib2.0/+bug/1789476
13Applied-upstream: yes, 2.56.3
14
15---
16 gio/gsubprocess.c | 7 +++++--
17 1 file changed, 5 insertions(+), 2 deletions(-)
18
19diff --git a/gio/gsubprocess.c b/gio/gsubprocess.c
20index 31822e5..2ce2428 100644
21--- a/gio/gsubprocess.c
22+++ b/gio/gsubprocess.c
23@@ -1528,7 +1528,8 @@ g_subprocess_communicate_made_progress (GObject *source_object,
24 }
25
26 static gboolean
27-g_subprocess_communicate_cancelled (gpointer user_data)
28+g_subprocess_communicate_cancelled (GCancellable *cancellable,
29+ gpointer user_data)
30 {
31 CommunicateState *state = user_data;
32
33@@ -1580,7 +1581,9 @@ g_subprocess_communicate_internal (GSubprocess *subprocess,
34 {
35 state->cancellable_source = g_cancellable_source_new (cancellable);
36 /* No ref held here, but we unref the source from state's free function */
37- g_source_set_callback (state->cancellable_source, g_subprocess_communicate_cancelled, state, NULL);
38+ g_source_set_callback (state->cancellable_source,
39+ (GSourceFunc) g_subprocess_communicate_cancelled,
40+ state, NULL);
41 g_source_attach (state->cancellable_source, g_main_context_get_thread_default ());
42 }
43

Subscribers

People subscribed via source and target branches