Skip to content
Tcl Source Code History Of Ticket 1440723fffffffff
Login

History Of Ticket 1440723fffffffff

Artifacts Associated With Ticket 1440723fffffffff

  1. Ticket change [bca3d8734a] (rid 101788) by tatooguy on 2006-03-01 03:17:08:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      VERSION: 
        Tcl8.3.2
      OS Plafform:and Version:
        SunOS wapgw1 5.8 Generic_117350-22 sun4u sparc SUNW, 
      
      Brief Description about behavior:
      
         I have a multithread program in unix c++ . In one 
      thread, I create a TCl Interpreter with 
      Tcl_CreateInterp and execute the script buffer. 
      
      In some other threads I do some other things.
      
         Currently, I migrate my program from my solaris 8 
      to another solaris 8, 
      
      it often core dump abnormally if I keep on execute the 
      following two tcl sencenses.
      
       
      
      set systemTime [clock seconds];
      
      set TclVarTimeStamp [clock format $systemTime -format %
      Y-%m-%dT%H:%M:%SZ];
      
       
      
        I check the source code and find that there are many 
      functions related to time or time zone which call 
      function localtime()
      
      not localtime_r(). Although I find many mutex lock in 
      these functions, but it can only assure that all the 
      TCLInterpreter related
      
      threads can safely call this type of function, not 
      other threads.
      
       
      
        For example: a two thread app
      
        Thread1: TCLInterpreter call localtime with mutex 
      lock
      
        Thread2: some times call localtime_r
      
        then, no matter how the thread1’s tcl source code 
      lock the localtime() operation,   thread2 can also 
      access the localtime_r()
      
        since the tcl’s mutex lock have nothing to do with 
      thread2, it only take effect in tcl8.3.2 source code. 
      And when thread1 and thread2
      
        call this function at the same time, it will be 
      unsafe!!!!
      
       
      
      So, I wonder whether the tcl8.3.2 related time 
      operation is thread-safe and how to make it thread-
      safe. In the lasted version tcl8.4.12,
      
      I still find many place which call localtime() instead 
      of localtime_r().
      
       
      
      One more puzzling thing which I can’t figure out and 
      also intersting:
      
        My program was build in the Solaris OS whose system 
      TIMEZONE is PRC, while the Solaris OS which make my 
      program core
      
      is not PRC but others like Hongkong, etc. If I set the 
      TZ environment in the unix login shell and run my 
      program in the “core” OS, it runing fine. 
      
       
      
      Why??? anyone met this before and how to fix it? 
      Personly, I think the tcl’s time operation is unsafe:
      ( Does it a known bug? 
      
      
      
    4. foundin initialized to: "None"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "tatooguy"
    9. subsystem initialized to: "None"
    10. title initialized to:
       using time operation in tcl is unsafe in multithread app
      
    11. type initialized to: "Bug"
  2. Ticket change [ce8f606d93] (rid 96082) by dgp on 2006-03-01 11:13:46:

    1. assignee changed to: "kennykb"
    2. foundin changed to: "obsolete: 8.3.2"
    3. icomment:
      Logged In: YES 
      user_id=80530
      
      
      Assigned to the [clock]
      maintainer, but you should
      note that version 8.3.2 is
      quite old and [clock] got
      a major rewrite for 8.5, so
      your report may be too out
      of date to act on.
      
      
      
    4. login: "dgp"
    5. mimetype: "text/plain"
    6. subsystem changed to: "06. Time Measurement"
    7. username: "dgp"
  3. Ticket change [4f42075132] (rid 125795) by hobbs on 2007-02-09 08:12:00:

    1. closedate changed to: "2007-02-09T01:12:00"
    2. closer changed to: "hobbs"
    3. icomment:
      Logged In: YES 
      user_id=72656
      Originator: NO
      
      better use of thread-safe functions is already in 8.4 and 8.5
      
      
    4. login: "hobbs"
    5. mimetype: "text/plain"
    6. resolution changed to: "Out of Date"
    7. status changed to: "Closed"
    8. username: "hobbs"