From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1784 invoked from network); 8 Jan 2008 07:17:56 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.2.3 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 8 Jan 2008 07:17:56 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 71667 invoked from network); 8 Jan 2008 07:17:49 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 8 Jan 2008 07:17:49 -0000 Received: (qmail 8101 invoked by alias); 8 Jan 2008 07:17:45 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24369 Received: (qmail 8085 invoked from network); 8 Jan 2008 07:17:44 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 8 Jan 2008 07:17:44 -0000 Received: from virusfilter.dotsrc.org (bifrost [127.0.0.1]) by spamfilter.dotsrc.org (Postfix) with ESMTP id DB3C38058FF2 for ; Tue, 8 Jan 2008 08:17:39 +0100 (CET) Received: from flock1.newmail.ru (flock1.newmail.ru [82.204.219.207]) by bifrost.dotsrc.org (Postfix) with SMTP for ; Tue, 8 Jan 2008 08:17:39 +0100 (CET) Received: (qmail 28302 invoked from network); 8 Jan 2008 07:17:38 -0000 Received: from unknown (HELO cooker.net) (arvidjaar@newmail.ru@91.77.192.3) by smtpd.newmail.ru with SMTP; 8 Jan 2008 07:17:38 -0000 From: Andrey Borzenkov To: zsh-workers@sunsite.dk Subject: Re: possible glibc bug with buffers [was Re: 4.3.4-dev-6] Date: Tue, 8 Jan 2008 10:17:36 +0300 User-Agent: KMail/1.9.6 (enterprise 0.20071123.740460) References: <5951.1198159661@csr.com> <20080103170824.e3b1df78.p.w.stephenson@ntlworld.com> <20080107194421.GA26236@scowler.net> In-Reply-To: <20080107194421.GA26236@scowler.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1548386.8s0t7xCRRL"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200801081017.36828.arvidjaar@newmail.ru> X-Virus-Scanned: ClamAV using ClamSMTP --nextPart1548386.8s0t7xCRRL Content-Type: multipart/mixed; boundary="Boundary-01=_QOygHyzJqyhI4pl" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_QOygHyzJqyhI4pl Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Monday 07 January 2008, Clint Adams wrote: >=20 > On Thu, Jan 03, 2008 at 05:08:24PM +0000, Peter Stephenson wrote: > > I'm not getting that last "foo"; could there be a race somewhere, or a > > non-standard configuration option set that's doing something odd with > > file descriptors, or something nasty in the compilation tree? >=20 > My current understanding of the situation is as follows: > bash, ksh, and zsh behave normally under glibc 2.3 >=20 > under glibc 2.7, ksh behaves normally >=20 > bash does this > $ echo one >/dev/full > bash: echo: write error: No space left on device > $ echo two > one > two >=20 > and zsh does this > % echo one >/dev/full > echo: write error: no space left on device > one > % echo two > two >=20 > I can't reproduce this with a simple fprintf-ing to /dev/full. >=20 >=20 >=20 >=20 this is being discussed right now on linux-hotplug as well; there is also D= ebian=20 bug report on it. --Boundary-01=_QOygHyzJqyhI4pl Content-Type: message/rfc822 Content-Transfer-Encoding: 7bit Content-Description: Andrew Patterson : Re: Error returns not =?iso-8859-1?q?handled=09correctly=09by=09sysfs=2Ec=3Asubsys=5Fattr=5Fs?= =?iso-8859-1?q?tore?=() Content-Disposition: inline; filename*= Return-path: Received: from [209.132.176.167] (port=36597 helo=vger.kernel.org) by mx10.mail.ru with esmtp id 1JBzHv-0000H6-00 for arvidjaar@mail.ru; Tue, 08 Jan 2008 00:13:39 +0300 Received-SPF: none (mx10.mail.ru: 209.132.176.167 is neither permitted nor denied by domain of vger.kernel.org) client-ip=209.132.176.167; envelope-from=linux-hotplug-owner@vger.kernel.org; helo=vger.kernel.org; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753748AbYAGVNg (ORCPT ); Mon, 7 Jan 2008 16:13:36 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753138AbYAGVNf (ORCPT ); Mon, 7 Jan 2008 16:13:35 -0500 Received: from g4t0017.houston.hp.com ([15.201.24.20]:43174 "EHLO g4t0017.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752546AbYAGVNe (ORCPT ); Mon, 7 Jan 2008 16:13:34 -0500 Received: from g4t0017.houston.hp.com (localhost.localdomain [127.0.0.1]) by receive-from-antispam-filter (Postfix) with SMTP id 5606E3830D; Mon, 7 Jan 2008 21:13:34 +0000 (UTC) Received: from smtp1.fc.hp.com (smtp1.fc.hp.com [15.15.136.127]) by g4t0017.houston.hp.com (Postfix) with ESMTP id 239FE38242; Mon, 7 Jan 2008 21:13:34 +0000 (UTC) Received: from [10.32.61.2] (lart.fc.hp.com [15.11.146.31]) by smtp1.fc.hp.com (Postfix) with ESMTP id D16D61E4AF7; Mon, 7 Jan 2008 21:13:33 +0000 (UTC) Subject: Re: Error returns not handled correctly by sysfs.c:subsys_attr_store() From: Andrew Patterson To: Tejun Heo Cc: Greg KH , Andrew Morton , linux-kernel@vger.kernel.org, linux-hotplug@vger.kernel.org, bjorn.helgaas@hp.com In-Reply-To: <1199405830.7025.33.camel@bluto.andrew> References: <1195683419.16019.225.camel@grinch> <20071126203116.0c93cdb9.akpm@linux-foundation.org> <20071127053321.GA975@kroah.com> <474D1BD4.2050805@suse.de> <1196278300.5431.9.camel@grinch> <474E10CF.7050009@suse.de> <1196716558.20124.179.camel@bluto.andrew> <1199404273.7025.21.camel@bluto.andrew> <477D78BE.1060404@suse.de> <1199405830.7025.33.camel@bluto.andrew> Content-Type: text/plain Date: Mon, 07 Jan 2008 14:13:33 -0700 Message-Id: <1199740413.7025.83.camel@bluto.andrew> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 7bit Sender: linux-hotplug-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hotplug@vger.kernel.org X-Spam: Not detected On Thu, 2008-01-03 at 17:17 -0700, Andrew Patterson wrote: > On Fri, 2008-01-04 at 09:07 +0900, Tejun Heo wrote: > > Hello, > > > > Andrew Patterson wrote: > > > It looks like this is a shell issue. After looking through the sysfs > > > code, I realized that this problem seems to be driven from user-land. > > > So I performed some experiments: > > > > > > 1. Wrote a simple program that just used write(2) to write to the > > > sysfs entry. This works fine. > > > 2. Used /bin/echo instead of the built-in echo command. This too > > > works fine. > > > 3. Tried several shells. Zsh and Bash both fail. Csh works fine. > > > > > > I then ran strace on the following shell-script: > > > > > > #!/bin/bash > > > > > > echo x > allow_restart > > > echo y > allow_restart > > > echo z > allow_restart > > > > > > and got: > > > > > > # strace -e trace=write ~/tmp/tester.sh > > > write(1, "x\n", 2) = -1 EINVAL (Invalid argument) > > > write(1, "x\n", 2) = -1 EINVAL (Invalid argument) > > > write(2, "/home/andrew/tmp/tester.sh: line"..., 72/home/andrew/tmp/tester.sh: line 4: echo: write error: Invalid argument > > > ) = 72 > > > write(1, "x\ny\n", 4) = -1 EINVAL (Invalid argument) > > > write(1, "x\ny\n", 4) = -1 EINVAL (Invalid argument) > > > write(2, "/home/andrew/tmp/tester.sh: line"..., 72/home/andrew/tmp/tester.sh: line 5: echo: write error: Invalid argument > > > ) = 72 > > > write(1, "x\ny\nz\n", 6) = -1 EINVAL (Invalid argument) > > > write(1, "x\ny\nz\n", 6) = -1 EINVAL (Invalid argument) > > > write(2, "/home/andrew/tmp/tester.sh: line"..., 72/home/andrew/tmp/tester.sh: line 6: echo: write error: Invalid argument > > > ) = 72 > > > write(1, "x\ny\nz\n", 6x > > > y > > > z > > > ) = 6 > > > Process 3800 detached > > > > Eeeeeeeekkkk.... That's scary. Which distro are you using and what does > > 'bash --version' say? > > IA64 Debian lenny. > > # bash --version > GNU bash, version 3.1.17(1)-release (ia64-unknown-linux-gnu) > > # zsh --version > zsh 4.3.4 (ia64-unknown-linux-gnu) > > # csh --version > tcsh 6.14.00 (Astron) 2005-03-25 (ia64-unknown-linux) options > wide,nls,dl,al,kan,rh,nd,color,filec > > I suppose I should try this an ia32 box again, and perhaps with some > other distros. I am not sure what the kernel can do about this, but it > might be nice to report it to the shell maintainers. > This looks like it might be the culprit. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=459643 The fact that it works on SLES10 lends further evidence to glibc being the problem. -- Andrew Patterson Hewlett-Packard Company - To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --Boundary-01=_QOygHyzJqyhI4pl-- --nextPart1548386.8s0t7xCRRL Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (GNU/Linux) iEYEABECAAYFAkeDI5AACgkQR6LMutpd94ytCgCg0pA1I0Sqdp1WFwLQ0IsBLANb wCwAn2n20tqXxXbgUWIoPfmfxmkuLq7L =/Qvf -----END PGP SIGNATURE----- --nextPart1548386.8s0t7xCRRL--