Skip to content
Tcl Source Code History Of Ticket 456892ffff
Login

History Of Ticket 456892ffff

Artifacts Associated With Ticket 456892ffff

  1. Ticket change [db748d6506] (rid 107963) by nobody on 2001-08-30 15:37:45:

    1. assignee initialized to: "nijtmans"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      [belinda 6]--> tclsh8.4
      % parray tcl_platform
      tcl_platform(byteOrder) = bigEndian
      tcl_platform(machine)   = sun4u
      tcl_platform(os)        = SunOS
      tcl_platform(osVersion) = 5.7
      tcl_platform(platform)  = unix
      tcl_platform(threaded)  = 1
      tcl_platform(user)      = chall
      % puts $tcl_patchLevel
      8.4a3
      % proc mt_lslice {l s} {
          set r [list]    
          foreach i $l {
              lappend r [lindex $l $i]
          }   
          return $r
      }
      mt_lslice [list a b c d e f] [list 1 3 5]
      Tcl_AppendStringsToObj called with shared object
      Abort (core dumped)
      
      Of course, my proc is wrong and should say:
      
      proc mt_lslice {l s} {
          set r [list]    
          foreach i $s {
              lappend r [lindex $l $i]
          }   
          return $r
      }
      % mt_lslice [list a b c d e f] [list 1 3 5]
      b d f
      
      
    4. foundin initialized to: "obsolete: 8.4a3"
    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: "14. List Object"
    10. title initialized to: "Tcl_AppendStringsToObj -> abort"
    11. type initialized to: "Bug"
  2. Ticket change [b31b73a218] (rid 98464) by msofer on 2001-08-30 22:47:34:

    1. assignee changed to: "msofer"
    2. icomment:
      Logged In: YES 
      user_id=148712
      
      This is a bug in the new bytecompiled implementation of
      lappend; the crash does not occur in tcl8.3, nor when you
      
      eval lappend r [lindex $l $i] 
      
      
    3. login: "msofer"
    4. mimetype: "text/plain"
    5. priority changed to: "8"
    6. subsystem changed to: "47. Bytecode Compiler"
    7. username: "msofer"
  3. Ticket change [e23e932ad2] (rid 87587) by dgp on 2001-08-30 23:09:37:

    1. assignee changed to: "kennykb"
    2. icomment:
      Logged In: YES 
      user_id=80530
      
      Assigning to Kevin Kenny.  His TIP 22/33 changes
      should take care of this.  Make sure to add this
      to the test suite!
      
      
    3. login: "dgp"
    4. mimetype: "text/plain"
    5. priority changed to: "5 Medium"
    6. subsystem changed to: "14. List Object"
    7. username: "dgp"
  4. Ticket change [803324f99b] (rid 97694) by dgp on 2001-08-30 23:21:03:

    1. assignee changed to: "msofer"
    2. icomment:
      Logged In: YES 
      user_id=80530
      
      &(@W#%&@Y SF not managing changes crossing in
      mid-stream *U#*Y$
      
      
      
    3. login: "dgp"
    4. mimetype: "text/plain"
    5. priority changed to: "8"
    6. subsystem changed to: "47. Bytecode Compiler"
    7. username: "dgp"
  5. Ticket change [0e4523f433] (rid 94587) by msofer on 2001-08-31 03:00:27:

    1. icomment:
      Logged In: YES 
      user_id=148712
      
      Weird ... 
      
      [mig@mini generic]$ tclsh8.4
      % info patch
      8.4a3
      % proc tst0 {} {
          set r [list]    
          lindex a a
      }
      % proc tst1 {} {
          set r {}    
          lindex a a
      }
      % tst1
      bad index "a": must be integer or end?-integer?
      % tst0
      Tcl_AppendStringsToObj called with shared object
      Aborted (core dumped)
      
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  6. Ticket change [7b6a0e7c1d] (rid 90509) by msofer on 2001-08-31 04:06:39:

    1. icomment:
      Logged In: YES 
      user_id=148712
      
      The symptom goes away if you do
          Tcl_ResetResult(interp)
      in TclGetIntForIndex (generic/tclUtil.c, line 2185) before
      appending to the result.
      
      This does not yet leave me utterly satisfied that the
      disease is gone:
      (a) I'm not sure this is otherwise OK and doesn't introduce
      other bugs
      (b) I still do not understand *why* the interp's result was
      shared in one case and not in the other ...
      
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  7. Ticket change [296b6b11d4] (rid 88866) by hobbs on 2001-08-31 06:23:45:

    1. icomment:
      Logged In: YES 
      user_id=72656
      
      This has something special to do with [list] in 8.4a4, but 
      also in relation to TclGetIntForIndex, because trying with 
      string index (now compiled in 8.4 as well), I also get the 
      crash:
      
      lorax [~/cvs/tcl/tcl8.4/unix/linuxd] 772 > tclsh8.4
      % proc tst0 {} { set r [list] ; string index a b }
      % tst0
      Tcl_AppendStringsToObj called with shared object
      Abort
      lorax [~/cvs/tcl/tcl8.4/unix/linuxd] 773 > tclsh8.4
      % proc tst0 {} { set r {} ; string index a b }
      % tst0
      bad index "b": must be integer or end?-integer?
      
      I suspect as well that the Tcl_ResetResult is a good thing 
      one way or the other, but I'm going to look for a possible 
      alternative to what may be causing it (related to [list]).
      
      
    2. login: "hobbs"
    3. mimetype: "text/plain"
    4. username: "hobbs"
  8. Ticket change [3d2e7a1866] (rid 121043) by hobbs on 2001-08-31 06:31:15:

    1. icomment:
      Logged In: YES 
      user_id=72656
      
      Getting a little more specific, it looks like the failure 
      really is in result handling in the bcc with respect to 
      appending to the result.  Note this error result:
      
      % proc t0 {} { linsert a 0 b ; lindex a b }
      % t0
      b abad index "b": must be integer or end?-integer?
      
      If you do that in 8.3 (where lindex isn't compiled),
      you don't have the "b a" in the result.
      
      
    2. login: "hobbs"
    3. mimetype: "text/plain"
    4. username: "hobbs"
  9. Ticket change [f2917dab5c] (rid 109570) by msofer on 2001-08-31 08:33:55:

    1. icomment:
      Logged In: YES 
      user_id=148712
      
      This seems to be an unfortunate combination of two semi-bugs
      (aka
      optimisations?): 
        
      1 - TclCompileScript (tclCompile.c, ll. 838) just POPs the
      previous
      command result from the stack but does not reset the
      interp's
      result. This is OK as (in principle) bcc'ed commands
      communicate their  
      results on the stack and do not set the interp's result.
      Compare this
      to clearing the result before each invocation of a command
      or
      evaluation of a script.
      
      2 - Some error messages are *appended* to the interp's
      result. This is
      necessary for the buildup of the error call stack, but I
      think the
      interp's result should be reset by the error *originators*
      (in these
      examples, TclGetIntForIndex) before appending.
      
      I would say that #2 should be hunted down, #1 is valuable.
      As a
      general rule, commands and functions should not assume that
      they get
      an empty result when they are called; they should set the
      result, not
      append to it.
      
      -----
      Additionally:
      "set r [list]" triggers a core dump because it leaves a
      shared object
      in the interp's result: the same object is the value of r.
      The
      following function behaves correctly
      
      proc tst2 {} {
          set r r[list]
          lindex a a
      }
      
      Note that if you *force* other commands to communicate via
      the interp's 
      result, you reproduce the behaviour: the following dumps
      core too
      
      proc tst3 {} {
          set set set
          $set r 5
          lindex a a
      }
      
      ----
      IN CONCLUSION:
      
      (a) this particular bug is fixed by resetting the interp's
      result in
      TclGetIntForIndex. 
      
      (b) there may be other similar bugs lurking in the
      background, waiting
      to trip the unwary; a hunt for functions abusingly appending
      to the
      result without first resetting it first should be done.
      
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  10. Ticket change [17df8963e2] (rid 122570) by hobbs on 2001-09-01 04:20:51:

    1. closedate changed to: "2001-08-31T21:20:51"
    2. closer changed to: "hobbs"
    3. icomment:
      Logged In: YES 
      user_id=72656
      
      More particularly, we have to watch utility functions that 
      don't reset the result, because if it is simply a non-bcc 
      command that would follow the 'set r [list]', then the 
      invocation instruction does reset the result.
      
      After a look (not exhaustive, but not brief) through the 
      sources, it seems like most other calls were preceded by 
      the appropriate Tcl_ResetResult.
      
      Added TclGetIntForIndex fix and tests to 8.4a4cvs.
      
      
    4. login: "hobbs"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "hobbs"
  11. Ticket change [09819af1f4] (rid 113668) by msofer on 2002-04-29 23:30:30:

    1. closedate changed to: "2002-04-29T16:30:30"
    2. closer changed to: "msofer"
    3. icomment:
      Logged In: YES 
      user_id=148712
      
      I think this is a symptom of the same "disease" described in
      bugs #533364 and #550142.
      
      
    4. login: "msofer"
    5. mimetype: "text/plain"
    6. username: "msofer"