From owner-freebsd-ports-bugs@FreeBSD.ORG Sat Apr 26 21:40:00 2014 Return-Path: Delivered-To: freebsd-ports-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A93F1A0F for ; Sat, 26 Apr 2014 21:40:00 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8297D1829 for ; Sat, 26 Apr 2014 21:40:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s3QLe0xL080958 for ; Sat, 26 Apr 2014 21:40:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s3QLe0ED080957; Sat, 26 Apr 2014 21:40:00 GMT (envelope-from gnats) Resent-Date: Sat, 26 Apr 2014 21:40:00 GMT Resent-Message-Id: <201404262140.s3QLe0ED080957@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Martin Dieringer Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B834A8F7 for ; Sat, 26 Apr 2014 21:35:11 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) (using TLSv1.2 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5138F17FA for ; Sat, 26 Apr 2014 21:35:10 +0000 (UTC) Received: from thinkpad.nowhere.local ([93.220.120.162]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0Lqyi7-1X9wMm0Vff-00eh67 for ; Sat, 26 Apr 2014 23:35:03 +0200 Received: by thinkpad.nowhere.local (Postfix, from userid 1001) id 9694425586; Sat, 26 Apr 2014 23:35:02 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by thinkpad.nowhere.local (Postfix) with ESMTP id 93F6025585 for ; Sat, 26 Apr 2014 23:35:02 +0200 (CEST) Message-Id: Date: Sat, 26 Apr 2014 23:35:02 +0200 (CEST) From: Martin Dieringer To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/189038: [PATCH] audio/musicpd: fix and update to 0.18.10 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Martin Dieringer List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2014 21:40:00 -0000 >Number: 189038 >Category: ports >Synopsis: [PATCH] audio/musicpd: update to 0.18.10 >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Apr 26 21:40:00 UTC 2014 >Closed-Date: >Last-Modified: >Originator: Martin Dieringer >Release: FreeBSD 10.0-STABLE amd64 >Organization: >Environment: System: FreeBSD FreeBSD 10.0-STABLE #11 r264340: Sat Apr 19 15:46:03 CEST >Description: - Update to 0.18.10 - fix race condition in database update, see http://git.musicpd.org/cgit/master/mpd.git/commit/?h=v0.18.x&id=0efb67b51e0d9d34c65bbdbd9df567a8a991cc4c Port maintainer (crees@FreeBSD.org) is cc'd. Generated with FreeBSD Port Tools 1.02 (mode: update, diff: ports) >How-To-Repeat: - mpd hangs when updating database with removed/changed files - mpd hangs after 1 track played >Fix: apply this patch or wait for 0.18.11 --- musicpd-0.18.10.patch begins here --- diff -ruN /usr/ports/audio/musicpd/Makefile ./Makefile --- /usr/ports/audio/musicpd/Makefile 2014-03-24 19:13:10.000000000 +0100 +++ ./Makefile 2014-04-26 23:05:26.131613029 +0200 @@ -1,8 +1,7 @@ # $FreeBSD: head/audio/musicpd/Makefile 349047 2014-03-24 18:13:10Z crees $ PORTNAME= musicpd -PORTVERSION= 0.18.8 -PORTREVISION= 2 +PORTVERSION= 0.18.10 CATEGORIES= audio ipv6 MASTER_SITES= http://www.musicpd.org/download/mpd/${PORTVERSION:R}/ DISTNAME= mpd-${PORTVERSION} diff -ruN /usr/ports/audio/musicpd/distinfo ./distinfo --- /usr/ports/audio/musicpd/distinfo 2014-02-16 20:55:16.000000000 +0100 +++ ./distinfo 2014-04-26 23:05:29.836613465 +0200 @@ -1,2 +1,2 @@ -SHA256 (mpd-0.18.8.tar.xz) = 5366378e548fb77996cc33b0e15165ddd84f1e496bdd04616bd593aecdc26450 -SIZE (mpd-0.18.8.tar.xz) = 583812 +SHA256 (mpd-0.18.10.tar.xz) = dd506ca1d81b61ec10be6a3e7181869bd5adf0ffbb0a2e948f730826933f1c81 +SIZE (mpd-0.18.10.tar.xz) = 584312 diff -ruN /usr/ports/audio/musicpd/files/patch-src_event_DeferredMonitor.cxx ./files/patch-src_event_DeferredMonitor.cxx --- /usr/ports/audio/musicpd/files/patch-src_event_DeferredMonitor.cxx 1970-01-01 01:00:00.000000000 +0100 +++ ./files/patch-src_event_DeferredMonitor.cxx 2014-04-26 23:09:06.181619630 +0200 @@ -0,0 +1,51 @@ +--- src/event/DeferredMonitor.cxx.orig 2014-04-26 23:06:54.731618211 +0200 ++++ src/event/DeferredMonitor.cxx 2014-04-26 23:06:28.176617554 +0200 +@@ -27,9 +27,11 @@ + #ifdef USE_EPOLL + pending = false; + #else +- const auto id = source_id.exchange(0); +- if (id != 0) +- g_source_remove(id); ++ const ScopeLock protect(mutex); ++ if (source_id != 0) { ++ g_source_remove(source_id); ++ source_id = 0; ++ } + #endif + } + +@@ -40,10 +42,9 @@ + if (!pending.exchange(true)) + fd.Write(); + #else +- const unsigned id = loop.AddIdle(Callback, this); +- const auto old_id = source_id.exchange(id); +- if (old_id != 0) +- g_source_remove(old_id); ++ const ScopeLock protect(mutex); ++ if (source_id == 0) ++ source_id = loop.AddIdle(Callback, this); + #endif + } + +@@ -65,9 +66,16 @@ + void + DeferredMonitor::Run() + { +- const auto id = source_id.exchange(0); +- if (id != 0) +- RunDeferred(); ++ { ++ const ScopeLock protect(mutex); ++ if (source_id == 0) ++ /* cancelled */ ++ return; ++ ++ source_id = 0; ++ } ++ ++ RunDeferred(); + } + + gboolean diff -ruN /usr/ports/audio/musicpd/files/patch-src_event_DeferredMonitor.hxx ./files/patch-src_event_DeferredMonitor.hxx --- /usr/ports/audio/musicpd/files/patch-src_event_DeferredMonitor.hxx 1970-01-01 01:00:00.000000000 +0100 +++ ./files/patch-src_event_DeferredMonitor.hxx 2014-04-26 23:09:12.181614496 +0200 @@ -0,0 +1,21 @@ +--- src/event/DeferredMonitor.hxx.orig 2014-04-26 23:06:56.291627923 +0200 ++++ src/event/DeferredMonitor.hxx 2014-04-26 23:06:28.176617554 +0200 +@@ -27,6 +27,7 @@ + #include "SocketMonitor.hxx" + #include "WakeFD.hxx" + #else ++#include "thread/Mutex.hxx" + #include + #endif + +@@ -48,7 +49,9 @@ + #else + EventLoop &loop; + +- std::atomic source_id; ++ Mutex mutex; ++ ++ guint source_id; + #endif + + public: --- musicpd-0.18.10.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: