This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Bash login breaks if too many environment variables are set
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/