Skip to content
Tcl Source Code History Of Ticket 730244ffffffffff
Login

History Of Ticket 730244ffffffffff

Artifacts Associated With Ticket 730244ffffffffff

  1. Ticket change [cc65b7873f] (rid 95690) by dgp on 2003-04-30 15:34:56:

    1. assignee initialized to: "msofer"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      
      This script panics:
      
      interp create i
      proc test args {puts $args}
      trace add execution test enter {interp alias i alias {} ;#}
      interp alias i alias {} test this
      i eval alias
      
      The problem is that TEOVI does not use
      refCounting to protect the elements of
      the objv array.  So if a trace frees an
      argument value, that value is not available
      for command procedure execution.
      
      Most TEOVI callers manage refCounts,
      but Tcl_EvalObjv does not; thus interp alias
      calls do not.
      
      A fix is to add objv refCounting to Tcl_EvalObjv,
      at an unknown performance cost.
      
      Thoughts?
      
    4. foundin initialized to: "obsolete: 8.4.2"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "dgp"
    9. subsystem initialized to: "45. Parsing and Eval"
    10. title initialized to: "missing refCount management in Tcl_EvalObjv"
    11. type initialized to: "Bug"
  2. Ticket change [021a050bcd] (rid 119589) by msofer on 2003-04-30 22:40:40:

    1. icomment:
      Logged In: YES 
      user_id=148712
      
      Another fix is to document that TEOV requires that the
      caller hold a counted reference to its arguments, and insure
      that all core calls respect this. No performance cost for
      bytecodes (which do not suffer this problem), more
      complexity ...
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  3. Ticket change [c7860f769b] (rid 121944) by dgp on 2003-04-30 22:51:35:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      
      there's any number of solutions, but it's best
      not to get too tricky, and expecially best not
      to let the trickiness escape to the public interface.
      
      Would be best if each routine in the core managed
      refCounts according to its own needs rather than
      serving callers, or called routines.
      
      TEOVI is what needs refCounts, to preserve objs
      across trace and normal execution calls.
      
      Tcl_EvalEx, for example, currently does incr/decr
      of refcounts, even though it doesn't really need to.
      It does only one thing with objv, pass it in to TEOVI.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  4. Ticket change [99d677221b] (rid 110856) by dgp on 2003-04-30 23:26:28:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      
      this issue combined with
      TclInterpReady checks
      and numLevels management
      suggest that the TEOVI callers
      in tclBasic.c really have different
      needs from the caller in tclExecute.c.
      
      Another level of wrapping could help here.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  5. Ticket change [628979c900] (rid 92422) by msofer on 2003-04-30 23:49:58:

    1. icomment:
      Logged In: YES 
      user_id=148712
      
      The TclInterpReady difference may actually be a bug in TEBC:
      [Bug 495830]
      
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  6. Ticket change [d1ec20146b] (rid 113435) by dgp on 2003-05-01 00:58:48:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      
      my comment about Tcl_EvalEx's need
      for refCounts was incorrect.  Since it
      pulls values from the interp result, it
      needs to claim each one before moving
      on to do substitutions for the next one.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  7. Ticket change [cd5788d4bd] (rid 95875) by dkf on 2003-05-13 04:41:03:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      Looks like a bug in alias handling to me.The problem is that
      the deleting of the alias makes the refcounts on the
      (leading) arguments decrease at an unexpected time,
      resulting in the refcounts for the command obj dropping to
      zero before the return of Tcl_EvalObjv (so violating the
      general contractural principle of Tcl_Eval* functions.)
      Traces are the most obvious way of triggering this, yes, but
      I'd hate to swear that that's the only way it could happen.
      Two ways to fix this:
          1) incr the refcounts of the prefix part of the alias
      command for the duration of the alias call
          2) decouple the Alias structure from the alias command
      lifespan, and use refcounting to delete *that* only when the
      last reference to it (whether from the command or from the
      executing instances) goes away.
      
      I prefer the second way, but the first would do too.  I
      don't think either will be too expensive in practice.
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  8. Ticket change [453efcaa01] (rid 99319) by dgp on 2003-05-13 05:36:17:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      Fix committed for 8.4.3 and 
      to the HEAD for the panic
      in the example script.  Fix
      does refCounting on the words
      of the target of an interp alias,
      to make up for the fact that
      Tcl_EvalObjv doesn't take care
      of itself.
      
      Leaving this report open until
      we get Tcl_EvalObjv itself changed,
      or good documentation on what 
      callers must do to protect themselves.
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  9. Ticket change [38bcb7b153] (rid 112259) by msofer on 2005-02-10 08:15:54:

    1. icomment:
      Logged In: YES 
      user_id=148712
      
      I tend to agree with donal: refcount the Alias structure.
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  10. Ticket change [9cbdafa0bd] (rid 96198) by msofer on 2005-02-10 08:18:26:

    1. icomment:
      Logged In: YES 
      user_id=148712
      
      The general rule should be: any objv array passed to a Tcl
      function should be guaranteed (by the caller) to be valid
      until the function returns.  
      
      Thisbug is related to 1119369, as noted by dgp
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  11. Ticket change [9ea0d48912] (rid 96511) by dgp on 2005-02-10 08:26:16:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      That judgment is reasonable;  from
      that perspective, this is a documentation
      bug.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  12. Ticket change [0271e67592] (rid 119649) by msofer on 2006-10-01 02:37:23:

    1. closedate changed to: "2006-09-30T19:37:23"
    2. closer changed to: "msofer"
    3. icomment:
      Logged In: YES 
      user_id=148712
      
      Doc bug seems reasonable. What's the place to document these
      general features? Should we add a special man page or README
      file for extenders?
      
      
    4. login: "msofer"
    5. mimetype: "text/plain"
    6. status changed to: "Pending"
    7. username: "msofer"
  13. Ticket change [0742b7871f] (rid 89360) by dgp on 2006-10-01 09:39:42:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      
      Unless I'm missing something,
      it's callers of Tcl_EvalObjv()
      that need to take precautions
      so the docs for Tcl_EvalObjv()
      are where the issue needs to be
      made clear.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. status changed to: "Open"
    5. username: "dgp"
  14. Ticket change [a915da6354] (rid 99096) by msofer on 2006-10-01 20:35:39:

    1. closedate changed to: "2006-10-01T13:35:39"
    2. closer changed to: "msofer"
    3. icomment:
      Logged In: YES 
      user_id=148712
      
      Added the comment to doc/Eval.3.
      
      My point was: the elements of every objv array passed to Tcl
      should be valid until return, not only in the case of TEOVI.
      Where are such "general rules" documented?
      
      
    4. login: "msofer"
    5. mimetype: "text/plain"
    6. status changed to: "Pending"
    7. username: "msofer"
  15. Ticket change [fbf38336c3] (rid 108148) by sf-robot on 2006-10-16 09:20:05:

    1. closedate changed to: "2006-10-16T02:20:05"
    2. closer changed to: "sf-robot"
    3. icomment:
      Logged In: YES 
      user_id=1312539
      
      This Tracker item was closed automatically by the system. It was
      previously set to a Pending status, and the original submitter
      did not respond within 14 days (the time period specified by
      the administrator of this Tracker).
      
      
    4. login: "sf-robot"
    5. mimetype: "text/plain"
    6. status changed to: "Closed"
    7. username: "sf-robot"