From owner-freebsd-stable@FreeBSD.ORG Sat Oct 17 17:59:48 2009 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 480151065695 for ; Sat, 17 Oct 2009 17:59:48 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194]) by mx1.freebsd.org (Postfix) with ESMTP id AD5B18FC24 for ; Sat, 17 Oct 2009 17:59:47 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id n9HHxfjF082518 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 17 Oct 2009 20:59:41 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id n9HHxfV2020504; Sat, 17 Oct 2009 20:59:41 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id n9HHxfDu020503; Sat, 17 Oct 2009 20:59:41 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 17 Oct 2009 20:59:41 +0300 From: Kostik Belousov To: "Mikhail T." Message-ID: <20091017175941.GK2160@deviant.kiev.zoral.com.ua> References: <4AD9F4ED.2050002@aldan.algebra.com> <20091017172718.GJ2160@deviant.kiev.zoral.com.ua> <4ADA04B3.1000704@aldan.algebra.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="D6IIOQQv2Iwyp54J" Content-Disposition: inline In-Reply-To: <4ADA04B3.1000704@aldan.algebra.com> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: stable@freebsd.org Subject: Re: Can close-ing a pipe trigger a SIGPIPE? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2009 17:59:48 -0000 --D6IIOQQv2Iwyp54J Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Oct 17, 2009 at 01:53:55PM -0400, Mikhail T. wrote: > Kostik Belousov =CE=C1=D0=C9=D3=C1=D7(=CC=C1): > > Take ktrace of both parent and child. > > =20 > I can see the curious piece right here: >=20 > The child exits: >=20 > 92723 tclsh8.5 CALL exit(0) >=20 > The parent masks SIGPIPE (as part of my workaround): >=20 > 92722 tclsh8.5 CALL sigaction(SIGPIPE,0x7fffffffa9e0,0) > 92722 tclsh8.5 RET sigaction 0 >=20 > This 0-size write must be part of the pipe-closing -- descriptors 4 and > 5 must be the pipe's: >=20 > 92722 tclsh8.5 CALL write(0x4,0x800e24028,0) > 92722 tclsh8.5 RET write -1 errno 32 Broken pipe > 92722 tclsh8.5 PSIG SIGPIPE caught handler=3D0x800f126d0 mask=3D0x0 cod= e=3D0x0 > 92722 tclsh8.5 CALL sigreturn(0x7fffffffa0c0) > 92722 tclsh8.5 RET sigreturn JUSTRETURN > 92722 tclsh8.5 CALL close(0x5) > 92722 tclsh8.5 RET close 0 > 92722 tclsh8.5 CALL close(0x4) > 92722 tclsh8.5 RET close 0 >=20 > Why would it write 0 bytes? Is doing so triggering a SIGPIPE now -- but, > perhaps, didn't use to? Obviously, I cannot answer the question. This is something that should be read from source code or asked by authors. --D6IIOQQv2Iwyp54J Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkraBgwACgkQC3+MBN1Mb4gvxACg4dINw+O+/SWEBhfX/W0Pr5Nk ydoAoIKZFTxI/jTgwl9hbOLUwyWT4et1 =1+ri -----END PGP SIGNATURE----- --D6IIOQQv2Iwyp54J--