Hello community, here is the log from the commit of package synergy for openSUSE:Factory checked in at 2015-10-12 10:01:56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/synergy (Old) and /work/SRC/openSUSE:Factory/.synergy.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "synergy" Changes: -------- --- /work/SRC/openSUSE:Factory/synergy/synergy.changes 2015-09-08 17:46:52.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.synergy.new/synergy.changes 2015-10-12 10:01:57.000000000 +0200 @@ -1,0 +2,6 @@ +Sun Sep 27 20:31:53 UTC 2015 - [email protected] + +- prevent random hangs (bnc#944514, synergy #4735) + add-retry-to-condvarbase-wait-make-sure-stopwatch-is.patch + +------------------------------------------------------------------- New: ---- add-retry-to-condvarbase-wait-make-sure-stopwatch-is.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ synergy.spec ++++++ --- /var/tmp/diff_new_pack.A7zUfW/_old 2015-10-12 10:01:58.000000000 +0200 +++ /var/tmp/diff_new_pack.A7zUfW/_new 2015-10-12 10:01:58.000000000 +0200 @@ -35,6 +35,7 @@ Patch14: synergy-1.5.0-disable-version-check.patch Patch15: fix-bug-4735-don-t-leave-until-fillclipboard-s-all.patch Patch16: properly-lock-condvar-add-timeout-condition-to-prevent.patch +Patch17: add-retry-to-condvarbase-wait-make-sure-stopwatch-is.patch BuildRequires: avahi-devel BuildRequires: cmake BuildRequires: curl-devel @@ -85,6 +86,7 @@ %patch14 -p1 %patch15 -p1 %patch16 -p1 +%patch17 -p1 cp %{SOURCE2} . ++++++ add-retry-to-condvarbase-wait-make-sure-stopwatch-is.patch ++++++ >From 7d9c627aca4dbe9305c49e4c96d95d652024dc5c Mon Sep 17 00:00:00 2001 From: Nye Liu <[email protected]> Date: Fri, 11 Sep 2015 10:42:01 -0700 Subject: [PATCH] Add retry to CondVarBase wait(), make sure Stopwatch is started on construction (Issue #4735) * ArchMultithreadPosix::waitCondVar() returns every 100ms, so retry until we hit timeout. * Stopwatch constructor should be called with "false" (not "true") to make sure Stopwatch is actually running when instantiated. --- src/lib/client/Client.cpp | 9 +++++++-- src/lib/mt/CondVar.cpp | 14 ++++++++------ src/lib/platform/XWindowsClipboard.cpp | 5 +++-- 3 files changed, 18 insertions(+), 10 deletions(-) Index: synergy-1.7.4-stable/src/lib/client/Client.cpp =================================================================== --- synergy-1.7.4-stable.orig/src/lib/client/Client.cpp +++ synergy-1.7.4-stable/src/lib/client/Client.cpp @@ -283,14 +283,15 @@ Client::leave() &Client::sendClipboardThread, NULL)); // Bug #4735 - we can't leave() until fillClipboard()s all finish - Stopwatch timer(true); + Stopwatch timer(false); m_mutex->lock(); while (!m_condData) { - m_condVar->wait(timer, 0.5); - if (timer.getTime()>0.5) { - LOG((CLOG_DEBUG "timed out waiting for clipboard fill")); + if (!m_condVar->wait(timer, 0.5)) { + LOG((CLOG_WARN "timed out %fs waiting for clipboard fill", + (double) timer.getTime())); break; - } + } + LOG((CLOG_DEBUG1 "leave %fs elapsed", (double) timer.getTime())); } m_mutex->unlock(); @@ -790,6 +791,7 @@ Client::onFileRecieveCompleted() void Client::sendClipboardThread(void * data) { + Stopwatch timer(false); Clipboard clipboard[kClipboardEnd]; // fill clipboards that we own and that have changed for (ClipboardID id = 0; id < kClipboardEnd; ++id) { @@ -797,6 +799,7 @@ Client::sendClipboardThread(void * data) fillClipboard(id, &clipboard[id]); } } + LOG((CLOG_DEBUG1 "fill took %fs, signaling", (double) timer.getTime())); // signal that fill is done m_mutex->lock(); @@ -812,6 +815,7 @@ Client::sendClipboardThread(void * data) } m_sendClipboardThread = NULL; + LOG((CLOG_DEBUG1 "send took %fs", (double) timer.getTime())); } void Index: synergy-1.7.4-stable/src/lib/mt/CondVar.cpp =================================================================== --- synergy-1.7.4-stable.orig/src/lib/mt/CondVar.cpp +++ synergy-1.7.4-stable/src/lib/mt/CondVar.cpp @@ -63,13 +63,15 @@ CondVarBase::broadcast() bool CondVarBase::wait(Stopwatch& timer, double timeout) const { - // check timeout against timer - if (timeout >= 0.0) { - timeout -= timer.getTime(); - if (timeout < 0.0) - return false; + double remain = timeout-timer.getTime(); + // Some ARCH wait()s return prematurely, retry until really timed out + // In particular, ArchMultithreadPosix::waitCondVar() returns every 100ms + while (remain >= 0.0) { + if (wait(remain)) + return true; + remain = timeout - timer.getTime(); } - return wait(timeout); + return false; } bool Index: synergy-1.7.4-stable/src/lib/platform/XWindowsClipboard.cpp =================================================================== --- synergy-1.7.4-stable.orig/src/lib/platform/XWindowsClipboard.cpp +++ synergy-1.7.4-stable/src/lib/platform/XWindowsClipboard.cpp @@ -513,6 +513,7 @@ XWindowsClipboard::icccmFillCache() LOG((CLOG_DEBUG1 "selection doesn't support TARGETS")); data = ""; XWindowsUtil::appendAtomData(data, XA_STRING); + // return; // NTL } XWindowsUtil::convertAtomProperty(data); @@ -1317,7 +1318,7 @@ XWindowsClipboard::CICCCMGetClipboard::r // by badly behaved selection owners. XEvent xevent; std::vector<XEvent> events; - Stopwatch timeout(true); + Stopwatch timeout(false); // timer not stopped, not triggered static const double s_timeout = 0.25; // FIXME -- is this too short? bool noWait = false; while (!m_done && !m_failed) { @@ -1361,7 +1362,7 @@ XWindowsClipboard::CICCCMGetClipboard::r XSelectInput(display, m_requestor, attr.your_event_mask); // return success or failure - LOG((CLOG_DEBUG1 "request %s", m_failed ? "failed" : "succeeded")); + LOG((CLOG_DEBUG1 "request %s after %fs", m_failed ? "failed" : "succeeded", timeout.getTime())); return !m_failed; } ++++++ synergy-1.5.0-pthread.patch ++++++ --- /var/tmp/diff_new_pack.A7zUfW/_old 2015-10-12 10:01:58.000000000 +0200 +++ /var/tmp/diff_new_pack.A7zUfW/_new 2015-10-12 10:01:58.000000000 +0200 @@ -2,7 +2,7 @@ =================================================================== --- synergy-1.7.4-stable.orig/CMakeLists.txt +++ synergy-1.7.4-stable/CMakeLists.txt -@@ -151,6 +151,8 @@ if (UNIX) +@@ -153,6 +153,8 @@ if (UNIX) check_library_exists("pthread" pthread_create "" HAVE_PTHREAD) if (HAVE_PTHREAD) list(APPEND libs pthread)
