From owner-freebsd-ports-bugs@FreeBSD.ORG Sun Sep 2 13:40:09 2012 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53CE0106566B for ; Sun, 2 Sep 2012 13:40:09 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 131308FC14 for ; Sun, 2 Sep 2012 13:40:09 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q82De8hu002226 for ; Sun, 2 Sep 2012 13:40:08 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q82De8AX002213; Sun, 2 Sep 2012 13:40:08 GMT (envelope-from gnats) Resent-Date: Sun, 2 Sep 2012 13:40:08 GMT Resent-Message-Id: <201209021340.q82De8AX002213@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, Steven Lee Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95025106566C for ; Sun, 2 Sep 2012 13:36:51 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 8050F8FC12 for ; Sun, 2 Sep 2012 13:36:51 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q82Dapig020591 for ; Sun, 2 Sep 2012 13:36:51 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id q82DapEE020590; Sun, 2 Sep 2012 13:36:51 GMT (envelope-from nobody) Message-Id: <201209021336.q82DapEE020590@red.freebsd.org> Date: Sun, 2 Sep 2012 13:36:51 GMT From: Steven Lee To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/171252: net-p2p/bitcoin suffers a spinlock problem (fix included) X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Sep 2012 13:40:09 -0000 >Number: 171252 >Category: ports >Synopsis: net-p2p/bitcoin suffers a spinlock problem (fix included) >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Sep 02 13:40:08 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Steven Lee >Release: 9.0-RELEASE-p3 >Organization: RootHosts, Inc. >Environment: FreeBSD devel1.roothosts.com.local 9.0-RELEASE-p3 FreeBSD 9.0-RELEASE-p3 #6: Sun Aug 26 05:38:45 MDT 2012 steven@devel1.roothosts.com.local:/sys/amd64/compile/DEVEL amd64 >Description: net-p2p/bitcoin seems to have the same spinlock problem as it does on OSX. I think the bug is somewhere inside of boost, but I am unable to locate it. >How-To-Repeat: Install net-p2p/bitcoin (GUI or console version) and let it connect to the network. After ~20 minutes the process will consume 100% CPU and stay there even when the debug log indicates that the process isn't busy. >Fix: Found the fix in util.h. The bitcoin developers had included a fix for OSX that works on FreeBSD. Attached is a patch against the latest port to simply enable the fix. Patch attached with submission follows: --- work/bitcoin-bitcoin-6e0c5e3/src/util.h.orig 2012-09-02 08:13:29.000000000 -0500 +++ work/bitcoin-bitcoin-6e0c5e3/src/util.h 2012-09-02 08:14:08.000000000 -0500 @@ -290,8 +290,6 @@ LeaveCritical(); \ } -#ifdef MAC_OSX -// boost::interprocess::interprocess_semaphore seems to spinlock on OSX; prefer polling instead class CSemaphore { private: @@ -328,9 +326,6 @@ val++; } }; -#else -typedef boost::interprocess::interprocess_semaphore CSemaphore; -#endif inline std::string i64tostr(int64 n) { >Release-Note: >Audit-Trail: >Unformatted: