Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug#527171: [zsh] segfaults on long environment variables
- X-seq: zsh-workers 26942
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: Bug#527171: [zsh] segfaults on long environment variables
- Date: Wed, 6 May 2009 20:41:01 +0100
- Cc: 527171@xxxxxxxxxxxxxxx
- In-reply-to: <20090506013828.GB26437@xxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20090506003505.GA29923@xxxxxxxxx> <20090506013828.GB26437@xxxxxxxx>
On Wed, 6 May 2009 01:38:28 +0000
Clint Adams <schizo@xxxxxxxxxx> 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 <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author