Edit
Attach
Printable
topic end
<!-- * Set TOPICTITLE = Claus Brod: Software blog - Environmental unconsciousness (04 Feb 2006) --> <style type="text/css"> pre {background-color:#ffeecc;} </style> %STARTINCLUDE% <a name="4"></a> ---+++ [[BlogOnSoftware20060204][Environmental unconsciousness]] (4.2.2006) Chances are that - by looking at my [[DefinePrivatePublic200601#27][earlier blog entry on batch files]] - you think I'm a DOS lamer. Nothing could be further from the truth, because I'm really a UNIX lamer. (OK, so what _really_ shaped my thinking even before that was the phrase [[http://www.commodore.ca/products/c64/commodore_64.htm]["38911 bytes free"]]. But I digress.) So I still write little one-off scripts using [[http://www.tldp.org/LDP/abs/html/][bash]], typically in a [[http://www.cygwin.com][Cygwin]] environment. One of these scripts recently ran berserk, reporting lots of errors like this one: <pre> ./foo.sh: line 42: /usr/bin/find: Resource temporarily unavailable </pre> I couldn't really figure out what resources the shell was talking about. Memory? Certainly not - the test system had ample memory, and was hardly using any. Files or disk space? Nope, lots of free disk space everywhere, and noone was fighting over access to shared files or so. Too many processes? Process Explorer wouldn't think so. Hmmm... This test script then revealed the truth: <pre> typeset -i limit=2200 # Create a file with 2200 environment variable definitions rm -f exportlist typeset -i i=0 while [ $i -lt $limit ] do echo "export FOO$i=$i" >>exportlist let i=i+1 done # Import the environment definitions source ./exportlist # Are we still alive? env | wc find . -name exportlist </pre> Run this script and watch it balk miserably about unavailable resources. So it's the environment which filled up and caused my scripts to fail! And indeed, the system for which the problem was originally reported uses a _lot_ of environment variables for some reason, and this broke my script. Once I had found out that much, it was easy to google for the right search terms and learn more: In [[http://www.cygwin.com/ml/cygwin/2004-03/msg01299.html][this Cygwin mailing list discussion]], Mike Sieweke explains that we are actually suffering from a Windows limitation here - apparently, the environment cannot grow larger than 32K. Christopher Faylor, chief maintainer of Cygwin, even [[http://www.cygwin.com/ml/cygwin/2004-03/msg01300.html][recommends a workaround]], but I haven't tested that one yet; instead, I helped to clean up the polluted environment on the affected PC, and henceforth, no _waldsterben_ anymore on that system. 32K - this would have filled almost all of those 38911 memory bytes assigned for BASIC programs on my good ol' 64... %COMMENT{type="below" nonotify="on"}% --- %STOPINCLUDE%
to top
End of topic
Skip to action links
|
Back to top
Edit
|
Attach image or document
|
Printable version
|
Raw text
|
Refresh
|
More topic actions
Revisions: | r1.3 |
>
|
r1.2
|
>
|
r1.1
|
Total page history
|
Backlinks
You are here:
Blog
>
BlogOnSoftware20060204
r1.3 - 29 Jan 2007 - 18:58 -
ClausBrod
to top
Blog
This site
2017
:
12
-
11
-
10
2016
:
10
-
7
-
3
2015
:
11
-
10
-
9
-
4
-
1
2014
:
5
2013
:
9
-
8
-
7
-
6
-
5
2012
:
2
-
10
2011
:
1
-
8
-
9
-
10
-
12
2010
:
11
-
10
-
9
-
4
2009
:
11
-
9
-
8
-
7
-
6
-
5
-
4
-
3
2008
:
5
-
4
-
3
-
1
2007:
12
-
8
-
7
-
6
-
5
-
4
-
3
-
1
2006:
4
-
3
-
2
-
1
2005:
12
-
6
-
5
-
4
2004:
12
-
11
-
10
C++
CoCreate Modeling
COM & .NET
Java
Mac
Lisp
OpenSource
Scripting
Windows
Stuff
Changes
Index
Search
Maintenance
Impressum
Datenschutzerklärung
Home
Webs
Atari
Blog
Claus
CoCreateModeling
Klassentreffen
Main
Sandbox
Sommelier
TWiki
Xplm
Jump:
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback