From owner-freebsd-stable@FreeBSD.ORG Sat Oct 17 16:46:43 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 33189106566C for ; Sat, 17 Oct 2009 16:46:43 +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 417608FC18 for ; Sat, 17 Oct 2009 16:46:41 +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 n9HGkb7S089507 for ; Sat, 17 Oct 2009 12:46:38 -0400 (EDT) (envelope-from mi+thun@aldan.algebra.com) Message-ID: <4AD9F4ED.2050002@aldan.algebra.com> Date: Sat, 17 Oct 2009 12:46:37 -0400 From: "Mikhail T." User-Agent: Thunderbird 2.0.0.22 (X11/20090711) MIME-Version: 1.0 To: stable@FreeBSD.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Subject: 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 16:46:43 -0000 Hello! I'm investigating a problem caused by (what seems like a spurious) SIGPIPE. The program creates a child process using pipe, exchanges a few messages with the child (via write and read) and closes the pipe. Some times -- in about 60% of the cases -- this causes a SIGPIPE to be delivered to the parent... Now, it is quite possible for the child to have already exited by the time the parent closes its end of the pipe -- but why should that cause a SIGPIPE, unless the parent tries to write something to the widowed pipe, which it does not? >From pipe(2): A pipe that has had an end closed is considered widowed. Writing on such a pipe causes the writing process to receive a SIGPIPE signal. There is no other mention of SIGPIPE in that manual page... I set SIGPIPE on ignore around the pipe-closing as a work-around, but I think, this is a bug... The thing is part of TclX' self-test (test signal-3.0) -- and it was not dying from SIGPIPE before the FreeBSD-7.x, as far as I can remember... It still seems to be fine on Linux... Have there been any changes in this area in FreeBSD? Thanks! -mi