Skip to content
Tcl Source Code History Of Ticket 218347
Login

History Of Ticket 218347

Artifacts Associated With Ticket 218347

  1. Ticket change [2f23f34475] (rid 93008) by nobody on 2000-10-26 00:56:33:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      OriginalBugID: 4058 Bug
      Version: 8.2.3
      SubmitDate: '2000-01-21'
      LastModified: '2000-03-06'
      Severity: MED
      Status: Closed
      Submitter: techsupp
      ChangedBy: hobbs
      OS: Linux-Red Hat
      OSVersion: RedHat Linux 5.2, Kernel 2.0.36
      Machine: Pentium, Pentium II
      FixedDate: '2000-10-25'
      ClosedDate: '2000-03-06'
      
      
      Name:
      
      Usman Muzaffar
      
      
      Extensions:
      
      no extensions, Tcl 8.2.3 (and 8.0.3) out of the box
      
      
      CustomShell:
      
      no modifications
      
      
      Comments:
      
      I found this while trying to write a catch phrase that reformats
      
      the contents of errorInfo. I simply needed access to the stack at
      
      the time of error. errorInfo of course seemed ideal, but I kept noticing
      
      duplicate entries.
      
      
      ReproducibleScript:
      
      The problem is simply that if a function foo contains an error, the
      
      errorInfo stack strace from will incorrectly list 'foo' TWICE, if both
      
      of the following conditions are true:
      
      1. foo is automatically sourced
      
      2. foo is passed arguments that extend over multiple line
      
      
      Two files are needed to show the problems:
      
      
      proc2.tcl:::::::::::::::::
      
      proc proc2 {x} {
      
          error "proc2 error"
      
      }
      
      
      main.tcl:::::::::::::::::::
      
      set auto_index(proc2) {source ./proc2.tcl}
      
      proc proc1 {x} {
      
          error "proc1 error"
      
      }
      
      
      proc main {} {
      
          proc2 {
      
      bogus
      
          }
      
      }
      
      main
      
      
      Run program ::::::::::::::::
      
      % tclsh main.tcl
      
      
      ObservedBehavior:
      
      This is what you get when you run main.tcl.
      
      Notice that proc2 is listed in the stack trace TWICE.
      
      
      proc2 error
      
          while executing
      
      "error "proc2 error""
      
          (procedure "proc2" line 2)
      
          invoked from within
      
      "proc2 {
      
          invoked from within
      
      "proc2 {
      
      bogus
      
          }"
      
          (procedure "main" line 2)
      
          invoked from within
      
      "main"
      
          (file "main.tcl" line 11)
      
      
      DesiredBehavior:
      
      What I expect is to see proc2 listed only once. In main.tcl change
      
      the call 'proc2' to 'proc1' in the procedure 'main'. proc1 is identical
      
      to proc2, but it's not dynamically loaded. This time you get:
      
      
      proc1 error
      
          while executing
      
      "error "proc1 error""
      
          (procedure "proc1" line 2)
      
          invoked from within
      
      "proc1 {
      
      bogus
      
          }"
      
          (procedure "main" line 2)
      
          invoked from within
      
      "main"
      
          (file "main.tcl" line 11)
      
      
      Note that proc1 is only on the stack once. Interestingly, if you call proc2
      
      (the dynamic proc), but don't include the newlines around it's argument,
      
      you also get a correct errorInfo. 
      
      
      Delete the newlines around the word 'bogus', so that the body of 'main'
      
      looks like this:
      
         proc2 {bogus    }
      
      
      Now run:proc2 error
      
          while executing
      
      "error "proc2 error""
      
          (procedure "proc2" line 2)
      
          invoked from within
      
      "proc2 {bogus    }"
      
          (procedure "main" line 2)
      
          invoked from within
      
      "main"
      
          (file "main.tcl" line 9)
      
      
      Which is what I'd expect. So it would seem that both the conditions listed above
      
      must be true: 1) the proc must be dynamically loaded and 2) it must be
      
      called with args that span newlines.
      
      
      
      
      For error cases, it is arguable whether the errorInfo should include
      data that indicates use of unknown.  This has been the way in the past,
      and we're going to leave it that way (it does after all indicate a
      different path taken, which is the case).  The spanning of newlines
      is a red herring, because for that line only the first line of the
      calling proc is included (errorInfo doesn't not contain all info). 
      -- 03/06/2000 hobbs
      
    4. foundin initialized to: "final: 8.2.3"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "69. Other"
    10. title initialized to:
      errorInfo has duplicate stack entries for autoloaded procs
      
    11. type initialized to: "Bug"
  2. Ticket change [50a399f8fb] (rid 126009) by welch on 2000-10-26 08:20:07:

    1. closedate changed to: "2000-10-26T01:20:07"
    2. closer changed to: "welch"
    3. priority changed to: "2"
    4. resolution changed to: "Fixed"
    5. status changed to: "Closed"
  3. Ticket change [0c65a7482f] (rid 114169) by dgp on 2001-04-23 03:55:49:

    1. closedate changed to: "2001-04-22T20:55:49"
    2. closer changed to: "dgp"
    3. icomment:
      Logged In: YES 
      user_id=80530
      
      Duplicates 219280
      
      
    4. login: "dgp"
    5. mimetype: "text/plain"
    6. resolution changed to: "Duplicate"
    7. subsystem changed to: "38. Init - Library - Autoload"
    8. username: "dgp"