Skip to content
Tcl Source Code History Of Ticket 760947ffffffffffffffffffffffffffffffffff
Login

History Of Ticket 760947ffffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 760947ffffffffffffffffffffffffffffffffff

  1. Ticket change [48330313ae] (rid 99841) by yahalom on 2003-06-26 04:02:58:

    1. assignee initialized to: "dkf"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      Tcl Version 8.4.3
      OS Platform and Version: windows 2000,linux redhat 7.3
      
      when putting a trace on command execution leave the 
      errorInfo and errorCode are not being set properly when 
      an error happens in the command being called
      
      proc traceLog {cmd info {result ""} {op ""}} {
      puts "----- trace -----"
      puts "command: $cmd"
      puts "info: $info"
      puts "result: $result"
      puts "op: $op"
      puts "----- leave trace -----"
      }
      proc test {} {
      error "testMsg" "testInfo" "testCode"
      }
      for {set i 0} {$i<2} {incr i} {
      catch {test} msg
      puts "message: $msg"
      puts "errorInfo: $errorInfo"
      puts "errorCode: $errorCode"
      unset msg
      unset errorCode
      unset errorInfo
      trace add execution test leave {traceLog}
      }
      
      result:
      
      message: testMsg
      errorInfo: testInfo
          (procedure "test"
          invoked from with
      "test"
      errorCode: testCode
      ----- trace -----
      command: test
      info: 1
      result: testMsg
      op: leave
      ----- leave trace ---
      message: testMsg
      errorInfo: testMsg
          while executing
      "test"
      errorCode: NONE
      
    4. foundin initialized to: "obsolete: 8.4.3"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "yahalom"
    9. subsystem initialized to: "18. Commands M-Z"
    10. title initialized to: "trace on command leave changes errorInfo/errorCode"
    11. type initialized to: "Bug"
  2. Ticket change [93a129ca25] (rid 105849) by dkf on 2003-06-26 17:24:07:

    1. subsystem changed to: "46. Traces"
  3. Ticket change [1201eb7c69] (rid 95243) by dgp on 2003-06-26 22:46:50:

    1. assignee changed to: "dgp"
  4. Ticket change [0b57bced23] (rid 113967) by dgp on 2003-07-16 19:58:26:

    1. priority changed to: "9 Immediate"
  5. Ticket change [0765241875] (rid 89391) by dgp on 2003-07-18 02:53:35:

    1. assignee changed to: "vincentdarley"
    2. icomment:
      Logged In: YES 
      user_id=80530
      
      
      Can I get another TIP 62 ruling?
      
      Is this intended behavior?
      
      
    3. login: "dgp"
    4. mimetype: "text/plain"
    5. username: "dgp"
  6. Ticket change [a804666681] (rid 98904) by vincentdarley on 2003-07-18 17:33:15:

    1. icomment:
      Logged In: YES 
      user_id=32170
      
      Well, the manpage states (for 'leave' and 'leavestep' traces):
      
      "If an error occurs while executing the command body, then 
      the command name as a whole will return that same error."
      
      The result above does look a little peculiar, although I don't 
      really know enough about error(Code|Info) to be sure what 
      the correct result should be.
      
      In some sense if there's a leave trace on 'foo', then the result 
      ought to be nearly identical to that obtained by manually 
      replacing every occurrence of 'foo' in one's code by 'foo ; 
      tracecmd foo ...'. (Obviously this is complicated by additional 
      arguments, and by the cases where foo throws an error itself).
      
      
      
      
    2. login: "vincentdarley"
    3. mimetype: "text/plain"
    4. username: "vincentdarley"
  7. Ticket change [8d08c91d6f] (rid 127851) by dgp on 2003-07-18 21:55:22:

    1. assignee changed to: "dgp"
    2. priority changed to: "8"
  8. Ticket change [b4991d8215] (rid 125068) by dgp on 2003-10-09 00:12:01:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      re-reading this, it seems that comment
      in the docs makes either no sense,
      or only tautological sense.  In context
      "command" refers to the handler command,
      not the traced command.  The name of
      the traced command is known as "name"
      in context.
      
      Ahhh... hold on.  TIP 62 has the correct
      specification.  This is a typo in the man page.
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  9. Ticket change [02d56c6e16] (rid 119717) by dgp on 2003-10-09 00:55:30:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      updated the docs to be the
      same as TIP 62.
      
      Unfortunately, the documented
      behavior isn't completely 
      possible, and isn't directly
      "on point" for this report.
      
      It's not possible, because multiple
      execution traces may be set on
      a single command, and if more that
      one trace raises an error, it's not
      possible for all of those error to become
      the error of the traced command.
      
      Generally error management during
      execution tracing is way under-specified.
      
      The issue in this report deals with a
      simpler situation, where the traces
      themselves raise no errors, but corrupt
      the extra error information produced
      by the traced command.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  10. Ticket change [dd7971b887] (rid 114676) by dgp on 2003-10-09 03:37:06:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      
      seems the way to fix this is to
      save and restore the values
      of ::errorCode and ::errorInfo
      around the calling of leave traces.
      
      potential problem is that this
      will also cause any read
      and write traces on those
      variables to fire.
      
      Seems it's not a safe enough
      change to explore in time
      for 8.4.5.  May need more
      detailed sorting out and
      testing through 8.5a development.
      
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. priority changed to: "5 Medium"
    5. username: "dgp"
  11. Ticket change [17c8a9dc1f] (rid 122555) by dgp on 2003-10-09 03:58:33:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      seems it's even worse that that.
      While execution traces are
      handled completely within
      TclEvalObjvInternal(), the
      management of errorCode
      and errorInfo is all over the
      place, so simple attempt to
      fix this do not even work.
      The real culprit may be
      the Tcl_ResetResult()
      embedded inside the execution
      of the leave traces, which cause
      the errorInfo and errorCode
      machinery to get reset,
      upsetting the expectations
      of the [error] command,
      which wants Tcl_LogCommandInfo
      to respect the ERR_ALREADY_LOGGED
      and ERROR_CODE_SET
      flags that it set.
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  12. Ticket change [2e9ad14327] (rid 92922) by dgp on 2003-10-09 05:03:42:

    1. assignee changed to: "msofer"
    2. icomment:
      
      
      File Added - 63814: 760947.patch
      
      Logged In: YES 
      user_id=80530
      
      
      Ha!  Yes, that's it.  Just needed
      to get the flags right.  Here's a
      patch that makes the demo
      script act as expected, and
      I think it does no damage.
      Passing to another maintainer
      for a second opinion.
      
      
      
      
    3. login: "dgp"
    4. mimetype: "text/plain"
    5. priority changed to: "8"
    6. username: "dgp"
  13. Ticket change [202cfd2e1b] (rid 91270) by msofer on 2003-10-09 05:46:19:

    1. assignee changed to: "dgp"
    2. icomment:
      Logged In: YES 
      user_id=148712
      
      Second opinion: I'm pretty sure it does no damage, but I do
      not claim to really grok traces . Testsuite seems happy too ...
      
      
    3. login: "msofer"
    4. mimetype: "text/plain"
    5. username: "msofer"
  14. Ticket change [d9b8e08eb0] (rid 107656) by dgp on 2003-10-09 06:06:10:

    1. icomment:
      
      
      File Added - 63817: 760947.patch
      
      Logged In: YES 
      user_id=80530
      
      
      Revised patch takes more care
      to only save/restore the bits
      that control error information.
      That should ease any safety
      concerns (deleted or safe
      interps getting modified, etc...)
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  15. Add attachment "760947.patch" [88ba2c3d57] (rid 131910) by dgp on 2003-10-09 06:06:10.

  16. Ticket change [2fc382d7ce] (rid 93129) by dgp on 2003-10-09 06:06:11:

    1. icomment:
      
      
      File Deleted - 63814: 
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  17. Ticket change [be62acad3b] (rid 102063) by dgp on 2003-10-09 06:11:18:

    1. icomment:
      
      
      File Added - 63818: 760947-HEAD.patch
      
      Logged In: YES 
      user_id=80530
      
      Corresponding patch for the HEAD
      must also save/restore return
      options (TIP 90).
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  18. Add attachment "760947-HEAD.patch" [90a73d8fb6] (rid 120489) by dgp on 2003-10-09 06:11:18.

  19. Ticket change [e926b68062] (rid 104764) by dgp on 2003-10-09 06:18:42:

    1. closedate changed to: "2003-10-08T23:18:42"
    2. closer changed to: "dgp"
    3. icomment:
      Logged In: YES 
      user_id=80530
      
      
      Fixed for 8.4.5+.
      
      
    4. login: "dgp"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "dgp"