From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8679 invoked from network); 6 May 2009 19:41:24 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,URI_HEX autolearn=no version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 6 May 2009 19:41:24 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 98777 invoked from network); 6 May 2009 19:41:17 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 6 May 2009 19:41:17 -0000 Received: (qmail 20293 invoked by alias); 6 May 2009 19:41:11 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26942 Received: (qmail 20272 invoked from network); 6 May 2009 19:41:09 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 6 May 2009 19:41:09 -0000 Received: from mtaout02-winn.ispmail.ntl.com (mtaout02-winn.ispmail.ntl.com [81.103.221.48]) by bifrost.dotsrc.org (Postfix) with ESMTP id C51DB80590A3 for ; Wed, 6 May 2009 21:40:52 +0200 (CEST) Received: from aamtaout03-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout02-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20090506194104.GQLU25388.mtaout02-winn.ispmail.ntl.com@aamtaout03-winn.ispmail.ntl.com>; Wed, 6 May 2009 20:41:04 +0100 Received: from pws-pc ([81.107.42.185]) by aamtaout03-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20090506194104.TXYO2093.aamtaout03-winn.ispmail.ntl.com@pws-pc>; Wed, 6 May 2009 20:41:04 +0100 Date: Wed, 6 May 2009 20:41:01 +0100 From: Peter Stephenson To: zsh-workers@sunsite.dk Cc: 527171@bugs.debian.org Subject: Re: Bug#527171: [zsh] segfaults on long environment variables Message-ID: <20090506204101.571d90d3@pws-pc> In-Reply-To: <20090506013828.GB26437@scru.org> References: <20090506003505.GA29923@ngolde.de> <20090506013828.GB26437@scru.org> X-Mailer: Claws Mail 3.7.0 (GTK+ 2.14.7; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Cloudmark-Analysis: v=1.0 c=1 a=rLKJ4BDFXDkA:10 a=nF0cisxT3xsA:10 a=xNf9USuDAAAA:8 a=NLZqzBF-AAAA:8 a=krx4zRuzeeioaFXqMeoA:9 a=zHdc42eTj7juu_1v0lsWspf2m84A:4 a=YPTUPuSgPjgA:10 a=_dQi-Dcv4p4A:10 X-Virus-Scanned: ClamAV 0.92.1/9333/Wed May 6 05:55:26 2009 on bifrost X-Virus-Status: Clean On Wed, 6 May 2009 01:38:28 +0000 Clint Adams wrote: > On Wed, May 06, 2009 at 02:35:05AM +0200, Nico Golde wrote: > > export BLA=$(perl -e "print 'A' x 100000000;") > > > > results in zsh segfaulting: > > [335969.515454] zsh[29005]: segfault at 7fff1b357858 ip 7fb5184a5855 sp 7fff1b357860 error 6 in libc-2.9.so[7fb518471000+149000] > > The segfault is not in the assignment but in the export (zputenv). This appears to be failing within setenv() which (as far as I can tell) is being passed a perfectly valid string. setenv() is supposed to fail gracefully and set errno to ENOMEM if it doesn't fit in the environment but apparently isn't. I believe the environment size is limited by ARG_MAX on POSIX-like systems, but it's not usually tested by the caller (which doesn't know how much space is left). -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/