From owner-freebsd-stable@FreeBSD.ORG Sat Oct 17 17:54:00 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 A4657106566B for ; Sat, 17 Oct 2009 17:54:00 +0000 (UTC) (envelope-from mi+thun@aldan.algebra.com) Received: from aldan.algebra.com (aldan.algebra.com [216.254.65.224]) by mx1.freebsd.org (Postfix) with ESMTP id 727008FC0C for ; Sat, 17 Oct 2009 17:53:58 +0000 (UTC) Received: from aldan.algebra.com (localhost [127.0.0.1]) by aldan.algebra.com (8.14.3/8.14.3) with ESMTP id n9HHrtaG092796; Sat, 17 Oct 2009 13:53:56 -0400 (EDT) (envelope-from mi+thun@aldan.algebra.com) Message-ID: <4ADA04B3.1000704@aldan.algebra.com> Date: Sat, 17 Oct 2009 13:53:55 -0400 From: "Mikhail T." User-Agent: Thunderbird 2.0.0.22 (X11/20090711) MIME-Version: 1.0 To: Kostik Belousov References: <4AD9F4ED.2050002@aldan.algebra.com> <20091017172718.GJ2160@deviant.kiev.zoral.com.ua> In-Reply-To: <20091017172718.GJ2160@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 8bit 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:54:00 -0000 Kostik Belousov ΞΑΠΙΣΑΧ(ΜΑ): > Take ktrace of both parent and child. > I can see the curious piece right here: The child exits: 92723 tclsh8.5 CALL exit(0) The parent masks SIGPIPE (as part of my workaround): 92722 tclsh8.5 CALL sigaction(SIGPIPE,0x7fffffffa9e0,0) 92722 tclsh8.5 RET sigaction 0 This 0-size write must be part of the pipe-closing -- descriptors 4 and 5 must be the pipe's: 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=0x800f126d0 mask=0x0 code=0x0 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 Why would it write 0 bytes? Is doing so triggering a SIGPIPE now -- but, perhaps, didn't use to? Thanks! -mi