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

History Of Ticket 1338280fffffffff

Artifacts Associated With Ticket 1338280fffffffff

  1. Ticket change [dcb5ed44c8] (rid 114532) by msofer on 2005-10-26 09:53:00:

    1. assignee initialized to: "msofer"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      (neuronstorm reports in clt:
      http://groups.google.com/group/comp.lang.tcl/browse_frm/thread/91073af364234a81/3a1aa30e489f3eb0#3a1aa30e489f3eb0
      
      The following script demonstrates an invalid result
      (empty string element in list) from [info vars
      ?pattern?] during unset traces called during [namespace
      delete].
      
      ----
      
       namespace eval ::ref {}
      
       set ::ref::var1 AAA
       trace add variable ::ref::var1 {unset} [list doTrace]
      
       set ::ref::var2 BBB
       trace add variable ::ref::var2 {unset} [list doTrace]
      
       proc doTrace {vtraced vidx op} {
              puts stdout "'[info vars ::ref::*]'"
       }
      
       namespace delete ::ref
      
       puts stdout "'[info vars ::ref::*]'"
      
      ----
      
      Output on windows Tcl 8.5a4 is:
       '::ref::var1 ::ref::var2'
       '{} ::ref::var2'
       ''
      
      Output on windows Tcl 8.4.5 is:
       '::ref::var1 ::ref::var2'
       '::ref::var2'
       ''
      
      Tcl8.4.7 behaves like 8.4.5, core-8-4-branch like 8.5a4
      
    4. foundin initialized to: "obsolete: 8.4.11"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "msofer"
    9. subsystem initialized to: "07. Variables"
    10. title initialized to: "unset traces during namespace delete misbehave"
    11. type initialized to: "Bug"
  2. Ticket change [062d7ed596] (rid 89175) by msofer on 2005-10-26 19:52:56:

    1. icomment:
      Logged In: YES 
      user_id=148712
      
      On the basis of which versions are buggy, this is presumed
      to be caused by the 2004-05-22 commit.
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  3. Ticket change [4f619d3c14] (rid 125817) by msofer on 2005-10-30 01:58:07:

    1. icomment:
      Logged In: YES 
      user_id=148712
      
      As the order in which the variables are deleted is not
      specified, this script has been modified an added to the
      testsuite as Test trace-18.4:
          namespace eval ::ref {}
          set ::ref::var1 AAA
          trace add variable ::ref::var1 unset doTrace
          set ::ref::var2 BBB
          trace add variable ::ref::var2 {unset} doTrace
          proc doTrace {vtraced vidx op} {
      global info
      append info [catch {set ::$vtraced}][llength [info vars
      ::ref::*]]
          }
          set info {}
          namespace delete ::ref
          rename doTrace {}
          set info
      
      Note that the returned value is 0201 up to 8.4.7, and 0202
      for HEAD and 8-4-branch. 
      
      Note also that the *correct* return value is 1110 - as a
      variable should not exist when it's unset trace is running.
      
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  4. Ticket change [16fd3d394f] (rid 124806) by msofer on 2005-10-30 02:02:53:

    1. icomment:
      Logged In: YES 
      user_id=148712
      
      The fundamental problem is that, when a variable is unset
      due to its namespace being deleted,  the variable exists
      while the unset trace is running:
      
      namespace eval a {trace add variable x unset {puts [catch
      {set ::a::x}];#}; set x 1}
      1
      % unset a::x
      1
      % namespace eval a {trace add variable x unset {puts [catch
      {set ::a::x}];#}; set x 1}
      1
      % namespace delete a
      0
      
      This is a very old bug - just verified that Tcl8.3.4 has it
      too. It is probably also the cause of Bug 1337229.
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. priority changed to: "9 Immediate"
    5. username: "msofer"
  5. Ticket change [fa3a95a566] (rid 91832) by dgp on 2005-11-01 02:25:10:

    1. icomment:
      
      
      File Added - 154563: 1338280.patch
      
      Logged In: YES 
      user_id=80530
      
      attached patch corrects the reported
      problem and passes the test suite.
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  6. Add attachment "1338280.patch" [d1f3111e11] (rid 113442) by dgp on 2005-11-01 02:25:10.

  7. Ticket change [b40de5ef31] (rid 124958) by msofer on 2005-11-01 04:45:32:

    1. icomment:
      Logged In: YES 
      user_id=148712
      
      Patch not committed: it contradicts the comment in
      TclTeardownNamespace:
       /*
        * Start by destroying the namespace's variable table,
        * since variables might trigger traces.
        */
      
      In particular, the patch changes the behaviour of the script:
      
        namespace eval a {
            proc p {} {puts hi}
            trace add variable x unset {a::p;#}
            set x 1
         }
         namespace delete a
      
      which prints 'hi' before the patch, and does not after the
      patch. Note that these comments in the source are the only
      documentation about the ordering of operations during
      namespace deletion.
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  8. Ticket change [0acc6bf725] (rid 113886) by dgp on 2005-11-01 11:26:53:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      the patch does introduce a
      script-visible change, yes.
      
      it's also a simple change
      that fixes this bug and
      allegedly 1337229.
      
      Neither the tcl nor the
      tcllib test suite care about
      the change.
      
      If something does care, then
      let's think harder about this, but
      not until we find something that
      does care.
      
      Crafting a fix for these bugs other
      than the one attached here will
      be very, very tricky indeed.  Unless
      we delay variable unset traces until
      the point where the namespace
      variables are no longer accessible,
      then the access must go somewhere,
      and we're left with the recursive task
      of cleaning *that* up.
      
      I fear we may already have that
      problem with command delete traces.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  9. Ticket change [8f73e53be0] (rid 120276) by dgp on 2005-11-02 22:38:42:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      
      Here's a different patch
      (against 8-4-branch) without
      the incompatibility of the first.
      
      Please look it over.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  10. Ticket change [6ce649c10c] (rid 128600) by dgp on 2005-11-02 22:38:46:

    1. icomment:
      
      
      File Added - 154768: 1338280-84.patch
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  11. Ticket change [1c4d5c9c1c] (rid 90574) by dgp on 2005-11-03 00:10:17:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      
      that patch contained a memory
      leak.  here's the corrected 
      replacement.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  12. Add attachment "1338280-84.patch" [a1c56ac1f6] (rid 109783) by dgp on 2005-11-03 00:10:18.

  13. Ticket change [d1221f55d0] (rid 113298) by dgp on 2005-11-03 00:10:19:

    1. icomment:
      
      
      File Added - 154778: 1338280-84.patch
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  14. Ticket change [d7a5fe1350] (rid 124030) by dgp on 2005-11-03 00:10:20:

    1. icomment:
      
      
      File Deleted - 154768: 
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  15. Ticket change [adf9d4382b] (rid 101550) by msofer on 2005-11-04 09:14:57:

    1. closedate changed to: "2005-11-04T02:14:57"
    2. closer changed to: "msofer"
    3. icomment:
      Logged In: YES 
      user_id=148712
      
      Attached 8.4 patch adapted and committed to both branches.
      
      
    4. login: "msofer"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "msofer"