Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 96fe0fe695256091250b50aaf0e07810c84c3fa9
Ticket: 010f4162efb3bb6546ef904784a13c3c1a615228
Restored trace errors => stammering errorstacks
User & Date: ferrieux on 2013-09-01 00:56:32
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. comment changed to:
    Commit [30b7b8d858] "Fix bug #2438181: Incorrect error reporting in traces" leads to the following "stammering errorstack", where an Enter-traced proc fails to appear as a CALL level; instead, its caller's level is repeated:
    
      proc foo args {}
      proc goo {} foo
      trace add execution foo enter {error bar;#}
      catch goo m d
      puts [dict get $d -errorstack]
    
    =>
    
      INNER {error bar} CALL goo CALL goo
    
    Prior to this commit one would get
    
      INNER {invokeStk1 foo} CALL goo
    
    which avoided the problem by completely hiding the trace's error.
    
    The problem here is that TclLogCommandInfo (which powers the construction of the error stack), called in TEBC after each error, is now also called for the trace's error, thus adding a level; but since we are in an Enter trace, we have not yet updated the interp, which is still essentially in "goo".
    
    Note that the command string passed to TclLogCommandInfo does contain "foo", hence ::errorInfo in this case is (accidentally) more accurate:
    
      bar
        while executing
      "error bar"
        invoked from within
      "foo"
        (procedure "goo" line 1)
        invoked from within
      "goo"
    
    
    Bottom line: we'd need to
    
     - either give a better sync of command string and interp state
    
     - or provide TclLogCommandInfo with a way of detecting this situation to skip the extra level
    
  5. foundin changed to: "30b7b8d858"
  6. is_private changed to: "0"
  7. login: "ferrieux"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "052878a4be90f52d390c8022e271c0c1885d5c80"
  10. resolution changed to: "None"
  11. severity changed to: "Severe"
  12. status changed to: "Open"
  13. submitter changed to: "ferrieux"
  14. subsystem changed to: "46. Traces"
  15. title changed to: "Restored trace errors => stammering errorstacks"
  16. type changed to: "Bug"