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

History Of Ticket 2140628fffffffff

Artifacts Associated With Ticket 2140628fffffffff

  1. Ticket change [64f7296383] (rid 92866) by mad_derf on 2008-10-01 16:03:31:

    1. assignee initialized to: "msofer"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      With the latest Tcl (8.5.4), the errorInfo variable does not seem to be set at tclsh initialisation.
      
      The issue being that, if one does :
      
      set errorInfo
      
      Then we get :
      
      can't read "savedErrorInfo": no such variable
          while executing
      "set ::errorInfo $savedErrorInfo"
      
      In init.tcl (unknown proc) , there are two ways to fix the issue. Either :
      
          catch {set $::errorInfo} savedErrorInfo
          catch {set $::errorCode} savedErrorCode
      
      Which will return :
      
      can't read "::errorInfo": no such variable
      
      When performing the "set errorInfo"
      
      The second solution being :
      
          if {[info exists ::errorInfo]} {
      set savedErrorInfo$::errorInfo
          } else {
      set savedErrorInfo""
          }
      
          if {[info exists ::errorInfo]} {
      set savedErrorCode$::errorCode
          } else {
      set savedErrorCode""
          }
      
      Which seems to be the cleanest one since it keeps the behaviour of Tcl 8.4
      
      Hope this helps
      
      DERF
      
    4. foundin initialized to: "obsolete: 8.5.4"
    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: "mad_derf"
    10. subsystem initialized to: "07. Variables"
    11. title initialized to: "errorInfo variable is not set at tclsh init"
    12. type initialized to: "Bug"
  2. Ticket change [aa99a41ca6] (rid 100952) by dgp on 2008-10-02 02:22:57:

    1. assignee changed to: "dgp"
    2. priority changed to: "8"
  3. Ticket change [80d5191a84] (rid 116940) by dgp on 2008-10-02 02:34:26:

    1. icomment:
      
      Can you describe an actual
      programming scenario where
      you want ::errorInfo to have
      a value before any error has
      been raised in the interp?
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  4. Ticket change [458ace9317] (rid 99369) by dgp on 2008-10-02 02:43:02:

    1. closedate changed to: "2008-10-01T19:43:02"
    2. closer changed to: "dgp"
    3. icomment:
      
      Looking more carefully, it appears
      things are working correctly.  The
      variable ::errorInfo holds the
      stack trace from the most recent
      error, whether it unwound all the
      way, or whether a [catch] contained
      it.  In an interactive interp like
      you are testing, the [history]
      and auto-loading machinery are active,
      and the stack trace you see is one
      created when an error is caught
      within the workings of [unknown].
      
      
    4. login: "dgp"
    5. mimetype: "text/plain"
    6. resolution changed to: "Invalid"
    7. status changed to: "Pending"
    8. username: "dgp"
  5. Ticket change [3c1c6d7ed1] (rid 120863) by dgp on 2008-10-02 03:40:34:

    1. icomment:
      
      The init.tcl file in Tcl 8.4
      includes the lines:
      
      set errorCode ""
      set errorInfo ""
      
      I'm not convinced this is
      a change that needs "fixing",
      but if that does end up being
      desired, the proper fix is
      just to restore those lines.
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. title changed to: "errorInfo variable is not set at Tcl_Init()"
    5. username: "dgp"
  6. Ticket change [cc97c343ff] (rid 95727) by dgp on 2008-10-02 03:40:50:

    1. subsystem changed to: "38. Init - Library - Autoload"
  7. Ticket change [e3b9af2150] (rid 87844) by sf-robot on 2008-10-16 09:21:35:

    1. closedate changed to: "2008-10-16T02:21:35"
    2. closer changed to: "sf-robot"
    3. icomment:
      This Tracker item was closed automatically by the system. It was
      previously set to a Pending status, and the original submitter
      did not respond within 14 days (the time period specified by
      the administrator of this Tracker).
      
      
    4. login: "sf-robot"
    5. mimetype: "text/plain"
    6. status changed to: "Closed"
    7. username: "sf-robot"
  8. Ticket change [93d057e682] (rid 105869) by mad_derf on 2008-10-16 14:02:31:

    1. icomment:
      Well, a simple testcase is to start tclsh and issue 'set errorInfo'. At the very least I would get 'can't read errorInfo : no such variable' ... or, to be backward compatible, have the errorInfo set to nothing.
      
      But in no case it should report what it reports, this has nothing to do with getting the value of uninitialised errorInfo ...
      
      
    2. login: "mad_derf"
    3. mimetype: "text/plain"
    4. username: "mad_derf"
  9. Ticket change [ebb782c05c] (rid 103578) by ferrieux on 2008-10-16 18:22:00:

    1. icomment:
      Don, I think there is a confusion here. While I agree with you that defining a contract for the initial value of errorInfo is uninteresting, a side effect of this report is for us to notice that, within [unknown], the code for saving/restoring errorInfo is ugly. More precisely, that code has the two following behaviors:
      
          (1) precond: errorInfo is set; postcond: errorInfo is restored to this value
      
          (2) precond: errorInfo is not set; postcond: errorInfo is *set* to the error message internally produced (though caught) when attempting to read it !
      
      (1) is the dominant case, and was also the only case in 8.4 since we never entered [unknown] with errorInfo unset (unless the user typed [unset ::errorInfo] of course)
      
      (2) is a more recently exposed case, and is a bug.
      
      The fix, by the way, is trivial:
      
      --- orig-init.tcl2008-10-16 11:50:31.863767000 +0200
      +++ init.tcl2008-10-16 13:20:06.779931000 +0200
      @@ -250,9 +250,18 @@
       dict incr opts -level
       return -options $opts $result
           }
      -
      -    catch {set savedErrorInfo $::errorInfo}
      -    catch {set savedErrorCode $::errorCode}
      +    if {[info exists ::errorInfo]} {
      +set savedErrorInfo $::errorInfo
      +set unsetErrorInfo 0
      +} else {
      +set unsetErrorInfo 1
      +}
      +    if {[info exists ::errorCode]} {
      +set savedErrorCode $::errorCode
      +set unsetErrorCode 0
      +} else {
      +set unsetErrorCode 1
      +}
           set name $cmd
           if {![info exists auto_noload]} {
       #
      @@ -275,8 +284,8 @@
           unset UnknownPending
       }
       if {$msg} {
      -    catch {set ::errorCode $savedErrorCode}
      -    catch {set ::errorInfo $savedErrorInfo}
      +    catch {if {$unsetErrorCode} {unset ::errorCode} else {set ::errorCode $savedErrorCode}}
      +    catch {if {$unsetErrorInfo} {unset ::errorInfo} else {set ::errorInfo $savedErrorInfo}}
           set code [catch {uplevel 1 $args} msg opts]
           if {$code ==  1} {
       #
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. status changed to: "Open"
    5. username: "ferrieux"
  10. Ticket change [71e381a637] (rid 100762) by dgp on 2008-10-16 20:26:59:

    1. resolution changed to: "Remind"
    2. title changed to: "[unknown] should leave no tracks"
  11. Ticket change [779a44174e] (rid 89804) by dgp on 2008-10-16 22:36:02:

    1. icomment:
      
      1063707 is releated.
      
      Reading some commit messages, a key
      constraint why [unknown] must preserve
      these global variables is that the
      old [::bgerror] scheme relies on them
      as a side channel for passing useful
      information, and in some situations
      (notably default Tk) the [::bgerror]
      command is auto-loaded.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  12. Ticket change [ced9455461] (rid 112853) by ferrieux on 2008-10-16 22:58:37:

    1. icomment:
      The patch previously sent does preserve these globals, and in addition preserves their "unset" state.
      Do you have objections against applying it ?
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  13. Ticket change [c360395348] (rid 111649) by dgp on 2008-10-16 23:09:29:

    1. closedate changed to: "2008-10-16T16:09:29"
    2. closer changed to: "dgp"
    3. icomment:
      
      fixed on HEAD and for 8.5.6.
      
      
    4. login: "dgp"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "dgp"
  14. Ticket change [b182f32151] (rid 98159) by mad_derf on 2008-10-16 23:10:07:

    1. icomment:
      *laughing mode on*
      You're talkin' to me ?
      *laughing mode off*
      
      Well, not sure who the "do *you* have any objections" refers to ..
      
      Thanks
      
      DERF
      
      
    2. login: "mad_derf"
    3. mimetype: "text/plain"
    4. resolution changed to: "Remind"
    5. status changed to: "Open"
    6. username: "mad_derf"
  15. Ticket change [292ea8969b] (rid 88831) by ferrieux on 2008-10-16 23:28:17:

    1. icomment:
      Don, while I have to admit your coding style is more elegant than mine, I wonder:
      In the committed code you
      
           unset -nocomplain ...
           if {...} {set ...}
      
      So this means that in the nominal case you always unset-set in a short sequence.
      I'd have rather put the [unset] in the [else]:
      
           if {...} {set ...} else {unset ...}
      
      
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  16. Ticket change [5d0f481e4f] (rid 115392) by dgp on 2008-10-17 00:01:29:

    1. closedate changed to: "2008-10-16T17:01:29"
    2. closer changed to: "dgp"
    3. status changed to: "Closed"