Overview
| Artifact ID: | f212633e2c3c1bb34f0507e53c853e56ac8ac4cf |
|---|---|
| Ticket: | 3475569fffffffffffffffffffffffffffffffff
Unexpected behavior / Panic / Tcl_Obj deletion management |
| User & Date: | sebres on 2012-01-18 16:37:33 |
Changes
- assignee changed to: "msofer"
- cmimetype changed to: "text/plain"
- comment changed to:
Platform: ANY; Area: Tcl core, DeletePending; I have an unexpected behavior, that can be reproduced only if an Tcl_Obj will be destroyed (in a freeIntRepProc of this) - also ObjDeletePending(contextPtr) is true. By call of TclFSNormalizeAbsolutePath through "link = Tcl_FSLink(retVal, NULL, 0);", the retVal will be shared obj (refCount = 2), hereafter by call "Tcl_SetObjLength(retVal, ...);" a PANIC ("Tcl_SetObjLength called with shared object"), hereafter folowing Exception, access vio etc. The problem is Tcl_FSJoinToPath(pathPtr,...), that incr refCount of object "pathPtr" after that called. I have attached a patch, that i created to work around problem. In addition the simple code, that will be correctly executed "normally" and perfect unexpected panic in "DeletePending" mode: <code> Tcl_Obj * obj; Tcl_Obj * list; Tcl_Obj * ret; // brand new obj obj = Tcl_NewListObj(0, NULL); Tcl_IncrRefCount(obj); // brand new parent list = Tcl_NewListObj(1, &obj); Tcl_IncrRefCount(list); // ... here anything else ... // // delete parent ... Tcl_DecrRefCount(list); // here obj->refCount should be 1 (and normally also 1), but in "DeletePending" mode it is 2 ... // also here BOOM if DeletePending : Tcl_SetObjLength(obj, 0); // ... here anything else ... // // delete object Tcl_DecrRefCount(obj); </code> In my opinion, the DeletePending mechanism must be changed, for example using "Epoch" in Obj struct (the objects created in DeletePending mode could be deleted directly without PushObjToDelete) ... Or completelly removed from core. On every case, all tcl tests should be extended to check it in DeletePending mode. - foundin changed to: "obsolete: 8.5.11"
- is_private changed to: "0"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "sebres"
- subsystem changed to: "10. Objects"
- title changed to:
Unexpected behavior / Panic / Tcl_Obj deletion management
- type changed to: "Bug"