Bug 171252 - net-p2p/bitcoin suffers a spinlock problem (fix included)
net-p2p/bitcoin suffers a spinlock problem (fix included)
Status: Closed FIXED
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s)
Latest
Any Any
: Normal Affects Only Me
Assigned To: Steve Wills
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-02 14:40 UTC by steven
Modified: 2012-09-04 21:50 UTC (History)
0 users

See Also:


Attachments
file.diff (535 bytes, patch)
2012-09-02 14:40 UTC, steven
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description steven 2012-09-02 14:40:08 UTC
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.

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:
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.
Comment 1 Steve Wills freebsd_committer 2012-09-04 20:58:58 UTC
Responsible Changed
From-To: freebsd-ports-bugs->swills

I'll take it.
Comment 2 dfilter freebsd_committer 2012-09-04 21:47:07 UTC
Author: swills
Date: Tue Sep  4 20:46:54 2012
New Revision: 303670
URL: http://svn.freebsd.org/changeset/ports/303670

Log:
  - Hopefully really fix the last high CPU usage case
  
  PR:		ports/171252
  Submitted by:	Steven Lee <steven@roothosts.com>

Added:
  head/net-p2p/bitcoin/files/patch-util.h   (contents, props changed)
Modified:
  head/net-p2p/bitcoin/Makefile

Modified: head/net-p2p/bitcoin/Makefile
==============================================================================
--- head/net-p2p/bitcoin/Makefile	Tue Sep  4 19:05:49 2012	(r303669)
+++ head/net-p2p/bitcoin/Makefile	Tue Sep  4 20:46:54 2012	(r303670)
@@ -7,7 +7,7 @@
 
 PORTNAME=	bitcoin
 PORTVERSION=	0.6.3
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	net-p2p finance
 
 MAINTAINER=	ports@FreeBSD.org

Added: head/net-p2p/bitcoin/files/patch-util.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-p2p/bitcoin/files/patch-util.h	Tue Sep  4 20:46:54 2012	(r303670)
@@ -0,0 +1,21 @@
+--- src/util.h.orig	2012-09-02 08:13:29.000000000 -0500
++++ 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)
+ {
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 3 Steve Wills freebsd_committer 2012-09-04 21:47:12 UTC
State Changed
From-To: open->closed

Committed. Thanks!