Skip to content
Tcl Source Code History Of Ticket b9b2079e6d
Login

History Of Ticket b9b2079e6d

Artifacts Associated With Ticket b9b2079e6d

  1. Ticket change [0dbbeb4946] (rid 145361) by anonymous on 2016-03-08 18:27:18:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. comment initialized to:
      This is the most simplified code I have been able to write triggering the segfault. It crashes in 32 and 64 bit versions of tcl (debian sid package)
      
      ------
      #!/bin/tclsh
      
      foreach i {a b} {set t_$i ""}
      
      proc triggerError {} {
          set var_t ""
          foreach i {a b} {
              set v t_$i
              upvar 1 [coalesce [set var_t] [set v]] t_$i
          }
      }
      
      proc coalesce {args} {
          set res ""
          foreach i $args {
              if {$i != ""} {set res $i;break}
          }
          return $res
      }
      
      triggerError
      
      puts "END"
      ------
      
      I think the problem has something to do with the parsing of line 9 (the one with the upvar). If you change it like this:
      
              set aux [coalesce [set var_t] [set v]]
              upvar 1 $aux t_$i
      
      The problem fades away.
      
    5. foundin initialized to: "8.6.5"
    6. is_private initialized to: "0"
    7. login: "anonymous"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "3ff3943d55f2767d3dd1d11b625e46c3cc9479b2"
    10. resolution initialized to: "None"
    11. severity initialized to: "Severe"
    12. status initialized to: "Open"
    13. submitter initialized to: "anonymous"
    14. subsystem initialized to: "45. Parsing and Eval"
    15. title initialized to:
      Segfaults parsing a script. The script works nicely in version 8.5
      
    16. type initialized to: "Bug"
  2. Ticket change [3cb85433d5] (rid 145363) by dgp on 2016-03-09 04:00:39:

    1. assignee changed to: "msofer"
    2. icomment:
      
      A good demo script is a thing of beauty.
      
      All was well until
      
      http://core.tcl.tk/tcl/info/582877d8ab09712c
      
      With that feature merge, the demo script started hanging.
      
      Later we saw
      
      http://core.tcl.tk/tcl/info/93a75ad1c45fb061
      
      which introduced the segfault still seen in Tcl 8.6.5.
      
    3. login: "dgp"
    4. mimetype: "text/plain"
    5. priority changed to: "8"
    6. severity changed to: "Critical"
  3. Ticket change [9392f59e76] (rid 145368) by dgp on 2016-03-09 16:32:00:

    1. icomment:
      #0  0x000000000053d860 in AdvanceJumps (envPtr=0x7fffffffc6d0)
          at /home/dgp/fossil/tcl8.6/generic/tclOptimize.c:398
      #1  0x000000000053d9c9 in TclOptimizeBytecode (envPtr=0x7fffffffc6d0)
          at /home/dgp/fossil/tcl8.6/generic/tclOptimize.c:433
      #2  0x00000000004bcf40 in TclSetByteCodeFromAny (interp=0x8205c0, 
          objPtr=0x869680, hookProc=0x0, clientData=0x0)
          at /home/dgp/fossil/tcl8.6/generic/tclCompile.c:848
      #3  0x000000000054eb72 in TclProcCompileProc (interp=0x8205c0, 
          procPtr=0x87eee0, bodyPtr=0x869680, nsPtr=0x814790, 
          description=0x5d3ac3 "body of proc", procName=0x8803a0 "triggerError")
          at /home/dgp/fossil/tcl8.6/generic/tclProc.c:2071
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  4. Ticket change [f94467e5e3] (rid 145369) by dgp on 2016-03-09 20:29:39:

    1. icomment:
      
      A cause of the trouble is that TclEmitInvoke() is
      creating INST_JUMP4 for break and continue
      exception handling that overlap each other.
      This means they mangle each others jump
      offsets and hilarity ensues.
      
      Still working on the primary cause.
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  5. Ticket change [d296500336] (rid 145443) by dgp on 2016-03-10 20:04:06:

    1. icomment:
      
      See proposed fix on branch bug-b9b2079e6d.
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  6. Ticket change [670c2cbd5c] (rid 145695) by dgp on 2016-03-17 12:16:38:

    1. assignee changed to: "dgp"
    2. closedate changed to: "2457465.01156122"
    3. closer changed to: "dgp"
    4. icomment: "Fixed for 8.6.6+"
    5. login: "dgp"
    6. mimetype: "text/plain"
    7. resolution changed to: "Fixed"
    8. status changed to: "Closed"