Artifacts Associated With Ticket 3595576fffffffff
Ticket change [e52e4ef1cd] (rid 88085) by msofer on 2012-12-13 13:17:43:
- assignee initialized to: "msofer"
- cmimetype initialized to: "text/plain"
- 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 *** - foundin initialized to: "None"
- is_private initialized to: "0"
- priority initialized to: "9 Immediate"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "msofer"
- subsystem initialized to: "60. NRE and coroutines"
- title initialized to: "segfault in CatchObjCmdCallback"
- type initialized to: "Bug"
Ticket change [19dea94080] (rid 122870) by msofer on 2012-12-13 20:18:38:
- foundin changed to: "current: 8.6.0"
Ticket change [40afb09324] (rid 116059) by msofer on 2012-12-13 20:23:56:
- icomment:
The problem is with $::errorInfo, the script runs without crashing if we put $::nothing instead
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [b714f64652] (rid 125524) by msofer on 2012-12-13 20:37:42:
- closedate changed to: "2012-12-13T13:37:42"
- closer changed to: "msofer"
- 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.
- login: "msofer"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "msofer"
Ticket change [cf9281cd3e] (rid 113008) by dgp on 2012-12-13 22:49:18:
- 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 - login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "None"
- status changed to: "Open"
- username: "dgp"
- icomment:
Ticket change [700879498f] (rid 100408) by dgp on 2012-12-13 22:50:47:
- icomment:
And the worse counterpart: catch error -> noSuchNs::var
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [8afe0edd83] (rid 127487) by nijtmans on 2012-12-13 23:15:46:
- 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 - login: "nijtmans"
- mimetype: "text/plain"
- username: "nijtmans"
- icomment:
Ticket change [950e58bacc] (rid 106095) by nijtmans on 2012-12-13 23:19:35:
- 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 - login: "nijtmans"
- mimetype: "text/plain"
- username: "nijtmans"
- icomment:
Ticket change [01d85c347e] (rid 119556) by dgp on 2012-12-13 23:29:38:
- closedate changed to: "2012-12-13T16:29:38"
- closer changed to: "dgp"
- icomment:
allow_comments - 1 The options dictionary variable gets set for all return codes. Fixed on 8.5 and 8.6 branches
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "dgp"