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.
State Changed From-To: open->feedback Awaiting maintainers feedback
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
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':
[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':
State Changed From-To: feedback->closed Committed, with minor changes. Thanks!