ports/189038: [PATCH] audio/musicpd: fix and update to 0.18.10

Martin Dieringer martin.dieringer at gmx.de
Sat Apr 26 21:40:00 UTC 2014


>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 at 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 <glib.h>
+ #endif
+ 
+@@ -48,7 +49,9 @@
+ #else
+ 	EventLoop &loop;
+ 
+-	std::atomic<guint> source_id;
++	Mutex mutex;
++
++	guint source_id;
+ #endif
+ 
+ public:
--- musicpd-0.18.10.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-ports-bugs mailing list