Skip to content
Tcl Source Code History Of Ticket 2662380
Login

History Of Ticket 2662380

Artifacts Associated With Ticket 2662380

  1. Ticket change [cd50c22409] (rid 95869) by a3a3el on 2009-03-04 17:01:47:

    1. assignee initialized to: "dgp"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      The following can crash 8.4, 8.5 and 8.6:
      
        array set a [list]
      
        trace variable a w unset_key
      
        proc unset_key { var key op } {
      
          puts stderr "$var, $key, $op"
      
          global a
      
          if { [info exists a($key)] } {
            puts stderr "Unsetting a($key)."
            unset a($key)
          } else {
            puts stderr "Cannot unset a($key)."
          }
      
        }
      
        append a(test) one two
      
      Since 8.4, Tcl_AppendObjCmd has stopped calling Tcl_ObjSetVar2, and calls
      TclPtrSetVar instead.  However, although TclPtrSetVar returns iPtr->emptyObj if
      the variable has been unset by a trace, Tcl_AppendObjCmd is still checking for
      NULL, and so attempts to append the next argument.  I've attached patches for
      the 8.4 and 8.5 branches, and the trunk.
      
      Az.
      
      
    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: "a3a3el"
    10. subsystem initialized to: ""
    11. title initialized to: "Bug in append"
    12. type initialized to: "Bug"
  2. Ticket change [fac61244ca] (rid 91940) by a3a3el on 2009-03-05 00:01:47:

    1. icomment:
      
      
      File Added - 316175: tclVar-8.4.diff
      
      
      
    2. login: "a3a3el"
    3. mimetype: "text/plain"
    4. username: "a3a3el"
  3. Add attachment "tclVar-8.4.diff" [6758ac82ef] (rid 102886) by a3a3el on 2009-03-05 00:01:47.

  4. Ticket change [1665e93b58] (rid 124712) by a3a3el on 2009-03-05 00:02:08:

    1. icomment:
      
      
      File Added - 316176: tclVar-8.5.diff
      
      File Added: tclVar-8.5.diff
      
      
    2. login: "a3a3el"
    3. mimetype: "text/plain"
    4. username: "a3a3el"
  5. Add attachment "tclVar-8.5.diff" [5206d80f34] (rid 126237) by a3a3el on 2009-03-05 00:02:08.

  6. Ticket change [401cb374e2] (rid 121573) by a3a3el on 2009-03-05 00:02:24:

    1. icomment:
      
      
      File Added - 316178: tclVar-trunk.diff
      
      File Added: tclVar-trunk.diff
      
      
    2. login: "a3a3el"
    3. mimetype: "text/plain"
    4. username: "a3a3el"
  7. Add attachment "tclVar-trunk.diff" [8c4e129dff] (rid 127723) by a3a3el on 2009-03-05 00:02:24.

  8. Ticket change [3a298c87b7] (rid 112516) by dkf on 2009-03-05 00:04:36:

    1. priority changed to: "9 Immediate"
  9. Ticket change [061cdc6b41] (rid 89161) by dkf on 2009-04-05 00:34:36:

    1. icomment:
      
      
      data_type - 110894
      
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. subsystem changed to: "46. Traces"
    5. username: "dkf"
  10. Ticket change [aaf7ebd722] (rid 101013) by dkf on 2009-04-05 00:34:52:

    1. foundin changed to: "obsolete: 8.4.19"
  11. Ticket change [004f36d349] (rid 119296) by dgp on 2009-04-08 02:25:39:

    1. icomment:
      
      I see no crash.
      
      On 8.4 I see:
      
      a, test, w
      Unsetting a(test).
      a, test, w
      Cannot unset a(test).
      
      On Tcl 8.5 and HEAD I see an uncaught errors,
      but not always the same one (!).  Either :
      
      a, test, w
      Unsetting a(test).
      can't set "a(test)": upvar refers to element in deleted array
          while executing
      "append a(test) one two"
          (file "/home/dgp/2662380.tcl" line 20)
      
      or this:
      
      a, test, w
      Unsetting a(test).
      can't set "a(test)": upvar refers to variable in deleted namespace
          while executing
      "append a(test) one two"
          (file "/home/dgp/2662380.tcl" line 20)
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  12. Ticket change [98aff6c411] (rid 110653) by dkf on 2009-04-08 03:12:25:

    1. priority changed to: "8"
  13. Ticket change [eb7a2609f1] (rid 103549) by dgp on 2009-04-08 20:32:48:

    1. icomment:
      
      Relevant tests:
      append-7.1
      appendComp-7.1
      namespace-8.6
      trace-16.8,9,10,13,14
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  14. Ticket change [31ead71b26] (rid 93517) by dgp on 2009-04-08 21:42:01:

    1. assignee changed to: "msofer"
    2. icomment:
      
      I modified the test script so that the "Unsetting"
      messages reports the value of the variable about
      to be unset.  Then testing on Tcl releases 7.6p2
      and 8.3.5, I see they agree on this output:
      
      a, test, w
      Unsetting a(test) = one.
      a, test, w
      Unsetting a(test) = two.
      
      Without thinking too deeply about it, 
      I admit, that output also makes sense
      to me.  [append] can operate on
      a name of a non-existent variable,
      creating the variable by making the
      appending write to it.  Write traces
      come after the writing, so at that point
      the variable exists, and the trace can
      unset it.  We end up back where we
      started with no existing variable.
      Multiple arguments to append
      just means we repeat the cycle.
      
      Appears this report is exposing some
      flaws in some of the varName resolution
      caching machinery that's come in releases
      8.4 and later.
      
      Fixing that right may take some time
      and thought (*), and since it appears the
      claims of "crashes" are incorrect, I'll
      leave this one to come back to.
      
      The submitted patches may well be the
      right answer, I'm not sure yet, but the
      flaws exposed are broader and deeper,
      so I'd prefer to be more certain about a
      more complete fix.
      
      (*) or at least some input from msofer. :)
      
      
      
    3. login: "dgp"
    4. mimetype: "text/plain"
    5. username: "dgp"
  15. Ticket change [287d207fb1] (rid 88707) by msofer on 2011-04-12 09:30:37:

    1. foundin changed to: "obsolete: 8.5.9"
    2. icomment:
      Crashes HEAD but not core-8-5-branch as of today. Valgrind however still dislikes it in 8.5
      
      
    3. login: "msofer"
    4. mimetype: "text/plain"
    5. priority changed to: "9 Immediate"
    6. username: "msofer"
  16. Ticket change [97b0155ab3] (rid 110481) by msofer on 2011-04-12 18:39:41:

    1. icomment:
      The "gross change in write traces" covers 2 cases:
      
      * trace undefined the var: in that case, TclPtrSetVar should just clear the var and return NULL
      
      * trace converted the var to an array: so what do we do now? What should append/set/etc return? In 8.4:
      
      % trace add variable x write foo
      % proc foo {name args} {upvar 1 $name x; unset x; set x(1) 1}
      % append x 2
      % set x
      can't read "x": variable is array
      % parray x
      x(1) = 1
      
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  17. Ticket change [85a9c04ab3] (rid 131355) by msofer on 2011-04-13 20:36:26:

    1. icomment:
      fixed in all 3 branches
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  18. Ticket change [6824a85e14] (rid 103014) by msofer on 2011-04-13 20:36:28:

    1. closedate changed to: "2011-04-13T13:36:28"
    2. closer changed to: "msofer"
    3. icomment:
      
      
      allow_comments - 1
      
      
      
    4. login: "msofer"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "msofer"