Artifacts Associated With Ticket 2884203
Ticket change [0a31b39472] (rid 113773) by patthoyts on 2009-10-22 21:09:40:
- assignee initialized to: "dgp"
- cmimetype initialized to: "text/plain"
- comment initialized to:
We are getting a crash in filesystem-9.5, 9.6 and 9.7 on Windows XP and Windows 7 with core-8-5-branch. I bisected the commits and this fault was introduced by the commit on 2009-08-20 by dgp: "* generic/tclPathObj.c: [Bug 2806250] Prevent the storage of strings ..." The relevant part of the call stack looks like this: MSVCRTD!memcpy tcl85tg!Tcl_DuplicateObj tcl85tg!AppendPath tcl85tg!Tcl_FSGetNormalizedPath tcl85tg!TclpMatchInDirectory tcl85tg!Tcl_FSMatchInDirectory tcl85tg!DoGlob tcl85tg!DoGlob tcl85tg!TclGlob The crash occurs because in Tcl_DuplicateObj the objPtr->length is -1 I've checked on Windows XP and Windows 7 each time using MSVC6 to compile.
- foundin initialized to: "obsolete: 8.5.7"
- is_private initialized to: "0"
- priority initialized to: "9 Immediate"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "patthoyts"
- subsystem initialized to: "37. File System"
- title initialized to: "Crash in filesystem-9.5 test on Windows"
- type initialized to: "Bug"
Ticket change [d33e766206] (rid 123260) by dgp on 2009-10-23 04:36:50:
- icomment:
Is it known which AppendPath() call in Tcl_FSGNP() causes the crash?
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [0f0bcbce87] (rid 94723) by dgp on 2009-10-23 04:55:08:
- icomment:
Does this show up on HEAD as well, or only on core-8-5-branch?
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [48857b8db5] (rid 99900) by patthoyts on 2009-10-23 05:10:29:
- icomment:
Its the second call: copy = AppendPath(dir, fsPathPtr->normPathPtr); At this point 'dir' look like: ?dir 0x02a877b0 refCount: 0x00000000 bytes: 0x02a66030 "ÝÝ....ÝÝ" length: 0xffffffff typePtr: 0x00000000 {name=??? freeIntRepProc=??? dupIntRepProc=??? ...} internalRep: {longValue=0x02a87780 doubleValue=-6.2774360118698813e+066 otherValuePtr=0x02a87780 ...} but fsPathPtr seems to be messed up: ?fsPathPtr 0x02a7aea8 translatedPathPtr: 0x00000000 {refCount=??? bytes=??? length=??? ...} normPathPtr: 0x02a877e0 {refCount=0x00000001 bytes=0x02a984c0 "" length=0x00000004 ...} cwdPtr: 0x02a87888 {refCount=0x00000002 bytes=0x02a98530 "`û§Pÿ§" length=0x00000003 ...} flags: 0x00000001 nativePathPtr: 0x00000000 filesystemEpoch: 0x00000001 fsRecPtr: 0x00653ac0 {clientData=0x00000000 fsPtr=0x10169c08 fileRefCount=0x0000002f ...} HEAD is ok and filesystem.test passes all tests - so just 8.5 branch. - login: "patthoyts"
- mimetype: "text/plain"
- username: "patthoyts"
- icomment:
Ticket change [4e3712662b] (rid 127187) by dgp on 2009-10-24 03:15:42:
- icomment:
Since HEAD is ok, see whether applying the patch below to 8-5-branch makes it ok as well. I still prefer to get a full understand to confirm the best fix, but if this works it can be a second-best solution to get 8.5.8 out. Index: tclPathObj.c =================================================================== RCS file: /cvsroot/tcl/tcl/generic/tclPathObj.c,v retrieving revision 1.66.2.9 diff -u -r1.66.2.9 tclPathObj.c --- tclPathObj.c 20 Aug 2009 14:59:53 -0000 1.66.2.9 +++ tclPathObj.c 23 Oct 2009 20:13:31 -0000 @@ -1457,6 +1457,9 @@ if (PATHFLAGS(pathPtr) != 0 && fsPathPtr->cwdPtr == cwdPtr) { +#if 1 + return fsPathPtr->normPathPtr +#else pathPtr = fsPathPtr->normPathPtr; /* TODO: Determine how much, if any, of this forcing @@ -1521,6 +1524,7 @@ pathPtr->typePtr = &tclFsPathType; return pathPtr; +#endif } } - login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [4cdae3482f] (rid 126960) by patthoyts on 2009-10-24 05:39:11:
- icomment:
Applying this patch prevents the crash and the tests now pass.
- login: "patthoyts"
- mimetype: "text/plain"
- username: "patthoyts"
- icomment:
Ticket change [2420851fbb] (rid 131063) by dgp on 2009-10-27 05:14:20:
- icomment:
Any chance you are testing a build with the TclNORM_LONG_PATH directive enabled? The code in lines 2916-2938 of Revision 1.95.2.2 of tclWinFile.c do not appear able to handle the case of lastValidPathEnd == NULL, which appears to happen in the test case.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [f418195d91] (rid 129839) by dgp on 2009-10-27 05:29:56:
- icomment:
In the AppendPath() call that leads to a crash, both arguments are (Tcl_Obj *). Can you report the values of the respective typePtr fields? I am expecting each of them to be values of the "string" Tcl_ObjType.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [593bcfe585] (rid 117939) by dgp on 2009-10-28 03:25:17:
- icomment:
Here's the patch that fixes it. Missing ref count.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Add attachment "2884203.patch" [62fd115097] (rid 92498) by dgp on 2009-10-28 03:26:19.
Ticket change [f3b406caf2] (rid 129760) by dgp on 2009-10-28 03:26:19:
- icomment:
File Added - 348439: 2884203.patch
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [32469dc9a8] (rid 93586) by dgp on 2009-10-28 03:31:25:
- closedate changed to: "2009-10-27T20:31:25"
- closer changed to: "dgp"
- icomment:
allow_comments - 1 Patch applied to 8-5-branch and HEAD.
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "dgp"