From 41ee88b15cd97c1c0923d49641cedc2c8d158289 Mon Sep 17 00:00:00 2001 From: Jan Rybar Date: Wed, 15 Aug 2018 16:54:23 +0200 Subject: [PATCH] Spawned zombie subprocesses not reaped The child watch source attached to thread context didn't work due to the release of it's main loop and context outside. So we attach the source to the global default main context to make it work and avoid zombies. --- polkit.spec | 6 +++++- spawning-zombie-processes.patch | 13 +++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 spawning-zombie-processes.patch diff --git a/polkit.spec b/polkit.spec index 685d5a8..9658892 100644 --- a/polkit.spec +++ b/polkit.spec @@ -6,7 +6,7 @@ Summary: An authorization framework Name: polkit Version: 0.115 -Release: 3%{?dist} +Release: 4%{?dist} License: LGPLv2+ URL: http://www.freedesktop.org/wiki/Software/polkit Source0: http://www.freedesktop.org/software/polkit/releases/%{name}-%{version}.tar.gz @@ -16,6 +16,7 @@ Group: System Environment/Libraries Patch1: polkitagentlistener-freed-server-returned.patch Patch2: pkttyagent-rescue-target-error-msg.patch Patch3: bus-conn-msg-ssh.patch +Patch4: spawning-zombie-processes.patch BuildRequires: gcc-c++ @@ -181,6 +182,9 @@ exit 0 %{_libdir}/girepository-1.0/*.typelib %changelog +* Mon Aug 13 2018 Jan Rybar - 0.115-4 +- Leaking zombie processess started by rules + * Fri Jul 20 2018 Jan Rybar - 0.115-3 - Warning raised by polkit when disconnected from ssh - polkitagentlistener: resource leak - pointer to 'server' diff --git a/spawning-zombie-processes.patch b/spawning-zombie-processes.patch new file mode 100644 index 0000000..9cb1bf7 --- /dev/null +++ b/spawning-zombie-processes.patch @@ -0,0 +1,13 @@ +diff -up ./src/polkitbackend/polkitbackendjsauthority.cpp.ori ./src/polkitbackend/polkitbackendjsauthority.cpp +--- ./src/polkitbackend/polkitbackendjsauthority.cpp.ori 2018-04-03 22:57:57.000000000 +0200 ++++ ./src/polkitbackend/polkitbackendjsauthority.cpp 2018-08-14 16:47:48.416993302 +0200 +@@ -1595,7 +1595,8 @@ utils_spawn_data_free (UtilsSpawnData *d + (GSourceFunc) utils_child_watch_from_release_cb, + source, + (GDestroyNotify) g_source_destroy); +- g_source_attach (source, data->main_context); ++ /* attach source to the global default main context */ ++ g_source_attach (source, NULL); + g_source_unref (source); + data->child_pid = 0; + }