Artifacts Associated With Ticket 3479689
Ticket change [13f200db8c] (rid 124310) by dgp on 2012-01-25 17:43:37:
- assignee initialized to: "dgp"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Tcl_FSConvertToPathType(NULL, Tcl_NewStringObj("a//b",-1)); will crash at least on unix systems in a -enable-symbols=mem build of Tcl. This passes a 0-refcount value to SetFsPathFromAny() which passes it on to Tcl_FSJoinToPath(). As documented, on exit Tcl_FSJoinToPath() frees the value, but then SetFsPathFromAny() continues on, trying to build a "path" intrep in the freed space. BOOM! - foundin initialized to: "obsolete: 8.5.11"
- is_private initialized to: "0"
- priority initialized to: "8"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "dgp"
- subsystem initialized to: "37. File System"
- title initialized to: "shimmer 0-refcount to path can segfault"
- type initialized to: "Bug"
Ticket change [2b95168b31] (rid 118765) by dgp on 2012-01-26 00:48:27:
- icomment:
In the more usual build, this won't crash, but will result in building up the path value in a Tcl_Obj that's been returned to the free pool. Eventually that will get reallocated to some other use, and you'll see memory corruption effects as two different owners battle over the use of the struct.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [886e7fd8ce] (rid 131865) by dgp on 2012-01-26 01:30:06:
- icomment:
The quick and easy fix is to bracket the call to Tcl_FsJoinToPath() with refcount incr/decr: pathPtr->refCount++; transPtr = Tcl_FSJoinToPath(pathPtr, 0, NULL); pathPtr->refCount--; - login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [52d7a932ce] (rid 126390) by dgp on 2012-01-26 01:31:23:
- icomment:
The more attractive fix is to take Tcl_FSJoinToPath() back behind the barn and shoot it in the head. Why oh why do we document interfaces we can plainly see are broken?
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [d98f5b2ac5] (rid 107632) by dgp on 2012-01-26 23:43:56:
- icomment:
Simple fix committed for 8.5.12
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [9b2dff2b16] (rid 111085) by dgp on 2012-01-28 04:58:05:
- closedate changed to: "2012-01-27T21:58:05"
- closer changed to: "dgp"
- icomment:
allow_comments - 1 Better fix on trunk with refactoring of the *Join*Path* routines into more usable interfaces.
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "dgp"