Skip to content
Tcl Source Code History Of Ticket 3033206fffffffffffffffffffffffffffffffff
Login

History Of Ticket 3033206fffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 3033206fffffffffffffffffffffffffffffffff

  1. Ticket change [481a254e60] (rid 99826) by thommey on 2010-07-22 19:39:27:

    1. assignee initialized to: "vasiljevic"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      The thread package includes lib/ttrace.tcl - loaded by [package require Ttrace] - uses $::version to temporarily store the result of [package require Thread] in a catch ("catch {package require Thread} version"). This global variable is unfortunately very likely to be used by applications (embedders mostly?) to hold their own version number. Eggdrop, for example, protects that variable as read-only with a write trace, causing [package require Ttrace] to fail because it can't write to that variable (and even if it could, it would overwrite Eggdrops version number and existing Tcl scripts for Eggdrop rely on it).
      I'd suggest changing it to anything else or a namespace variable.
      
    4. foundin initialized to: "None"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "thommey"
    10. subsystem initialized to: "80. Thread Package"
    11. title initialized to:
      lib/ttrace.tcl uses ::version as temporary variable
      
    12. type initialized to: "Bug"
  2. Ticket change [bcf6b6fa96] (rid 101832) by dkf on 2010-07-26 05:23:42:

    1. assignee changed to: "dkf"
    2. closedate changed to: "2010-07-25T22:23:42"
    3. closer changed to: "dkf"
    4. icomment:
      
      
      allow_comments - 1
      
      Oh, that's Tcl's variable resolution rules. Yuck. Luckily in this case there's a way to write things that avoids the nastiness, changing (effectively) this:
      
          if {![catch {package require Thread} version]} {
              variable tvers $version
              ...
          }
      
      into this:
      
          if {![catch {
              variable tvers [package require Thread]
          }]} {
              ...
          }
      
      That version is hazard-free.
      
      
    5. login: "dkf"
    6. mimetype: "text/plain"
    7. resolution changed to: "Fixed"
    8. status changed to: "Closed"
    9. username: "dkf"