From owner-freebsd-stable@FreeBSD.ORG Sun Jul 18 15:15:08 2010 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 929901065677 for ; Sun, 18 Jul 2010 15:15:08 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id B161B8FC0A for ; Sun, 18 Jul 2010 15:15:06 +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 o6IFF2Qa035145 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 18 Jul 2010 18:15:02 +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.4/8.14.4) with ESMTP id o6IFF2wq028110; Sun, 18 Jul 2010 18:15:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o6IFEveO028107; Sun, 18 Jul 2010 18:14:57 +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: Sun, 18 Jul 2010 18:14:57 +0300 From: Kostik Belousov To: Jilles Tjoelker Message-ID: <20100718151457.GP2381@deviant.kiev.zoral.com.ua> References: <20100717152455.GA61987@ravenloft.kiev.ua> <20100717221150.GA18562@stack.nl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="U/fW6JBK3GqE0Htg" Content-Disposition: inline In-Reply-To: <20100717221150.GA18562@stack.nl> 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=-2.2 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-stable@freebsd.org, Alex Kozlov Subject: Re: SIGEPIPE after update to 8.1-RC2 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: Sun, 18 Jul 2010 15:15:08 -0000 --U/fW6JBK3GqE0Htg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jul 18, 2010 at 12:11:50AM +0200, Jilles Tjoelker wrote: > On Sat, Jul 17, 2010 at 06:24:55PM +0300, Alex Kozlov wrote: > > After updating my buildbox from 26 April 8-STABLE > > to 8.1-RC2 I constantly getting SIGEPIPE >=20 > > portsnap: > > Fetching 4 metadata patches... done. > > Applying metadata patches... done. > > Fetching 0 metadata files... done. > > Fetching 27 patches.....10....20... done. > > Applying patches... done. > > Fetching 3 new ports or files... done. > > sort: write failed: standard output: Broken pipe > > sort: write error > > Removing old files and directories... done. >=20 > > sudo make -C /usr/ports/converters/ascii2binary: > > =3D=3D=3D> Patching for ascii2binary-2.13_2 > > =3D=3D=3D> Applying FreeBSD patches for ascii2binary-2.13_2 > > =3D=3D=3D> ascii2binary-2.13_2 depends on shared library: intlgrep: w= riting output: Broken pipe > > grep: writing output: Broken pipe > [snip repetition] > > - found > > =3D=3D=3D> Configuring for ascii2binary-2.13_2 >=20 > > Does anyone know something about this issue? >=20 > This looks more like the absence of SIGPIPE than an inappropriate > SIGPIPE. I can reproduce both of those error messages by running the > commands with SIGPIPE ignored. grep(1) seems to behave strangely on > write errors, not aborting, for example > yes | { trap '' PIPE; grep -v foo; echo $? >&2; } | : > prints an endless stream of error messages. >=20 > Note that sh(1) silently ignores attempts to change the disposition of > signals that were ignored on entry to the shell, so a > trap - PIPE > is unlikely to help you. >=20 > Similarly, SIGPIPE may be blocked (masked). Few programs expect this. >=20 > The -i and -j options in procstat should be helpful in finding what > exactly is wrong with SIGPIPE. (These options are relatively new, but > should be in 8.1.) Might be, but now I have a feel that something more strange happens there. One of my workstations does not exhibit the behaviour, while another one did. I composed the following grep wrapper to catch the situation you guessed: #!/bin/sh disp=3D$(procstat -i $$ | awk '/PIPE/{print $4}') if expr -- $disp : I >/dev/null ; then echo "grep: SIGPIPE ignored" >/dev/tty kill -STOP $$ fi exec /usr/bin/grep "$@" Amazingly enough, the messages stopped spitting. Even more, I cannot reproduce them on the machine without the wrapper. Side note: despite ports/Mk/bsd.commands.mk defining GREP and EGREP, there are still several instances of the direct grep invocation among Mk/* files. Do port people consider this worth fixing ? --U/fW6JBK3GqE0Htg Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkxDGnAACgkQC3+MBN1Mb4jfnwCffc/gZM74nn1o9m58HXRajKgJ AFQAnRVadafZt0CBs/GTpIKHuHRz/0Zq =2274 -----END PGP SIGNATURE----- --U/fW6JBK3GqE0Htg--