backport 3 patches for crashes (1.8.4-3)

This commit is contained in:
Thomas Haller 2017-09-29 13:13:52 +02:00
parent de4dee2405
commit 11bdf5039f
4 changed files with 156 additions and 1 deletions

View File

@ -0,0 +1,34 @@
From 69f05c50c5b6ef960a8dcc5790bba4a916180a71 Mon Sep 17 00:00:00 2001
From: Iain Lane <iain@orangesquash.org.uk>
Date: Wed, 20 Sep 2017 15:01:41 +0100
Subject: [PATCH 1/3] manager: Disconnect from signals on the proxy when we're
disposed
We're calling a callback on a proxy after it has been disposed. We
should make sure to disconnect from it when we go away.
https://bugzilla.gnome.org/show_bug.cgi?id=787897
(cherry picked from commit 91fa202379b417f146c9b14be7b9b08d2dc83a78)
(cherry picked from commit 297862b0e9a6b08e506a9976f2e464f68ba398d2)
---
libnm/nm-manager.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libnm/nm-manager.c b/libnm/nm-manager.c
index d3df73375..294b9de18 100644
--- a/libnm/nm-manager.c
+++ b/libnm/nm-manager.c
@@ -192,8 +192,8 @@ init_dbus (NMObject *object)
property_info);
/* Permissions */
- g_signal_connect (priv->proxy, "check-permissions",
- G_CALLBACK (manager_recheck_permissions), object);
+ g_signal_connect_object (priv->proxy, "check-permissions",
+ G_CALLBACK (manager_recheck_permissions), object, 0);
}
static NMClientPermission
--
2.13.6

View File

@ -0,0 +1,78 @@
From b4f7cca1a3ee02d86ceec4fcea51a9ed349248b6 Mon Sep 17 00:00:00 2001
From: Iain Lane <iain@orangesquash.org.uk>
Date: Fri, 22 Sep 2017 11:48:05 +0100
Subject: [PATCH 2/3] {vpn,remote}-connection: disconnect signal handlers when
disposed
GNOME Settings 3.26 is crashing every time a VPN connection changed its
state. After some digging, a debug message was put on dispose, and this
issue was found:
libnm-Message: Object 0x55555633c070 disposed
libnm-Message: Object 0x55555633c730 disposed
libnm-Message: Object 0x55555633eae0 disposed
libnm-Message: Object 0x555556340a80 disposed
Thread 1 "gnome-control-c" received signal SIGSEGV, Segmentation fault.
g_type_check_instance_cast (type_instance=type_instance@entry=0x55555633c070, iface_type=93825006537856) at /.../glib/gobject/gtype.c:4057
4057 node = lookup_type_node_I (type_instance->g_class->g_type);
(gdb) bt
NetworkManager is calling callbacks on disposed objects, which leads to
crashes in clients (e.g. GNOME Settings).
Fix this issue by disconnecting signal handlers when the objects are
disposed.
Patch originally by Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
https://bugzilla.gnome.org/show_bug.cgi?id=787893
(cherry picked from commit b18896f77048399e7a8b6ddd4fa0961e603836fa)
(cherry picked from commit b363a6cfad5996b5436b6f7c1d9337068fcb4c99)
---
libnm/nm-remote-connection.c | 6 +++---
libnm/nm-vpn-connection.c | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/libnm/nm-remote-connection.c b/libnm/nm-remote-connection.c
index 0f7ea58ef..5cd42555f 100644
--- a/libnm/nm-remote-connection.c
+++ b/libnm/nm-remote-connection.c
@@ -641,7 +641,7 @@ init_sync (GInitable *initable, GCancellable *cancellable, GError **error)
GVariant *settings;
priv->proxy = NMDBUS_SETTINGS_CONNECTION (_nm_object_get_proxy (NM_OBJECT (initable), NM_DBUS_INTERFACE_SETTINGS_CONNECTION));
- g_signal_connect (priv->proxy, "updated", G_CALLBACK (updated_cb), initable);
+ g_signal_connect_object (priv->proxy, "updated", G_CALLBACK (updated_cb), initable, 0);
if (nmdbus_settings_connection_call_get_settings_sync (priv->proxy,
&settings,
@@ -730,8 +730,8 @@ init_async (GAsyncInitable *initable, int io_priority,
priv->proxy = NMDBUS_SETTINGS_CONNECTION (_nm_object_get_proxy (NM_OBJECT (initable),
NM_DBUS_INTERFACE_SETTINGS_CONNECTION));
- g_signal_connect (priv->proxy, "updated",
- G_CALLBACK (updated_cb), initable);
+ g_signal_connect_object (priv->proxy, "updated",
+ G_CALLBACK (updated_cb), initable, 0);
nmdbus_settings_connection_call_get_settings (NM_REMOTE_CONNECTION_GET_PRIVATE (init_data->initable)->proxy,
init_data->cancellable,
diff --git a/libnm/nm-vpn-connection.c b/libnm/nm-vpn-connection.c
index 814f45f0f..636c39507 100644
--- a/libnm/nm-vpn-connection.c
+++ b/libnm/nm-vpn-connection.c
@@ -144,8 +144,8 @@ init_dbus (NMObject *object)
property_info);
proxy = _nm_object_get_proxy (object, NM_DBUS_INTERFACE_VPN_CONNECTION);
- g_signal_connect (proxy, "vpn-state-changed",
- G_CALLBACK (vpn_state_changed_proxy), object);
+ g_signal_connect_object (proxy, "vpn-state-changed",
+ G_CALLBACK (vpn_state_changed_proxy), object, 0);
g_object_unref (proxy);
}
--
2.13.6

View File

@ -0,0 +1,31 @@
From fad0790a27d693d02c4b8404f9327608a838b8e6 Mon Sep 17 00:00:00 2001
From: Thomas Haller <thaller@redhat.com>
Date: Mon, 25 Sep 2017 12:15:30 +0200
Subject: [PATCH 3/3] cli: fix crash in interactive mode for "describe ."
https://bugzilla.gnome.org/show_bug.cgi?id=788104
(cherry picked from commit 54490be96d77ac2e34d247b58265dd393f5acba7)
(cherry picked from commit b18ff17d3d4495722745c701826880bf14672827)
---
clients/cli/connections.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/clients/cli/connections.c b/clients/cli/connections.c
index a93dc15fc..fac1227b7 100644
--- a/clients/cli/connections.c
+++ b/clients/cli/connections.c
@@ -7387,7 +7387,10 @@ editor_menu_main (NmCli *nmc, NMConnection *connection)
} else
ss = menu_ctx.curr_setting;
- if (descr_all) {
+ if (!ss) {
+ g_print (_("Error: no setting selected; valid are [%s]\n"), valid_settings_str);
+ g_print (_("use 'goto <setting>' first, or 'describe <setting>.<property>'\n"));
+ } else if (descr_all) {
/* Show description for all properties */
print_setting_description (ss);
} else {
--
2.13.6

View File

@ -9,7 +9,7 @@
%global epoch_version 1
%global rpm_version 1.8.4
%global real_version 1.8.4
%global release_version 2
%global release_version 3
%global snapshot %{nil}
%global git_sha %{nil}
@ -85,6 +85,9 @@ Source2: 00-server.conf
Source3: 20-connectivity-fedora.conf
#Patch1: 0001-some.patch
Patch1: 0001-manager-Disconnect-from-signals-on-the-proxy-when-we.patch
Patch2: 0002-vpn-remote-connection-disconnect-signal-handlers-whe.patch
Patch3: 0003-cli-fix-crash-in-interactive-mode-for-describe.patch
Requires(post): systemd
Requires(preun): systemd
@ -340,6 +343,9 @@ by nm-connection-editor and nm-applet in a non-graphical environment.
%setup -q -n NetworkManager-%{real_version}
#%patch1 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%build
%if %{with regen_docs}
@ -668,6 +674,12 @@ fi
%endif
%changelog
* Fri Sep 29 2017 Thomas Haller <thaller@redhat.com> - 1:1.8.4-3
- cli: fix crash in interactive mode for "describe ."
- libnm/{vpn,remote}-connection: disconnect signal handlers when disposed
- libnm/manager: disconnect from signals on the proxy when we're disposed
* Wed Sep 27 2017 Thomas Haller <thaller@redhat.com> - 1:1.8.4-2
- enable NetworkManager-wait-online.service on package upgrade (rh#1455704)