This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Bash login breaks if too many environment variables are set


> >
> >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.

OK, I stand corrected.

$ /bin/env | wc -c
34664
$ cmd
bash: /cygdrive/c/WINNT/system32/cmd: Invalid argument
$ strace /bin/env
bash: /usr/bin/strace: Invalid argument

On the other hand, POSIX would claim that this usage should
be failing with E2BIG, not EINVAL.  So it looks like Windows does
have a hard limit at total environment size of 32k (in spite of their
documentation never mentioning it), but that cygwin could
do better at reporting the error when trying to invoke a native
process.

--
Eric Blake



--
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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]