Skip to content
Tcl Source Code History Of Ticket 77f0dbc0f8
Login

History Of Ticket 77f0dbc0f8

Artifacts Associated With Ticket 77f0dbc0f8

  1. Ticket change [ed329d62c0] (rid 155223) by danckaert on 2017-07-26 12:00:05:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-wiki"
    4. comment initialized to:
      When running the following code:
      <pre>
      interp create slave
      interp alias slave foo {} master_foo
      proc master_foo {arg} {}
      proc run_in_slave {s} {
          try {
              interp eval slave $s
          } on error {msg options} {
              puts $options
          }
      }
      catch {error "catched error"}
      run_in_slave {foo}
      </pre>
      The output is:
      <pre>
      -errorstack {INNER {returnImm {catched error} {}} CALL {run_in_slave foo}} -errorcode {TCL WRONGARGS} -errorinfo {wrong # args: should be "foo arg"
          invoked from within
      "foo"
          invoked from within
      "interp eval slave $s"} -errorline 3 -code 1 -level 0
      </pre>
      The INNER part int the errorstack refers to a previous error which had already been catched and should not be present anymore. Note that -errorinfo and -errorcode are correct however.
      
    5. foundin initialized to: "8.6.6"
    6. is_private initialized to: "0"
    7. login: "danckaert"
    8. priority initialized to: "5 Medium"
    9. resolution initialized to: "None"
    10. severity initialized to: "Minor"
    11. status initialized to: "Open"
    12. submitter initialized to: "danckaert"
    13. subsystem initialized to: "20. [interp]"
    14. title initialized to: "Wrong errorstack when using slave interp"
    15. type initialized to: "Bug"
  2. Ticket change [0e10381220] (rid 155224) by aspect on 2017-07-27 14:46:03:

    1. icomment:
      This might come from Tcl_GetReturnOptions() not respecting resetErrorStack -
      when it grabs the error stack from the master, the stale error stack gets
      captured and sent into the slave.
      
      https://core.tcl.tk/tcl/artifact/0947f3566cd3dbab?ln=1625
      
      Replacing that line with the following seems to clear it up:
      
              if (iPtr->resetErrorStack) {
                  Tcl_DictObjPut(NULL, options, keys[KEY_ERRORSTACK], Tcl_NewListObj(NULL, 0));
              } else {                                  
                  Tcl_DictObjPut(NULL, options, keys[KEY_ERRORSTACK], iPtr->errorStack);
              }
      
      
      .. but I don't understand why an alias back into the master is needed to
      observe this; someone who knows better should check.
      
    2. login: "aspect"
    3. mimetype: "text/plain"
  3. Ticket change [529ad7e9b9] (rid 155225) by danckaert on 2017-07-31 08:58:15:

    1. icomment:
      With that change, the errorstack only contains CALL {run_in_slave foo}, but it should also contain an INNER {invokeStk1 foo} part, I think.
      
    2. login: "danckaert"
    3. mimetype: "text/plain"