Artifacts Associated With Ticket 9471e6e304
Ticket change [71f3079625] (rid 144916) by christian.nassau on 2016-02-15 10:54:11:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
We're seeing the following error during the simultaneous creation of several Tcl interpreters on Windows: Can't find a usable init.tcl in the following directories: {D:\ourniceproject\tcl8.6} D:/ourniceproject/tcl8.6/init.tcl: can't read "env(ComSpec)": no such element in array can't read "env(ComSpec)": no such element in array while executing "set temp $env($p)" (procedure "InitWinEnv" line 9) invoked from within "InitWinEnv" ... The problem seems to be that two simultaneous calls to "InitWinEnv" both try to replace "env(ComSpec)" with "env(COMSPEC)". The relevant code section is set temp $env($p) unset env($p) set env($u) $temp The "unset env($p)" from the first thread here leads to the error in the second thread. - foundin initialized to: "8.6.3"
- is_private initialized to: "0"
- login: "christian.nassau"
- priority initialized to: "5 Medium"
- private_contact initialized to: "3b279cda57135cd36d2c32c66396637342913651"
- resolution initialized to: "None"
- severity initialized to: "Severe"
- status initialized to: "Open"
- submitter initialized to: "christian.nassau"
- subsystem initialized to: "08. Environment Variables"
- title initialized to: "InitWinEnv not thread safe"
- type initialized to: "Bug"
Ticket change [a21f34102c] (rid 168007) by christian.nassau on 2018-12-15 15:17:37:
- icomment:
Here is a fix; I have no idea where to submit this "officially". Index: library/init.tcl ================================================================== --- library/init.tcl +++ library/init.tcl @@ -96,13 +96,17 @@ set u [string toupper $p] if {$u ne $p} { switch -- $u { COMSPEC - PATH { - set temp $env($p) - unset env($p) - set env($u) $temp + # need to catch access to env since it is a volatile + # array that can be changed by another thread + # (ticket [9471e6e3042c18f3c8403b7013ecdf104efb5b6d]) + if {![catch {set temp $env($p)}]} { + unset -nocomplain env($p) + set env($u) $temp + } trace add variable env($p) write \ [namespace code [list EnvTraceProc $p]] trace add variable env($u) write \ [namespace code [list EnvTraceProc $p]] } - login: "christian.nassau"
- mimetype: "text/plain"
- priority changed to: "6"
- icomment:
Ticket change [67017cf3d1] (rid 168008) by chw on 2018-12-16 09:21:33:
- icomment:
I believe the InitWinEnv in init.tcl can be completely left out when some WIN32 specific logic is added to tclEnv.c, as shown in https://www.androwish.org/index.html/artifact/94ec044a94ead074?ln=138-149 Eventually, as a by catch this doesn't have threading issues.
- login: "chw"
- mimetype: "text/plain"
- icomment:
Ticket change [d45e812c57] (rid 169140) by jan.nijtmans on 2019-02-12 13:42:45:
- assignee changed to: "jan.nijtmans"
- login: "jan.nijtmans"
- mimetype: "text/plain"
Ticket change [1d76bffb00] (rid 169754) by jan.nijtmans on 2019-03-07 08:38:45:
- closedate changed to: "2458549.86024557"
- closer changed to: "jan.nijtmans"
- icomment:
Should be fixed now in all branches. Thanks to Christian Werner for his fix proposal!
- login: "jan.nijtmans"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"