Artifacts Associated With Ticket 1379287
Ticket change [6de7b3a5f1] (rid 128785) by georgeps on 2005-12-13 07:04:12:
- assignee initialized to: "vincentdarley"
- cmimetype initialized to: "text/plain"
- comment initialized to:
I found this odd behavior first in an old tclkit. In that case it was an 8.5a4-based version (sometime before the BigNum code was integrated) and it caused a segfault. I just tried today with the HEAD and it's broken, but doesn't segfault for me. Steve Redler IV confirmed that it's broken in Slackware Linux. Steve was able to get a segfault with a tclkit built with the Tcl HEAD as of about 2 weeks ago -- using the patterns I list below. I haven't yet tried todays HEAD with a tclkit, but it could be that tclkit introduces a segfault rather than just the strange behavior. In the tclkit the pattern is: # cd /tmp # tclkit8.5 % cd .. % pwd % cd .. % pwd Memory fault (core dumped) Note: I had to be root to get the /tclkit8.5.core created. The backtrace on the core indicates a loop of patterns that goes on for quite a while (endless recursion? or possibly the debugger is confused). #0 0x080811bf in TclDefaultBgErrorHandlerObjCmd () [this is where it repeats for thousands of times] #1 0x08094ca7 in Tcl_FSLstat () #2 0x080a593e in Tcl_FSLstat () #3 0x080a58dc in Tcl_FSLstat () #4 0x080a7bfb in Tcl_FSLstat () #5 0x080d220f in TclpUnloadFile () #6 0x080952a9 in Tcl_FSLstat () #7 0x08094248 in Tcl_FSLstat () #8 0x080a7c0e in Tcl_FSLstat () #9 0x080d220f in TclpUnloadFile () #10 0x080952a9 in Tcl_FSLstat () #11 0x08094248 in Tcl_FSLstat () #12 0x080a7c0e in Tcl_FSLstat () #13 0x080d220f in TclpUnloadFile () ... This demonstrates the broken behavior with today's HEAD: $ make shell LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}; export LD_LIBRARY_PATH; TCL_LIBRARY=" /gps/src/cvs/HEAD/tcl/library"; export TCL_LIBRARY; ./tclsh % cd /gps % cd .. % pwd % cd .. % pwd .. % cd .. % pwd .. % cd .. % pwd .. % cd .. % pwd .. % cd / % pwd / % cd .. % pwd % cd .. % pwd .. - foundin initialized to: "obsolete: 8.5a4"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "georgeps"
- subsystem initialized to: "36. Pathname Management"
- title initialized to:
cd .. pwd segfault in NetBSD and Linux (in some cases)
- type initialized to: "Bug"
Ticket change [5b314bcafd] (rid 118273) by dkf on 2005-12-13 17:40:41:
- priority changed to: "9 Immediate"
Ticket change [70be5a8691] (rid 100543) by msofer on 2006-02-26 00:46:36:
- icomment:
Logged In: YES user_id=148712 Still occurs on current HEAD. Any progress?
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [81e1cc0f20] (rid 117126) by georgeps on 2006-02-28 06:02:33:
- icomment:
Logged In: YES user_id=585068 from CdObjCmd -> FSChdir -> Tcl_FSGetNormalizedPath we find the failure I think. pathPtr->bytes is ".." at the start. None of the code in Tcl_FSGetNormalizedPath that updates the ->normPathPtr used at the end is executed. There is only one branch that is entered and that is this: if (fsPathPtr->cwdPtr != NULL) { ... if (...) { [not executed] } else if (...) { [not executed] } } We then reach: return fsPathPtr->normPathPtr I added this before the return: printf ("fsPathPtr->normPathPtr '%s'\n", fsPathPtr->normPathPtr); which output this: fsPathPtr->normPathPtr '' So the normPathPtr should be updated by some code in Tcl_FSGetNormalizedPath based on my interpretation of the code and output. - login: "georgeps"
- mimetype: "text/plain"
- username: "georgeps"
- icomment:
Ticket change [95e8f6bbe1] (rid 106233) by dgp on 2006-03-01 04:01:37:
- icomment:
Logged In: YES user_id=80530 This bug is present in Tcl 8.5a3 and 8.5a2 releases. Still testing...
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [ff41ef5181] (rid 108725) by dgp on 2006-03-01 04:14:19:
- icomment:
Logged In: YES user_id=80530 Ditto 8.5a1. Working theory is this bug arose with the 2003-04-11 refactorization that produced tclPathObj.c.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [edf376fa8e] (rid 103999) by dgp on 2006-03-01 11:19:31:
- icomment:
Logged In: YES user_id=80530 This test case worked correctly until: 2003-12-14 Vince Darley <[email protected]> * generic/tclPathObj.c: complete rewrite of generic file normalization code to cope with links followed by '..'. [Bug 849514], and parts of [859251] That change made things buggy in this way: % cd /tmp % pwd /tmp % cd .. % pwd /tmp
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [be043a5a73] (rid 102008) by dgp on 2006-03-01 11:46:16:
- icomment:
Logged In: YES user_id=80530 The next relevant changes: 2003-12-17 Vince Darley <[email protected]> * generic/tclCmdAH.c: * unix/tclUnixFile.c: * win/tclWinFCmd.c: * tests/fCmd.test: * tests/fileSystem.test: * doc/file.n: final fix to support for relative links and its implications on normalization and other parts of the filesystem code. Fixes [Bug 859251] and some Windows problems with recursive file delete/copy and symbolic links. 2003-12-17 Vince Darley <[email protected]> * generic/tclPathObj.c: * tests/fileSystem.test: fix and tests for [Bug 860402] in new file normalization code. ...left things buggy in a different way: % cd /tmp % pwd /tmp % cd .. couldn't change working directory to "..": no such file or directory
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [016bea65f8] (rid 119481) by dgp on 2006-03-01 12:30:46:
- icomment:
Logged In: YES user_id=80530 Next relevant revision, 2004-01-21 Vince Darley <[email protected]> gets us closer to what we see now: % cd /tmp % pwd /tmp % cd .. % pwd % cd .. % pwd <CRASH>
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [3cd0d46ca2] (rid 120973) by dgp on 2006-03-01 12:49:13:
- icomment:
Logged In: YES user_id=80530 Finally, the next relevant revision: 2004-01-22 Vince Darley <[email protected]> * tests/fileSystem.test: 3 new tests * generic/tclPathObj.c: fix to [Bug 879555] in file normalization. * doc/filename.n: small clarification to Windows behaviour with filenames like '.....', 'a.....', '.....a'. left things in their current buggy state: % cd /tmp % pwd /tmp % cd .. % pwd % cd .. % pwd ..
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [7d0817c64a] (rid 97176) by dgp on 2006-03-02 04:13:37:
- icomment:
Logged In: YES user_id=80530 Within Tcl_FSGetNormalizedPath() at line 1830 of tclPathObj.c: Tcl_Obj *absolutePath = fsPathPtr->translatedPathPtr; The variable name "absolutePath" suggests the code expects that path to have pathtype TCL_PATH_ABSOLUTE. In this example, that is not the case. The value is "..", which has pathtype TCL_PATH_RELATIVE. If the code does in fact depend on absolutePath being an absolutePath, then things are broken somewhere. If it does not depend on that, then the variable name choice is poor.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [4eebc81a50] (rid 125732) by dgp on 2006-03-02 04:15:06:
- icomment:
Logged In: YES user_id=80530 hmmm.. ok, several lines later around lline 1849-1851, the TCL_PATH_RELATIVE case is handled, so this is just a bad var name.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [c0ecff0fd2] (rid 102503) by dgp on 2006-03-02 04:22:10:
- icomment:
Logged In: YES user_id=80530 The problem is with TclFSNormalizeAbsolutePath(). In particular the call around line 1884. The "absolutePath" value passed in is "/tmp/.." and the resulting normalized form is "".
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [c66d4a9256] (rid 121766) by dgp on 2006-03-02 04:29:33:
- icomment:
Logged In: YES user_id=80530 revised subject. Note that the lexical processing of ".." by TclFSNormalizeAbsolutePath is already a point of controversy. See Bug 961646.
- login: "dgp"
- mimetype: "text/plain"
- subsystem changed to: "37. File System"
- title changed to: "TclFSNormalizeAbsolutePath() fails on /tmp/.."
- username: "dgp"
- icomment:
Ticket change [edd05537a9] (rid 103962) by dgp on 2006-03-02 23:53:53:
- icomment:
Logged In: YES user_id=80530 I think the attached patch solves the problem, but review and testing is welcome.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [b5611a7b5e] (rid 125232) by dgp on 2006-03-02 23:53:54:
- icomment:
File Added - 169495: 1379287.patch
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [052248aa0f] (rid 89004) by dgp on 2006-03-03 11:32:11:
- assignee changed to: "dgp"
- closedate changed to: "2006-03-03T04:32:11"
- closer changed to: "dgp"
- icomment:
Logged In: YES user_id=80530 Revised patch now works on OSX and any other system where /tmp is a symlink. Tests broken if /xxx is a symlink, but that ought to be rare enough to not worry about. Committing so that someone will test on Windows.
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Pending"
- username: "dgp"
Add attachment "1379287.patch" [451a640a1f] (rid 116828) by dgp on 2006-03-03 11:32:11.
Ticket change [564a657b28] (rid 94293) by dgp on 2006-03-03 11:32:13:
- icomment:
File Added - 169576: 1379287.patch
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [1ae78748d4] (rid 123053) by dgp on 2006-03-03 11:32:14:
- icomment:
File Deleted - 169495:
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [b3eca75898] (rid 124933) by vincentdarley on 2006-03-04 01:52:50:
- icomment:
Logged In: YES user_id=32170 Thanks dgp! I've just had a kid so will not have much time to examine this sort of thing for a while... Vince.
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [eed7ea52f5] (rid 108889) by dgp on 2006-03-04 02:16:56:
- icomment:
Logged In: YES user_id=80530 Test failure on Windows: ---- Result was: Paths should be equal: /bar , C:/bar ---- Result should have been (exact matching): ok ==== filesystem-1.45 FAILED
- login: "dgp"
- mimetype: "text/plain"
- status changed to: "Open"
- username: "dgp"
- icomment:
Ticket change [31f9b0c94f] (rid 93527) by dgp on 2006-03-04 03:10:11:
- closedate changed to: "2006-03-03T20:10:11"
- closer changed to: "dgp"
- icomment:
Logged In: YES user_id=80530 Here's an additional patch I'm committing to HEAD. Windows testers please?
- login: "dgp"
- mimetype: "text/plain"
- status changed to: "Pending"
- username: "dgp"
Add attachment "1379287-amend.patch" [a37225041c] (rid 110048) by dgp on 2006-03-04 03:10:11.
Ticket change [c3c0070629] (rid 111717) by dgp on 2006-03-04 03:10:12:
- icomment:
File Added - 169653: 1379287-amend.patch
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [8bf1798246] (rid 127665) by dgp on 2006-03-04 05:37:07:
- icomment:
Logged In: YES user_id=80530 still same failure on Windows. What a garbage routine this is to debug.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [b8bc68c531] (rid 129010) by dgp on 2006-03-04 09:34:01:
- icomment:
Logged In: YES user_id=80530 another attempt committed. Windows testers needed to check fileSystem.test
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [8710afc639] (rid 131629) by sf-robot on 2006-03-18 10:22:36:
- closedate changed to: "2006-03-18T03:22:36"
- closer changed to: "sf-robot"
- icomment:
Logged In: YES user_id=1312539 This Tracker item was closed automatically by the system. It was previously set to a Pending status, and the original submitter did not respond within 14 days (the time period specified by the administrator of this Tracker).
- login: "sf-robot"
- mimetype: "text/plain"
- status changed to: "Closed"
- username: "sf-robot"
Ticket change [5c2933a155] (rid 115247) by msofer on 2006-03-30 00:11:45:
- resolution changed to: "None"
- status changed to: "Open"
Ticket change [c5f06f4ad9] (rid 121674) by msofer on 2006-03-30 00:11:46:
- icomment:
Logged In: YES user_id=148712 Today's HEAD on linux: 'make test' is clean, but % cd /; pwd / % cd ..; pwd % cd ..; pwd ..
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [29ab6df6c0] (rid 88907) by dgp on 2006-03-30 05:24:14:
- closedate changed to: "2006-03-29T22:24:14"
- closer changed to: "dgp"
- icomment:
Logged In: YES user_id=80530 fix committed to HEAD please test on all platforms.
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Pending"
- username: "dgp"
Ticket change [5625fc1187] (rid 94270) by msofer on 2006-03-30 07:20:00:
- icomment:
Logged In: YES user_id=148712 Tests ok on linux
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [319d856333] (rid 93460) by msofer on 2006-03-30 07:28:07:
- icomment:
Logged In: YES user_id=148712 tclguy reports on XP: filesystem-1.19,22,23 fail, all with extra or missing /
- login: "msofer"
- mimetype: "text/plain"
- username: "msofer"
- icomment:
Ticket change [f153210479] (rid 109348) by hobbs on 2006-03-30 07:33:40:
- icomment:
Logged In: YES user_id=72656 Specific failures: ==== filesystem-1.19 file normalisation FAILED ==== Contents of test case: file normalize ${drive}:/./../../.. ---- Result was: B: ---- Result should have been (exact matching): B:/ ==== filesystem-1.19 FAILED ==== filesystem-1.22 file normalisation FAILED ==== Contents of test case: file normalize //name/foo/. ---- Result was: //name/foo/ ---- Result should have been (exact matching): //name/foo ==== filesystem-1.22 FAILED ==== filesystem-1.23 file normalisation FAILED ==== Contents of test case: file normalize c:/./foo ---- Result was: C://foo ---- Result should have been (exact matching): C:/foo ==== filesystem-1.23 FAILED - login: "hobbs"
- mimetype: "text/plain"
- username: "hobbs"
- icomment:
Ticket change [1393db3654] (rid 124243) by dgp on 2006-04-06 23:43:03:
- icomment:
Logged In: YES user_id=80530 commited revised fix for this family of bugs. Please test on Windows.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [137024c574] (rid 124218) by georgeps on 2006-04-07 11:01:20:
- icomment:
Logged In: YES user_id=585068 $ make shell LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}; export LD_LIBRARY_PATH; TCL_LIBRARY="/gps/src/cvs/HEAD/tcl/library"; export TCL_LIBRARY; ./tclsh % file normalize ../.. /gps/src/cvs % file normalize /tmp/../.. % file normalize /.. / % file normalize /../.. % So the / result isn't occuring here. Now notice the cd behavior here after a fresh start: $ make shell LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}; export LD_LIBRARY_PATH; TCL_LIBRARY="/gps/src/cvs/HEAD/tcl/library"; export TCL_LIBRARY; ./tclsh % cd /tmp/../.. couldn't change working directory to "/tmp/../..": no such file or directory % Now here is a similar pattern, but the cd doesn't fail (perhaps from the failed normalize): $ make shell LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}; export LD_LIBRARY_PATH; TCL_LIBRARY="/gps/src/cvs/HEAD/tcl/library"; export TCL_LIBRARY; ./tclsh % file normalize /tmp/../.. % file normalize ../.. /gps/src/cvs % cd /tmp/../.. % pwd So we try this: $ make shell LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}; export LD_LIBRARY_PATH; TCL_LIBRARY="/gps/src/cvs/HEAD/tcl/library"; export TCL_LIBRARY; ./tclsh % file normalize /tmp/../.. % cd /tmp/../.. couldn't change working directory to "/tmp/../..": no such file or directory % So some internal state is being corrupt, and causing other failures :/ FWIW the tclkit built with the same sources has this problem: $ ./tclkit85-magichimo.localdomain % cd /tmp/../.. % pwd % - login: "georgeps"
- mimetype: "text/plain"
- status changed to: "Open"
- username: "georgeps"
- icomment:
Ticket change [7c4ed11230] (rid 97060) by dgp on 2006-04-07 21:06:04:
- status changed to: "Pending"
Ticket change [02dd4b2c47] (rid 119720) by dgp on 2006-04-07 21:06:05:
- icomment:
Logged In: YES user_id=80530 another revision committed. please test.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [ca77771278] (rid 95351) by dgp on 2006-04-07 21:06:06:
- closedate changed to: "2006-04-07T14:06:06"
- closer changed to: "dgp"
Ticket change [59ca8f854e] (rid 118030) by sf-robot on 2006-04-22 09:22:40:
- icomment:
Logged In: YES user_id=1312539 This Tracker item was closed automatically by the system. It was previously set to a Pending status, and the original submitter did not respond within 14 days (the time period specified by the administrator of this Tracker).
- login: "sf-robot"
- mimetype: "text/plain"
- status changed to: "Closed"
- username: "sf-robot"
- icomment:
Ticket change [176bb39b9b] (rid 122490) by sf-robot on 2006-04-22 09:22:42:
- closedate changed to: "2006-04-22T02:22:42"
- closer changed to: "sf-robot"