From 177cdc45f05908f4c76cfebf92b2e1ad35640280ea31dff96f403df3ed5ff66f Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Thu, 12 Sep 2013 17:33:46 +0000 Subject: [PATCH] Accepting request 197864 from home:sumski:branches:Base:System Added upstream patch for 'dbus-daemon enters infinite loop' bug (bnc#782909, fdo#68945) OBS-URL: https://build.opensuse.org/request/show/197864 OBS-URL: https://build.opensuse.org/package/show/Base:System/dbus-1?expand=0&rev=125 --- ..._unref-avoid-infinite-loop-if-waitpi.patch | 49 +++++++++++++++++++ dbus-1-x11.changes | 6 +++ dbus-1-x11.spec | 3 ++ dbus-1.changes | 6 +++ dbus-1.spec | 3 ++ 5 files changed, 67 insertions(+) create mode 100644 0001-_dbus_babysitter_unref-avoid-infinite-loop-if-waitpi.patch diff --git a/0001-_dbus_babysitter_unref-avoid-infinite-loop-if-waitpi.patch b/0001-_dbus_babysitter_unref-avoid-infinite-loop-if-waitpi.patch new file mode 100644 index 0000000..2596b83 --- /dev/null +++ b/0001-_dbus_babysitter_unref-avoid-infinite-loop-if-waitpi.patch @@ -0,0 +1,49 @@ +From fc600b6a8f0dec5642b45c1026dee24c9adb9bc2 Mon Sep 17 00:00:00 2001 +From: Simon McVittie +Date: Wed, 4 Sep 2013 17:53:23 +0100 +Subject: [PATCH 1/3] _dbus_babysitter_unref: avoid infinite loop if waitpid() + returns EINTR + +If waitpid() failed with EINTR, we'd go back for another go, but +because ret is nonzero, we'd skip the waitpid() and just keep looping. + +Also avoid an unnecessary "goto" in favour of a proper loop, to make it +more clearly correct. + +Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68945 +Reviewed-by: Colin Walters +--- + dbus/dbus-spawn.c | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +diff --git a/dbus/dbus-spawn.c b/dbus/dbus-spawn.c +index ef00801..6e42f55 100644 +--- a/dbus/dbus-spawn.c ++++ b/dbus/dbus-spawn.c +@@ -308,15 +308,18 @@ _dbus_babysitter_unref (DBusBabysitter *sitter) + if (ret == 0) + kill (sitter->sitter_pid, SIGKILL); + +- again: + if (ret == 0) +- ret = waitpid (sitter->sitter_pid, &status, 0); ++ { ++ do ++ { ++ ret = waitpid (sitter->sitter_pid, &status, 0); ++ } ++ while (_DBUS_UNLIKELY (ret < 0 && errno == EINTR)); ++ } + + if (ret < 0) + { +- if (errno == EINTR) +- goto again; +- else if (errno == ECHILD) ++ if (errno == ECHILD) + _dbus_warn ("Babysitter process not available to be reaped; should not happen\n"); + else + _dbus_warn ("Unexpected error %d in waitpid() for babysitter: %s\n", +-- +1.8.4 + diff --git a/dbus-1-x11.changes b/dbus-1-x11.changes index cf035c3..55c2641 100644 --- a/dbus-1-x11.changes +++ b/dbus-1-x11.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sat Sep 7 20:17:40 UTC 2013 - hrvoje.senjan@gmail.com + +- Added 0001-_dbus_babysitter_unref-avoid-infinite-loop-if-waitpi.patch + from upstream for resolving fdo#68945, bnc#782909 + ------------------------------------------------------------------- Tue Jun 25 14:09:30 UTC 2013 - coolo@suse.com diff --git a/dbus-1-x11.spec b/dbus-1-x11.spec index 366ed99..1b648bc 100644 --- a/dbus-1-x11.spec +++ b/dbus-1-x11.spec @@ -62,6 +62,8 @@ Patch0: dbus-log-deny.patch Patch1: dbus-do-autolaunch.patch # PATCH-FIX-OPENSUSE hpj@suse.com bnc#802525 - Avoid clients hanging after move to /run Patch2: dbus-fall-back-to-old-run-directory.patch +# PATCH-FIX-UPSTREAM 0001-_dbus_babysitter_unref-avoid-infinite-loop-if-waitpi.patch (fdo#68945, bnc#782909) +Patch3: 0001-_dbus_babysitter_unref-avoid-infinite-loop-if-waitpi.patch %bcond_without selinux %if %{with selinux} BuildRequires: libselinux-devel @@ -118,6 +120,7 @@ bus daemon). %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 %build autoreconf -fi diff --git a/dbus-1.changes b/dbus-1.changes index cf035c3..55c2641 100644 --- a/dbus-1.changes +++ b/dbus-1.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sat Sep 7 20:17:40 UTC 2013 - hrvoje.senjan@gmail.com + +- Added 0001-_dbus_babysitter_unref-avoid-infinite-loop-if-waitpi.patch + from upstream for resolving fdo#68945, bnc#782909 + ------------------------------------------------------------------- Tue Jun 25 14:09:30 UTC 2013 - coolo@suse.com diff --git a/dbus-1.spec b/dbus-1.spec index 58cabe8..ee9b650 100644 --- a/dbus-1.spec +++ b/dbus-1.spec @@ -57,6 +57,8 @@ Patch0: dbus-log-deny.patch Patch1: dbus-do-autolaunch.patch # PATCH-FIX-OPENSUSE hpj@suse.com bnc#802525 - Avoid clients hanging after move to /run Patch2: dbus-fall-back-to-old-run-directory.patch +# PATCH-FIX-UPSTREAM 0001-_dbus_babysitter_unref-avoid-infinite-loop-if-waitpi.patch (fdo#68945, bnc#782909) +Patch3: 0001-_dbus_babysitter_unref-avoid-infinite-loop-if-waitpi.patch %bcond_without selinux %if %{with selinux} BuildRequires: libselinux-devel @@ -106,6 +108,7 @@ bus daemon). %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 %build autoreconf -fi