Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2005-10-20
09:20 • Closed ticket [1042910fff]: tcl crash when env variable too large plus 6 oth... artifact: 26a43f2333 user: sf-robot
2005-10-05
13:54 • Pending ticket [1042910fff]. artifact: c1ec946acf user: hobbs
2004-10-09
09:32 • Ticket [1042910fff]: 5 changes artifact: afed0942d3 user: hobbs
09:26 • Ticket [1042910fff]: 4 changes artifact: f72557f263 user: davygrvy
2004-10-08
09:45 • New ticket [1042910fff]. artifact: f1dd4bdc3b user: yahalom

tcl crash when env variable too large

Closed / Wont Fix1042910fffffffffffffffffffffffffffffffffCreated 22 years agoUpdated 21 years ago
Descriptionplain2004-10-08 09:45:11
tcl 8.4.7
pltfrom: windows XP/2000
when I run this script tclsh crashes.
the problem is with environemnt variable being in 
the length of 32767 or more. this problem causes a 
serious file upload problem with tclhttpd.

set xxx [string repeat x 32765]
set env(query) $xxx
set xxx [string repeat x 32767]
set env(query) $xxx
set crash $env(query)

a longer test that shows the problem is with the 
32767:
while {1} {
append xxx x
puts [string length $xxx]
set env(query) $xxx
set b $env(query)
}
davygrvyplain2004-10-09 09:26:41
Logged In: YES 
user_id=7549

Works on Win2K with current CVS 8.5:

33724
33725
33726
33727
33728
33729
33730
33731
33732
33733
33734
33735
hobbsplain2004-10-09 09:32:54
Logged In: YES 
user_id=72656

While it doesn't crash for me on XP SP2, I do find that
setting it to that value actually causes the value to be unset:

(Tcl) 55 % set env(query) foo
foo
(Tcl) 56 % string length $env(query)
3
(Tcl) 57 % catch {set env(query) $xxx}
0
(Tcl) 58 % string length $env(query)
can't read "env(query)": no such variable
(Tcl) 59 % string length $xxx
32767

This is with 8.4.head
hobbsplain2005-10-05 13:54:48
Logged In: YES 
user_id=72656

There only appears to be a Tcl-level crash on systems where
the value gets large, as MS behavior seems to be unset the
var.  In any case, we are using putenv, and MS docs do no
indicate any space limitations to putenv, which we are
allocating anyways.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/html/_crt__putenv.2c_._wputenv.asp
sf-robotplain2005-10-20 09:20:34
Logged In: YES 
user_id=1312539

This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).
Log in (anonymous is fine) to add a comment.