From owner-freebsd-hackers@FreeBSD.ORG Wed Nov 10 21:51:02 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF8D6106566B for ; Wed, 10 Nov 2010 21:51:02 +0000 (UTC) (envelope-from naylor.b.david@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 5E1678FC13 for ; Wed, 10 Nov 2010 21:51:01 +0000 (UTC) Received: by wya21 with SMTP id 21so1307782wya.13 for ; Wed, 10 Nov 2010 13:51:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :user-agent:mime-version:content-type:content-transfer-encoding :message-id; bh=YdM0jchA4kzZ0dPpjuYuc+aUa5hTkMZ8SbBjf0lWUHc=; b=kVlqP5CZaWYvwL5VyZmwLKWMXZjNaIrGOpOeyNaiMUjlyppGnZktGogV1mhlWxz9Am OUi86lBE9PB1zV1vMwo4ygC0soHmNiyYqgZdBgW1ai4D0edLsIdBUcZPr4Yzb0zPY0tg P1Ism+gldQMlXk+vvuh0fnIAkSLB/0sGeVWzA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:mime-version:content-type :content-transfer-encoding:message-id; b=gdH7NGiEz1jLQpOv72+uRG/tlEnMn0Ca28PHUu9VS/3r8vbl3ZhW1xL/4GstcJ40Ua cd4QjQPq5JsLg2jdaokTSftYwOIDVUceLqhBaAsEuLC2SVbgyUweajXnCY8osdrpoanp PqLODf5HoZwD7snPnH6DKMKJfl3Ngi88J2eCs= Received: by 10.216.235.211 with SMTP id u61mr8103686weq.91.1289424093933; Wed, 10 Nov 2010 13:21:33 -0800 (PST) Received: from dragon.dg (41-132-133-189.dsl.mweb.co.za [41.132.133.189]) by mx.google.com with ESMTPS id p4sm771458wej.28.2010.11.10.13.21.31 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 10 Nov 2010 13:21:33 -0800 (PST) From: David Naylor To: freebsd-hackers@freebsd.org Date: Wed, 10 Nov 2010 23:21:17 +0200 User-Agent: KMail/1.13.5 (FreeBSD/9.0-CURRENT; KDE/4.5.1; amd64; ; ) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2403325.53z0r8NQuq"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201011102321.23883.naylor.b.david@gmail.com> Subject: python + build ports = failure (threading problem) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2010 21:51:03 -0000 --nextPart2403325.53z0r8NQuq Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, I've found a problem in FreeBSD's implementation for threads, pth does not= =20 have this problem. =20 The following test case consistantly reproduces the problem: =2D-- start --- #! /usr/bin/env python from subprocess import Popen, PIPE from threading import Lock, Thread def runner(): process =3D Popen(("make", "-C", "/usr/ports/graphics/kdegraphics4", "cle= an",=20 "all"), close_fds=3DTrue) process.wait() # If runner called directly then port compiles correctly, otherwise it stal= ls Thread(target=3Drunner).start() =2D-- end --- The port stalls with=20 grep: writing output: Broken pipe grep: writing output: Broken pipe grep: writing output: Broken pipe - found =3D=3D=3D> Configuring for kdegraphics-4.5.3 /bin/mkdir -p /usr/ports/graphics/kdegraphics4/work/kdegraphics-4.5.3/build The grep errors appear to be mostly harmless, `ps` shows: 17648 4 D 0:00.03 python test.py 17649 4 D 0:00.08 make -C /usr/ports/graphics/kdegraphics4 clean all 17974 4 D 0:00.03 [cmake] 17978 4 Z 0:00.03 I suspect any port using cmake will have this problem (unconfirmed) and if= =20 memory serves me correct then building lang/perl causes the same problem=20 (although the stall happens much later on in the build). =20 Using WITH_PTH when building python fixes the problem so I suspect libthr a= s=20 the cause of the problem. =20 I hope someone finds this information useful. =20 David P.S. Should a PR be filed for this? P.S.S. It is possible that one of pythons test cases can reproduce this... --nextPart2403325.53z0r8NQuq Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iEYEABECAAYFAkzbDNMACgkQUaaFgP9pFrIGyQCePFdi2mt7W4v1lJdmc4iuHWed gEgAnjz6MKiKNgOwBITvBRPa7Xzx/Kt5 =/PkM -----END PGP SIGNATURE----- --nextPart2403325.53z0r8NQuq--