Artifacts Associated With Ticket 2837800
Ticket change [ec71b5e494] (rid 103709) by dgp on 2009-08-14 17:57:15:
- assignee initialized to: "dgp"
- cmimetype initialized to: "text/plain"
- comment initialized to:
% file mkdir ./~goo % close [open ./~goo/test w] % glob [file join * test] make: *** [shell] Segmentation fault
- foundin initialized to: "obsolete: 8.5.7"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "dgp"
- subsystem initialized to: "36. Pathname Management"
- title initialized to: "[glob] segfault searching dirs matching ~*"
- type initialized to: "Bug"
Ticket change [7ef24ff9fd] (rid 97492) by dgp on 2009-08-15 00:59:48:
- icomment:
Stack trace from debug build of the tip of the core-8-5-branch: Program received signal SIGSEGV, Segmentation fault. 0x0807bf8a in Tcl_DbDecrRefCount (objPtr=0x0, file=0x8160368 "/home/dgp/cvs/tcl8.5/unix/../generic/tclPathObj.c", line=1690) at /home/dgp/cvs/tcl8.5/unix/../generic/tclObj.c:3153 3153 if (objPtr->refCount == 0x61616161) { (gdb) bt #0 0x0807bf8a in Tcl_DbDecrRefCount (objPtr=0x0, file=0x8160368 "/home/dgp/cvs/tcl8.5/unix/../generic/tclPathObj.c", line=1690) at /home/dgp/cvs/tcl8.5/unix/../generic/tclObj.c:3153 #1 0x080820c9 in Tcl_FSGetTranslatedPath (interp=0x89098d0, pathPtr=0x89752d8) at /home/dgp/cvs/tcl8.5/unix/../generic/tclPathObj.c:1690 #2 0x080ad652 in TclpMatchInDirectory (interp=0x89098d0, resultPtr=0x8974d10, pathPtr=0x89752d8, pattern=0x0, types=0x0) at /home/dgp/cvs/tcl8.5/unix/../unix/tclUnixFile.c:222 #3 0x080682ba in Tcl_FSMatchInDirectory (interp=0x89098d0, resultPtr=0x8974d10, pathPtr=0x89752d8, pattern=0x0, types=0x0) at /home/dgp/cvs/tcl8.5/unix/../generic/tclIOUtil.c:1102 #4 0x08145dc6 in DoGlob (interp=0x89098d0, matchesObj=0x8974d10, separators=0x816f602 "/", pathPtr=0x8975010, flags=1, pattern=0x897454a "test", types=0x0) at /home/dgp/cvs/tcl8.5/unix/../generic/tclFileName.c:2478 #5 0x08145941 in DoGlob (interp=0x89098d0, matchesObj=0x8974d10, separators=0x816f602 "/", pathPtr=0x0, flags=0, pattern=0x8974548 "*/test", types=0x0) at /home/dgp/cvs/tcl8.5/unix/../generic/tclFileName.c:2364 #6 0x08145010 in TclGlob (interp=0x89098d0, pattern=0x8974548 "*/test", pathPrefix=0x0, globFlags=0, types=0x0) at /home/dgp/cvs/tcl8.5/unix/../generic/tclFileName.c:1914 #7 0x0814471e in Tcl_GlobObjCmd (dummy=0x0, interp=0x89098d0, objc=1, objv=0x890ac6c) at /home/dgp/cvs/tcl8.5/unix/../generic/tclFileName.c:1584 ... - login: "dgp"
- mimetype: "text/plain"
- priority changed to: "9 Immediate"
- username: "dgp"
- icomment:
Ticket change [f414143aff] (rid 129835) by dgp on 2009-08-15 01:32:31:
- icomment:
In Tcl 8.4, there is no crash, but the incorrect result is not much better: % glob [file join * test] %
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [57c414d0f0] (rid 117681) by dgp on 2009-08-15 01:34:56:
- icomment:
8.3.5 works fine.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [77b14e375a] (rid 89816) by dgp on 2009-08-15 01:38:03:
- icomment:
The actual releases of Tcl 8.4, up through 8.4.19 are slightly better: % glob */test no files matched glob pattern "*/test" It's a wrong result, but at least without the empty error message demonstrated in the tip of the core-8-4-branch.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [583a0cb27b] (rid 117765) by dgp on 2009-08-15 02:41:45:
- icomment:
A different variation of the same bug in Tcl 8.4: % file mkdir ./~dgp ;# empty directory % glob */.mozilla ~dgp/.mozilla The search in subdirectories of the current directory is actually finding something way over in my home directory instead.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Add attachment "2837800-84.patch" [0e318d2354] (rid 94569) by dgp on 2009-08-15 03:07:31.
Ticket change [e5e09c41b6] (rid 104201) by dgp on 2009-08-15 03:07:31:
- icomment:
File Added - 339245: 2837800-84.patch
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [9e40fd8e96] (rid 96446) by dgp on 2009-08-15 03:07:51:
- icomment:
Attached patch fixes things in 8.4.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [a15c2947ae] (rid 109700) by dgp on 2009-08-18 03:00:13:
- icomment:
fix with tests committed for 8.4.20.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [1447296c88] (rid 124365) by dgp on 2009-08-18 04:21:51:
- icomment:
In 8.5+, I observe that the header comments of TclNewFSPathObj() claim that the dirPtr argument must be an absolute path, but when DoGlob() calls this routine, it makes no effort to check that constraint is met. It's not clear whether the header comment claim is true, or where it gets relied on, if anywhere.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [c9e24d00c0] (rid 122361) by dgp on 2009-08-18 20:10:21:
- icomment:
When the user "goo" does not exist, then the value "~goo" cannot be converted to the "path" Tcl_ObjType. The PATH_FLAGS == 0 representation for a "path" value holds two parts of the path. In the crashing case, the head part of the path is "~goo" and the tail part is "test". It is assumed deep in the code that the head part of the path can always be converted to the "path" Tcl_ObjType. There is no check for the NULL result when that is not true, and that leads to the crash.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [6d8f90cfaa] (rid 128725) by dgp on 2009-08-18 20:10:57:
- icomment:
sorry, that's the PATH_FLAGS != 0 representation.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [5e2fa22ff9] (rid 115592) by dgp on 2009-08-18 21:34:50:
- icomment:
handling the NULL return solves the crash, leaving only the bug. Will commit if/when SF CVS returns.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [902b0f058d] (rid 120406) by dgp on 2009-08-20 21:42:11:
- title changed to: "[glob] errors searching dirs matching ~*"
Add attachment "2837800.patch" [a18c4c9a8f] (rid 109735) by dgp on 2009-08-21 04:56:26.
Ticket change [b800c4c18c] (rid 128895) by dgp on 2009-08-21 04:56:26:
- icomment:
File Added - 339991: 2837800.patch
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [2cde3228de] (rid 118984) by dgp on 2009-08-21 04:56:39:
- icomment:
Attached patch for 8.5
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [f89c2520d4] (rid 91566) by dgp on 2009-08-21 05:10:34:
- closedate changed to: "2009-08-20T22:10:34"
- closer changed to: "dgp"
- icomment:
allow_comments - 1 Patch committed for 8.5.8 and 8.6b2.
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "dgp"
Ticket change [67198e1de2] (rid 102843) by dgp on 2009-08-22 02:11:48:
- icomment:
subsequent commits corrected a regression.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment: