Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 71f30796257ab387fa2b267b803ab606f11b96cc
Ticket: 9471e6e3042c18f3c8403b7013ecdf104efb5b6d
InitWinEnv not thread safe
User & Date: christian.nassau on 2016-02-15 10:54:11
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. comment changed 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.
    
  5. foundin changed to: "8.6.3"
  6. is_private changed to: "0"
  7. login: "christian.nassau"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "3b279cda57135cd36d2c32c66396637342913651"
  10. resolution changed to: "None"
  11. severity changed to: "Severe"
  12. status changed to: "Open"
  13. submitter changed to: "christian.nassau"
  14. subsystem changed to: "08. Environment Variables"
  15. title changed to: "InitWinEnv not thread safe"
  16. type changed to: "Bug"