From mad@madpilot.net  Fri Oct 14 17:17:08 2011
Return-Path: <mad@madpilot.net>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 25081106564A
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 14 Oct 2011 17:17:08 +0000 (UTC)
	(envelope-from mad@madpilot.net)
Received: from megatron.madpilot.net (megatron.madpilot.net [88.149.173.206])
	by mx1.freebsd.org (Postfix) with ESMTP id BA19A8FC1B
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 14 Oct 2011 17:17:06 +0000 (UTC)
Received: from megatron.madpilot.net (localhost [127.0.0.1])
	by megatron.madpilot.net (Postfix) with ESMTP id 6D9081A62
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 14 Oct 2011 19:17:05 +0200 (CEST)
Received: from megatron.madpilot.net ([127.0.0.1])
	by megatron.madpilot.net (megatron.madpilot.net [127.0.0.1]) (amavisd-new, port 10026)
	with ESMTP id 8fzL3y8hhzBm for <FreeBSD-gnats-submit@freebsd.org>;
	Fri, 14 Oct 2011 19:17:03 +0200 (CEST)
Received: by megatron.madpilot.net (Postfix, from userid 1000)
	id 12FB51A61; Fri, 14 Oct 2011 19:17:03 +0200 (CEST)
Message-Id: <20111014171703.12FB51A61@megatron.madpilot.net>
Date: Fri, 14 Oct 2011 19:17:03 +0200 (CEST)
From: Guido Falsi <mad@madpilot.net>
Reply-To: Guido Falsi <mad@madpilot.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] audio/xmms2: workaround deadlock in waf (showing up on pointyhat too)
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         161591
>Category:       ports
>Synopsis:       [patch] audio/xmms2: workaround deadlock in waf (showing up on pointyhat too)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Oct 14 17:20:07 UTC 2011
>Closed-Date:    Sun Oct 23 16:07:06 UTC 2011
>Last-Modified:  Sun Oct 23 16:10:02 UTC 2011
>Originator:     Guido Falsi
>Release:        FreeBSD 8.2-STABLE amd64
>Organization:
none
>Environment:
System: FreeBSD megatron.madpilot.net 8.2-STABLE FreeBSD 8.2-STABLE #2: Sun Aug 7 19:54:54 CEST 2011 root@megatron.madpilot.net:/usr/obj/usr/src/sys/MEGATRON amd64

>Description:

This port was disabled on pointyhat due to runaway processes. I
tracked this down to a deadlock condition in some python multithreaded
code.

I "fixed" this by adding a small sleep (0.02 seconds, should not
slow down the build noticeabily). I'm aware this is not a proper
fix for a deadlock, and just makes it less probable. I'm not
experienced with multitheaded programming and have very superficial
knowledge of python, so could not find a better fix.

Please note that while this makes the deadlock condition not show
up on my machines I can't be sure it fixes the problem on pointyhat
until tested. I hope it does though.

added file:

files/patch-wafadmin-Task.py

>How-To-Repeat:

Trying to make the audio/xmms2 port on any 9.0-BETA machine. I only
tested this on SMP machines, maybe on single core machines this is
not going to show up.

>Fix:

diff -ruN xmms2.old/Makefile xmms2/Makefile
--- xmms2.old/Makefile	2011-10-14 17:10:46.792667942 +0200
+++ xmms2/Makefile	2011-10-14 17:11:06.081664680 +0200
@@ -63,10 +63,6 @@
 
 .include <bsd.port.pre.mk>
 
-.if defined(PACKAGE_BUILDING)
-BROKEN=		fails to build on pointyhat: runaway process
-.endif
-
 .if defined(XMMS2_SLAVE)
 EXCLUDE+=	--without-xmms2d
 
diff -ruN xmms2.old/files/patch-wafadmin-Task.py xmms2/files/patch-wafadmin-Task.py
--- xmms2.old/files/patch-wafadmin-Task.py	1970-01-01 01:00:00.000000000 +0100
+++ xmms2/files/patch-wafadmin-Task.py	2011-10-14 17:11:05.857663308 +0200
@@ -0,0 +1,18 @@
+--- wafadmin/Task.py.orig	2010-02-19 18:43:54.000000000 +0100
++++ wafadmin/Task.py	2011-10-14 14:36:57.000663231 +0200
+@@ -47,6 +47,7 @@
+ import Build, Runner, Utils, Node, Logs, Options
+ from Logs import debug, warn, error
+ from Constants import *
++import time
+ 
+ algotype = NORMAL
+ #algotype = JOBCONTROL
+@@ -406,6 +407,7 @@
+ 	def call_run(self):
+ 		if self.can_retrieve_cache():
+ 			return 0
++		time.sleep(0.02)
+ 		return self.run()
+ 
+ 	def run(self):
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: miwi 
State-Changed-When: Sun Oct 23 16:07:05 UTC 2011 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=161591 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/161591: commit references a PR
Date: Sun, 23 Oct 2011 16:07:07 +0000 (UTC)

 miwi        2011-10-23 16:06:54 UTC
 
   FreeBSD ports repository
 
   Modified files:
     audio/xmms2          Makefile 
   Added files:
     audio/xmms2/files    patch-wafadmin-Task.py 
   Log:
   - Fix build
   
   PR:             161591
   Submitted by:   Guido Falsi <mad@madpilot.net>
   
   Revision  Changes    Path
   1.65      +0 -4      ports/audio/xmms2/Makefile
   1.1       +18 -0     ports/audio/xmms2/files/patch-wafadmin-Task.py (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
