Skip to content
Tcl Source Code History Of Ticket 1331475
Login

History Of Ticket 1331475

Artifacts Associated With Ticket 1331475

  1. Ticket change [84b7ee018d] (rid 117607) by aric_b on 2005-10-19 11:32:47:

    1. assignee initialized to: "dkf"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      [dict append], called as part of a particular sequence,
      causes Tcl to crash.  The following code consistently
      produces the error for me in ActiveState tclsh 8.5a4 on
      Windows XP SP2:
      
          proc problem {list_of_lists} {
      
              set one 1
              set two 2
      
              foreach list $list_of_lists {
                  if {[llength $list] > 1} {
                      dict append a b c
                  }
              }
          }
      
          set list_of_lists [list [list a b]]
      
          problem $list_of_lists
      
      I noticed the following:
      
      * The error occurs whether or not the dictionary and/or
      key in question exist before the call to [dict append].
      
      * All of the code in the proc seems to be necessary to
      produce the error; for example, if either [set one 1]
      or [set two 2] is absent, the error doesn't occur.
      
      * The error doesn't seem to occur if there's a command
      on the line immediately below the call to [dict
      append], for example:
      
              ...
                  if {[llength $list] > 1} {
                      dict append a b c
                      expr 5
                  }
              ...
      
      
    4. foundin initialized to: "obsolete: 8.5a4"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "aric_b"
    9. subsystem initialized to: "15. Dict Object"
    10. title initialized to: "[dict append] causes Tcl to crash"
    11. type initialized to: "Bug"
  2. Ticket change [9f47d000ba] (rid 96614) by msofer on 2005-10-19 20:15:51:

    1. assignee changed to: "msofer"
    2. closedate changed to: "2005-10-19T13:15:51"
    3. closer changed to: "msofer"
    4. icomment:
      Logged In: YES 
      user_id=148712
      
      This was caused by a faulty peephole optimisation (peeping
      at the wrong hole) in the INST_DICT_(L)APPEND opcode. 
      
      Fixed in HEAD. Unluckily it is extremely  difficult to test
      for this: it only fails if there happens to be a '1' at the
      byte we are wrongly testing. This also means that it is a
      difficult bug to trigger.
      
      
    5. login: "msofer"
    6. mimetype: "text/plain"
    7. resolution changed to: "Fixed"
    8. status changed to: "Closed"
    9. subsystem changed to: "47. Bytecode Compiler"
    10. username: "msofer"