Skip to content
Tcl Source Code History Of Ticket 2390819fffffffff
Login

History Of Ticket 2390819fffffffff

Artifacts Associated With Ticket 2390819fffffffff

  1. Ticket change [7772631986] (rid 89776) by dgp on 2008-12-04 22:07:45:

    1. assignee initialized to: "dgp"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      
      
      
      % proc foo1 {} {
      catch {return -code error zoom} err
      return [list $err zam]
      }
      % proc foo2 {} {
      catch {
      return -code error zoom
      } err
      return [list $err zam]
      }
      
      [foo1] and [foo2] are the same except
      for whitespace, and as expected, they
      produce the same results:
      
      % foo1
      zoom zam
      % foo2
      zoom zam
      
      Next create same routines again, with
      new names, bar1 and bar2:
      
      % proc bar1 {} {
      catch {return -code error zoom} err
      return [list $err zam]
      }
      % proc bar2 {} {
      catch {
      return -code error zoom
      } err
      return [list $err zam]
      }
      
      This time, before compiling and running,
      add a leave trace on [catch] :
      
      % trace add execution catch leave {puts zing! ;#}
      
      and try again:
      
      % bar1
      zing!
      zoom zam
      % bar2
      zing!
      zoom
      
      
      WTF?!?!?
      
      
    4. foundin initialized to: "obsolete: 8.4.19"
    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: "dgp"
    10. subsystem initialized to: "46. Traces"
    11. title initialized to: "[catch] leave trace mystery"
    12. type initialized to: "Bug"
  2. Ticket change [304959f533] (rid 93219) by dgp on 2008-12-05 05:09:52:

    1. icomment:
      
      Then try the whole thing in 8.5.5:
      
      <... cut to the chase ...>
      
      % bar1
      zing!
      zoom zam
      % bar2
      zing!
      2
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  3. Ticket change [8eaabbfc7c] (rid 120151) by dgp on 2013-01-08 02:04:37:

    1. priority changed to: "9 Immediate"
  4. Ticket change [b41338335d] (rid 124962) by dgp on 2013-03-20 03:18:40:

    1. icomment:
      The trouble here is that the trailing " ;# " in 
      the execution trace handler doesn't do what
      the programmer expected.  It doesn't cause all
      arguments passed to the handler to be ignored.
      Instead it causes the leading substring in it up
      to the first newline to be ignored only.  Then it
      starts up again with the rest, which is the command
      [return -code error zoom].  Now that that's being
      eval'd outside the catch, it bubbles up the stack.
      
      At least that's the explanation for the 8.4 results.
      Ugly complex version of pilot error.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  5. Ticket change [78b1ad0e47] (rid 90003) by dgp on 2013-03-20 03:22:13:

    1. icomment:
      
      Corrected demo works fine:
      % info patch
      8.4.19
      % proc report args {puts zing!}
      % trace add execution catch leave report
      % proc bar2 {} {
      catch {
      return -code error zoom
      } err
      return [list $err zam]
      }
      % bar2
      zing!
      zoom zam
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  6. Ticket change [1aba4ce45c] (rid 123031) by dgp on 2013-03-20 03:24:59:

    1. icomment:
      Corrected code also works as expected
      in 8.5 and 8.6.
      
      Remaining mystery is why the pilot error
      version fails differently in 8.5+.  Suspect
      it's something not right in how [catch] gets
      compiled and executed as bytecode.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  7. Ticket change [38d07a3870] (rid 112275) by dgp on 2013-03-21 11:42:12:

    1. closedate changed to: "2013-03-21T04:42:12"
    2. closer changed to: "dgp"
    3. icomment:
      
      
      allow_comments - 1
      
      Re-reported as 3608676 without so
      much noise and confusion.
      
      
    4. login: "dgp"
    5. mimetype: "text/plain"
    6. resolution changed to: "Duplicate"
    7. status changed to: "Closed"
    8. username: "dgp"