From owner-freebsd-stable@FreeBSD.ORG Sun Sep 18 04:54:20 2011 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 08104106564A for ; Sun, 18 Sep 2011 04:54:20 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id BC0388FC08 for ; Sun, 18 Sep 2011 04:54:19 +0000 (UTC) Received: by iadk27 with SMTP id k27so6280790iad.13 for ; Sat, 17 Sep 2011 21:54:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to; bh=s+BekavpIiRoZ76NdsOXvOhgrb5whYXHr3UIz7sMsEo=; b=xFXrYnKkFhZS+x3vt8fgt9YXvR/nvK1a6lVEjNjkb6WOdARMovh9UXu6PuS1txSueF tapfgIJ2H54ZmZIaGqUslf6Ib+4Ec7nxhYWYB3e+rTP49AVNf/YzTYqKZvu/lS04l5kD 26addA+lUYRQfcfhIC1Imf0IHa3Vv7ONK/xNk= Received: by 10.42.75.132 with SMTP id a4mr1680719ick.178.1316321659142; Sat, 17 Sep 2011 21:54:19 -0700 (PDT) Received: from DataIX.net (adsl-99-190-81-85.dsl.klmzmi.sbcglobal.net. [99.190.81.85]) by mx.google.com with ESMTPS id df21sm18373824ibb.9.2011.09.17.21.54.17 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 17 Sep 2011 21:54:17 -0700 (PDT) Sender: Jason Hellenthal Received: from DataIX.net (localhost [127.0.0.1]) by DataIX.net (8.14.5/8.14.5) with ESMTP id p8I4sEI8063918 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 18 Sep 2011 00:54:14 -0400 (EDT) (envelope-from jhell@DataIX.net) Received: (from jhell@localhost) by DataIX.net (8.14.5/8.14.5/Submit) id p8I4sDfd063917; Sun, 18 Sep 2011 00:54:13 -0400 (EDT) (envelope-from jhell@DataIX.net) Date: Sun, 18 Sep 2011 00:54:13 -0400 From: Jason Hellenthal To: Ronald Klop Message-ID: <20110918045413.GA63773@DataIX.net> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="mP3DRpeJDSE+ciuQ" Content-Disposition: inline In-Reply-To: Cc: "freebsd-stable@freebsd.org" Subject: Re: /usr/bin/script eating 100% cpu with portupgrade and xargs 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 Sep 2011 04:54:20 -0000 --mP3DRpeJDSE+ciuQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Sep 18, 2011 at 01:49:15AM +0200, Ronald Klop wrote: > Hi, >=20 > I'm running portupgrade in screen to update all the ports for =20 > 9-BETA2/9-CURRENT on amd64. While doing this script eats 100% cpu. > Because portupgrade -fa crashed I'm running this command to update the = =20 > remaining non-updates ports. > find /var/db/pkg -name +DESC -mtime +2 |cut -d / -f 5 | xargs time nice -= n =20 > 20 portupgrade -f >=20 > The output of truss -p `pgrep script` is this: > clock_gettime(13,{1316301104.000000000 }) =3D 0 (0x0) > select(5,{0 4},0x0,0x0,{30.000000 }) =3D 1 (0x1) > read(0,0x7fffffffcdf0,1024) =3D 0 (0x0) > write(4,0x7fffffffcdf0,0) =3D 0 (0x0) > clock_gettime(13,{1316301104.000000000 }) =3D 0 (0x0) > select(5,{0 4},0x0,0x0,{30.000000 }) =3D 1 (0x1) > read(0,0x7fffffffcdf0,1024) =3D 0 (0x0) > write(4,0x7fffffffcdf0,0) =3D 0 (0x0) > clock_gettime(13,{1316301104.000000000 }) =3D 0 (0x0) > select(5,{0 4},0x0,0x0,{30.000000 }) =3D 1 (0x1) > read(0,0x7fffffffcdf0,1024) =3D 0 (0x0) > write(4,0x7fffffffcdf0,0) =3D 0 (0x0) > clock_gettime(13,{1316301104.000000000 }) =3D 0 (0x0) > select(5,{0 4},0x0,0x0,{30.000000 }) =3D 1 (0x1) > read(0,0x7fffffffcdf0,1024) =3D 0 (0x0) > write(4,0x7fffffffcdf0,0) =3D 0 (0x0) >=20 > So it is really fast in reading and writing 0 bytes most of the time. >=20 > I also found http://web.archiveorange.com/archive/v/6ETvLvjo60Gj9geAUAb6 = =20 > and I think I am better of by rewriting my command so stdin/stdout is =20 > still the terminal. Although the link is a couple of years old. >=20 > Is this known? Can somebody explain me why my xargs command is not workin= g =20 > well? >=20 Are you absolutely sure that its script(1) causing this ? 100% CPU usage has been a known side effect of screen(1) for quite some time. Rebuild it and try again. --mP3DRpeJDSE+ciuQ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) Comment: http://bit.ly/0x89D8547E iQEcBAEBAgAGBQJOdXl1AAoJEJBXh4mJ2FR+LXEH/iLvSTTK2b0c8UwmhvR2R4mM TAJZX68xEBCLCS5hjy6vqrXRxiRuJ1Cj2chYA5ThVrzji5QnaPrpvGXaKWQtmhd8 6E/b2bbyiHNZCPMoHIlM/JjRKGky5u4aTBLiKPMYQ2QmJiZTDO1mEn0t7i+YIi9+ 98N+s6TA4qQX2TP34IAtp/A3q8v4fC7YUoPA0BOSiioAMpXtUsT6Bhnb2cq85k4J +WaGZyOTjR932eSP9c0q1xJGAsuFbF+qQAhJb88MzclPWivkykZ5RV9dCNKsegHs 1K1iEAtDYSdwnJZ1QmqAZU4LVeoFuXAjtuRPWlkJBGHKd6BPG5DhH0dFh4fH+uU= =vCrP -----END PGP SIGNATURE----- --mP3DRpeJDSE+ciuQ--