Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Fri, 16 Sep 2005 12:48:05 -0400 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: Bash login breaks if too many environment variables are set Message-ID: <20050916164805.GA30657@trixie.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com References: <091620051636 DOT 3255 DOT 432AF47000065F0D00000CB722007456720A050E040D0C079D0A AT comcast DOT net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <091620051636.3255.432AF47000065F0D00000CB722007456720A050E040D0C079D0A@comcast.net> User-Agent: Mutt/1.5.8i On Fri, Sep 16, 2005 at 04:36:00PM +0000, Eric Blake wrote: >>>It looks to me as if a buffer or stack is reused if some maximum is >>>exceeded with effect that the system sometimes works. >> >>From your strace output, it looks to me like windows itself is >>returning garbage when we ask it for the list of environment variables. > >I don't think all places in Windows have the limitation. Look at the code. We're inspecting a buffer returned from GetEnvironmentStrings. That is a windows function. The very first things returned from this are garbage. >Corinna reported (and I have reproduced on Win2k, CYGWIN-NT-5.0) that >it is quite easy to create an environment larger than 32k and see it in >a child process: > >$ foo=`perl -e 'print "a"x31000'` >$ export foo $ /bin/env | wc -c 34664 >$ /bin/env | wc -c >34664 You're not testing the same thing. Cygwin deals with environment variables on its own once you've started a cygwin process. It only relies on windows environment-passing mechanisms to pass environment variables to non-cygwin applications. I have a new version of a cygwin snapshot which has more debugging output and which should (temporarily?) fail with an error if environment processing fails. cgf -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/