Skip to content
Tcl Source Code History Of Ticket 2431847
Login

History Of Ticket 2431847

Artifacts Associated With Ticket 2431847

  1. Ticket change [c14292e5ae] (rid 111290) by andygoth on 2008-12-15 21:57:07:

    1. assignee initialized to: "dkf"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      The script:
      
      proc oops {} {
          dict set array(index) poisonous garbage!
          catch {
      dict get $array(index) nonexistent
          }
          puts $::errorInfo
      }
      oops
      
      prints the following:
      
      poisonous garbage!key "nonexistent" not known in dictionary
          while executing
      "dict get $array(index) nonexistent"
      
      The dictionary value is somehow prepended to $errorInfo when [dict get] fails to find the key it's looking for.
      
      This problem does not occur when running at top level (i.e. not inside a proc).  It also does not occur when not using an array (e.g. remove "(index)" from the script).  If [dict get] fails for another reason, such as "missing value to go with key", the dictionary value is not prepended (replace "nonexistent" with "poisonous garbage!" to test).
      
    4. foundin initialized to: "obsolete: 8.6a3"
    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: "andygoth"
    10. subsystem initialized to: "16. Commands A-H"
    11. title initialized to:
      Junk at start of errorInfo when using [dict get] on arrays
      
    12. type initialized to: "Bug"
  2. Ticket change [3ecc649d8f] (rid 121330) by dkf on 2008-12-16 06:09:24:

    1. icomment:
      Caused by fix for issue 1522803, though why the interpreter result isn't clean at that point is odd. Possibly some other fault (related to INST_INVOKE_STK1?) too.
      
      Fixed on HEAD
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  3. Ticket change [2720823720] (rid 88467) by dkf on 2008-12-16 06:30:01:

    1. assignee changed to: "msofer"
    2. icomment:
      Fixed on 8.5 branch as well.
      
      Leaving open and assigned to bytecode engine maintainer for the issue of why the result was not cleared earlier. (Maintainers' note: the [dict set array(index) poisonous garbage!] spills to INST_INVOKE_STK1.)
      
      
    3. login: "dkf"
    4. mimetype: "text/plain"
    5. subsystem changed to: "47. Bytecode Compiler"
    6. username: "dkf"
  4. Ticket change [82b5e19389] (rid 117272) by ferrieux on 2008-12-16 07:27:06:

    1. icomment:
      Simplified repro: no [catch], no array element, no [dict set] !
      
        proc foo {} {return yo}
        proc oops3 {} {
          foo
          dict get {} nonex
        }
        oops3
        => yokey "nonex" not known in dictionary
      
      I think there is a hole in the ResetResultReform. The [dict get] code does an AppendResult assuming an invariant.
      So either fix that invariant or use ResetResult again...
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  5. Ticket change [7038d20e73] (rid 100440) by ferrieux on 2008-12-16 22:10:57:

    1. icomment:
      OK after a bit of cvs history diving, I have the impression that the ResetResult reform by miguel on
      [revision 1.239, Fri Jul 21 10:47:18 2006 UTC] of tclExecute.c did include one unwanted commenting out of Tcl_ResetResult().
      
      Indeed that reform was a positive move turning a random scattering of ResetResults into a few well-selected ones. But I fear the "removal" part was made in a rather automatic way (miguel correct me if I'm wrong), and (quite forgivably) overlooked the special case id [dict get] which is still required because it is coupled with a Tcl_AppendResult preparing an error message.
      
      So I think this Tcl_ResetResult should have stayed here.
      However Donal, you fixed it by emulating it at a lower level: TclNewObj+Tcl_SetObjResult. Can you explain why ?
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  6. Ticket change [7d60faedc9] (rid 97229) by dkf on 2008-12-16 22:19:58:

    1. icomment:
      Expected a lower actual overhead that way.
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  7. Ticket change [39ae943bf0] (rid 112433) by ferrieux on 2008-12-16 22:25:46:

    1. icomment:
      Ouch... Why only there ? Can you specify in what situations this optimization is valid ? In that case why not define a Tcl_FastResetResult ?
      (I'm a bit weary about peephole optimizations in arbitrary places, not driven by mesaurements, and decreasing readability...)
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  8. Ticket change [b29e8e6d6f] (rid 98364) by dgp on 2008-12-16 22:28:16:

    1. icomment:
      
      I think Alex is correct, and a full Tcl_ResetResult()
      needs to be restored.  See this demo script:
      
      % proc demo {} {
      return -level 0 -code ok -noisy stuff
      dict get {} noex
      }
      % catch demo m o
      1
      % set o
      -noisy stuff -code 1 -level 0 -errorcode NONE -errorinfo {key "noex" not known in dictionary
          while executing
      "dict get {} noex"
          (procedure "demo" line 3)
          invoked from within
      "demo"} -errorline 1
      
      
      See how the "-noisy stuff" is leaking
      into the unrelated error in [dict get].
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  9. Ticket change [87ab1ada4d] (rid 131740) by ferrieux on 2008-12-16 22:51:47:

    1. closedate changed to: "2008-12-16T15:51:47"
    2. closer changed to: "ferrieux"
    3. icomment:
      Thanks Don. Committed.
      
      
      
    4. login: "ferrieux"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "ferrieux"
  10. Ticket change [10064d485a] (rid 94891) by dgp on 2008-12-16 23:12:57:

    1. icomment:
      
      So the commit doesn't change the leaky
      return options.  I think that's another
      bug.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  11. Ticket change [684c35cb16] (rid 103043) by ferrieux on 2008-12-16 23:15:53:

    1. icomment:
      Right. Expecting your submission any time soon :)
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  12. Ticket change [4b1aea4bfa] (rid 126640) by dgp on 2008-12-16 23:24:29:

    1. assignee changed to: "ferrieux"
    2. icomment:
      
      Sorry.  Gotta take care testing
      with shared libraries.
      
      There *is* another bug with
      leaky options, but not any longer
      with the demo scripts here.
      
      
    3. login: "dgp"
    4. mimetype: "text/plain"
    5. username: "dgp"
  13. Ticket change [eb6201b71e] (rid 103537) by dgp on 2008-12-16 23:27:44:

    1. icomment:
      
      Don't forget to backport the fix
      for 8.5.6 too.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  14. Ticket change [dfd3dea0f3] (rid 115084) by ferrieux on 2008-12-17 05:25:15:

    1. icomment:
      Done :)
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"