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

History Of Ticket 3595576fffffffff

Artifacts Associated With Ticket 3595576fffffffff

  1. Ticket change [e52e4ef1cd] (rid 88085) by msofer on 2012-12-13 13:17:43:

    1. assignee initialized to: "msofer"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      Mem corruption, detected by andrewsh
      
      mig@T510:~/DEVEL/tcl-core/trunk/unix$ cat /tmp/test.tcl 
      for {set i 0} {$i < 5} {incr i} {
          catch {catch {source foo} puts $::errorInfo}
      }
      puts DONE
      mig@T510:~/DEVEL/tcl-core/trunk/unix$ ./tclsh /tmp/test.tcl 
      *** glibc detected *** ./tclsh: invalid fastbin entry (free): 0x0000000001e67430 ***
      
      
    4. foundin initialized to: "None"
    5. is_private initialized to: "0"
    6. priority initialized to: "9 Immediate"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "msofer"
    10. subsystem initialized to: "60. NRE and coroutines"
    11. title initialized to: "segfault in CatchObjCmdCallback"
    12. type initialized to: "Bug"
  2. Ticket change [19dea94080] (rid 122870) by msofer on 2012-12-13 20:18:38:

    1. foundin changed to: "current: 8.6.0"
  3. Ticket change [40afb09324] (rid 116059) by msofer on 2012-12-13 20:23:56:

    1. icomment:
      The problem is with $::errorInfo, the script runs without crashing if we put $::nothing instead
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  4. Ticket change [b714f64652] (rid 125524) by msofer on 2012-12-13 20:37:42:

    1. closedate changed to: "2012-12-13T13:37:42"
    2. closer changed to: "msofer"
    3. icomment:
      
      
      allow_comments - 1
      
      Valgrind sees the crash at line 364 in tclCmdAH.c: there is a decrRefCount of the 'options' Tcl_Obj which was already freed from Tcl_ObjSetVar2 in the line above.
      
      Tcl_ObjSetVar2 is "fire and forget" with respect to the newValuePtr - it will clear a Tcl_Obj with 0 reference count. This means that line 364 is wrong, it should not be there at all.
      
      Fixed in trunk.
      
      
    4. login: "msofer"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "msofer"
  5. Ticket change [cf9281cd3e] (rid 113008) by dgp on 2012-12-13 22:49:18:

    1. icomment:
      
      
      allow_comments - 0
      
      
      The ::errorInfo in the demo really clouds the issue.
      
      Here's the simplified bug demo that gets to the heart of
      the matter:
      
      catch {} -> noSuchNs::var
      
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. resolution changed to: "None"
    5. status changed to: "Open"
    6. username: "dgp"
  6. Ticket change [700879498f] (rid 100408) by dgp on 2012-12-13 22:50:47:

    1. icomment:
      
      And the worse counterpart:
      
      catch error -> noSuchNs::var
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  7. Ticket change [8afe0edd83] (rid 127487) by nijtmans on 2012-12-13 23:15:46:

    1. icomment:
      In line 359:
          if (objc == 4 ) {
      Shouldn't that be:
          if (result == TCL_ERROR && objc == 4 ) {
      
      The Tcl_GetReturnOptions() function should
      only be called if the script returned an error, isn't it?
      
      This appears to fix the crash.
      
      Regards,
              Jan Nijtmans
      
      
    2. login: "nijtmans"
    3. mimetype: "text/plain"
    4. username: "nijtmans"
  8. Ticket change [950e58bacc] (rid 106095) by nijtmans on 2012-12-13 23:19:35:

    1. icomment:
      B.T.W.: Tcl 8.5 has the same bug, only the
      given lines are in Tcl_CatchObjCmd (tclCmdAH.c lines 273/276)
      
      So it's not an NRE bug, It's a TIP #280 implementation bug ;-)
      
      Regards,
              Jan Nijtmans
      
      
    2. login: "nijtmans"
    3. mimetype: "text/plain"
    4. username: "nijtmans"
  9. Ticket change [01d85c347e] (rid 119556) by dgp on 2012-12-13 23:29:38:

    1. closedate changed to: "2012-12-13T16:29:38"
    2. closer changed to: "dgp"
    3. icomment:
      
      
      allow_comments - 1
      
      The options dictionary variable gets set
      for all return codes.
      
      Fixed on 8.5 and 8.6 branches
      
      
    4. login: "dgp"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "dgp"