Bug 95152 - [PATCH] net-p2p/btqueue file reads are extremely slow on FreeBSD 4.x
Summary: [PATCH] net-p2p/btqueue file reads are extremely slow on FreeBSD 4.x
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-31 14:10 UTC by Sven Berkvens-Matthijsse
Modified: 2006-04-29 18:48 UTC (History)
0 users

See Also:


Attachments
file.diff (368 bytes, patch)
2006-03-31 14:10 UTC, Sven Berkvens-Matthijsse
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Berkvens-Matthijsse 2006-03-31 14:10:18 UTC
	The port net-p2p/btqueue exhibits extremely slow file reads when
	rechecking files for hash correctness and also in other situations.
	This is due to a broken libc on FreeBSD 4.x, that does unbuffered
	reads PER BYTE instead of filling a given buffer with one read call.

Fix: The following patch, when installed as
	/usr/ports/net-p2p/btqueue/files/patch-BitTorrent::defaultargs.py
	will solve the problem:
How-To-Repeat: 	Install BTQueue on FreeBSD 4.x and try to check existing torrents.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2006-03-31 14:12:14 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback
Comment 2 Stefan Walter 2006-04-02 22:14:00 UTC
Hi,

I don't have a 4.x machine to test this any more, but if the patch solves
the problem on 4.x, I don't mind adding it to the port, of course. I'd
just like to pull it in conditionally, i.e. only when the system really is
older than 5.x.

I'm a bit busy at the moment, but I hope I can send a patch tomorrow.

Regards,
Stefan
Comment 3 Stefan Walter 2006-04-03 14:17:42 UTC
Please commit the following patch. It unconditionally enables the libc
workaround for 4.x systems.

Regards,
Stefan

Index: Makefile
===================================================================
RCS file: /storage/cvs/FreeBSD/ports/net-p2p/btqueue/Makefile,v
retrieving revision 1.10
diff -u -r1.10 Makefile
--- Makefile	26 Mar 2006 20:20:34 -0000	1.10
+++ Makefile	3 Apr 2006 13:13:35 -0000
@@ -28,6 +28,11 @@
 
 .include <bsd.port.pre.mk>
 
+# Enable workaround for bad libc in FreeBSD 4.x
+.if ${OSVERSION} < 500000
+EXTRA_PATCHES=	${FILESDIR}/FBSD4-patch-BitTorrent_defaultargs.py
+.endif
+
 .if defined(WITH_PYXML)
 RUN_DEPENDS+=	${PYXML}
 .endif
Index: files/FBSD4-patch-BitTorrent_defaultargs.py
===================================================================
RCS file: files/FBSD4-patch-BitTorrent_defaultargs.py
diff -N files/FBSD4-patch-BitTorrent_defaultargs.py
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/FBSD4-patch-BitTorrent_defaultargs.py	3 Apr 2006 13:13:35 -0000
@@ -0,0 +1,14 @@
+--- BitTorrent/defaultargs.py.orig	Mon Apr  3 14:57:11 2006
++++ BitTorrent/defaultargs.py	Mon Apr  3 15:11:49 2006
+@@ -29,10 +29,7 @@
+ 
+ import os
+ ### add your favorite here
+-BAD_LIBC_WORKAROUND_DEFAULT = MYFALSE
+-if os.name == 'posix':
+-    if os.uname()[0] in ['Darwin']:
+-        BAD_LIBC_WORKAROUND_DEFAULT = MYTRUE
++BAD_LIBC_WORKAROUND_DEFAULT = MYTRUE
+ 
+ MIN_INCOMPLETE = 100
+ if os.name == 'nt':
Comment 4 Stefan Walter 2006-04-03 14:40:05 UTC
[Once again and without the PGP signature that made a mess of the patch.]

Please commit the following patch. It unconditionally enables the libc
workaround for 4.x systems.

Regards,
Stefan

Index: Makefile
===================================================================
RCS file: /storage/cvs/FreeBSD/ports/net-p2p/btqueue/Makefile,v
retrieving revision 1.10
diff -u -r1.10 Makefile
--- Makefile	26 Mar 2006 20:20:34 -0000	1.10
+++ Makefile	3 Apr 2006 13:13:35 -0000
@@ -28,6 +28,11 @@
 
 .include <bsd.port.pre.mk>
 
+# Enable workaround for bad libc in FreeBSD 4.x
+.if ${OSVERSION} < 500000
+EXTRA_PATCHES=	${FILESDIR}/FBSD4-patch-BitTorrent_defaultargs.py
+.endif
+
 .if defined(WITH_PYXML)
 RUN_DEPENDS+=	${PYXML}
 .endif
Index: files/FBSD4-patch-BitTorrent_defaultargs.py
===================================================================
RCS file: files/FBSD4-patch-BitTorrent_defaultargs.py
diff -N files/FBSD4-patch-BitTorrent_defaultargs.py
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/FBSD4-patch-BitTorrent_defaultargs.py	3 Apr 2006 13:13:35 -0000
@@ -0,0 +1,14 @@
+--- BitTorrent/defaultargs.py.orig	Mon Apr  3 14:57:11 2006
++++ BitTorrent/defaultargs.py	Mon Apr  3 15:11:49 2006
+@@ -29,10 +29,7 @@
+ 
+ import os
+ ### add your favorite here
+-BAD_LIBC_WORKAROUND_DEFAULT = MYFALSE
+-if os.name == 'posix':
+-    if os.uname()[0] in ['Darwin']:
+-        BAD_LIBC_WORKAROUND_DEFAULT = MYTRUE
++BAD_LIBC_WORKAROUND_DEFAULT = MYTRUE
+ 
+ MIN_INCOMPLETE = 100
+ if os.name == 'nt':
Comment 5 Marcus Alves Grando freebsd_committer freebsd_triage 2006-04-29 18:48:09 UTC
State Changed
From-To: feedback->closed

Committed, with minor changes. Thanks!