Skip to content
Tcl Source Code Artifact [97f37b9458]
Login

Artifact [97f37b9458]

Artifact 97f37b94589afb3f3cc5dd3d68afa7ed6a08aa04:

Ticket change [97f37b9458] - Ticket [1064247fffffffff|1064247fff] <i>filesystem-7.8 fails on darwin without NO_REALPATH</i> status still Open with 6 other changes by das on 2006-03-28 15:47:35.
D 2006-03-28T15:47:35
J foundin obsolete:\s8.5a3
J icomment Logged\sIn:\sYES\s\nuser_id=90580\n\nVince,\n\nthis\sis\sstill\sfailing,\slooking\sit\swhy\sonce\sagain\n\nyou\swrote:\n>\sTclpObjNormalizePath\sshould\snot\sbe\scalled\son\sa\spath\sstarting\n>\swith\s"simplefs:/"\s(assuming\sthe\ssimplefilesystem\sis\n>\sregistered,\sof\scourse).\n>\s\n>\sWhy\sis\sthis\sbeing\scalled?\n\nthe\srelevant\sbacktrace\sfrom\scurrent\sHEAD\sis\n\n(gdb)\sbt\n#0\s\sTclpObjNormalizePath\s(interp=0x0,\spathPtr=0x7a6018,\s\nnextCheckpoint=0)\sat\sunix/tclUnixFCmd.c:1870\n#1\s\s0x000a6854\sin\sTclFSNormalizeToUniquePath\s(interp=0x0,\s\npathPtr=0x7a6018,\sstartAt=0,\sclientDataPtr=0xbfff9ae0)\sat\sgeneric/\ntclIOUtil.c:1448\n#2\s\s0x000cb6cc\sin\sTclFSNormalizeAbsolutePath\s(interp=0x0,\s\npathPtr=0x7a6450,\sclientDataPtr=0xbfff9b98)\sat\sgeneric/tclPathObj.c:406\n#3\s\s0x000ce5cc\sin\sTcl_FSGetNormalizedPath\s(interp=0x0,\s\npathPtr=0x7a64c8)\sat\sgeneric/tclPathObj.c:1900\n#4\s\s0x000a8c30\sin\sTcl_FSChdir\s(pathPtr=0x7a64c8)\sat\sgeneric/\ntclIOUtil.c:2854\n\ni.e.\s\sTcl_FSGetNormalizedPath\scalls\sTclFSNormalizeAbsolutePath\swith\sa\s\npathPtr\sof\s'simplefs:/simpledir'\swhich\sin\sturn\scalls\s\nTclFSNormalizeToUniquePath\swith\sthe\ssame\spathPtr,\swhich\sends\sup\scalling\s\nthe\snative\snormalize\son\sthat\spath\s(c.f.\sbelow\sfor\sanother\slikely\sbug\sdiscovered\s\nin\sTclFSNormalizeToUniquePath).\n\nTo\sfix\sthe\sissue\sin\sTclpObjNormalizePath,\sI\swould\spropose\ssimply\schecking\s\nwhether\srealpath\shas\stransformed\sa\srelative\spath\sinto\san\sabsolute\sone\sand\sif\s\nyes,\sfalling\sback\sto\sthe\sslow\smethod.\sI\shave\sverified\sthat\sthis\ssituation\sonly\s\ncomes\sup\sin\sa\sfew\sedge\scase\stests\sin\sfileSystem.test\swhen\srunning\sthe\s\ncomplete\stestsuite:\n\n----\sfilesystem-1.33\sstart\nTclpObjNormalizePath:\srealpath\srelative\s->\sabsolute:\s'C:'\s->\s'/tmp/C:'\n----\sfilesystem-7.2\sstart\nTclpObjNormalizePath:\srealpath\srelative\s->\sabsolute:\s'simplefs:'\s->\s'/\ntmp/simplefs:'\n----\sfilesystem-7.4\sstart\nTclpObjNormalizePath:\srealpath\srelative\s->\sabsolute:\s'simplefs:'\s->\s'/\ntmp/simplefs:'\nTclpObjNormalizePath:\srealpath\srelative\s->\sabsolute:\s'simplefs:'\s->\s'/\ntmp/simplefs:'\n----\sfilesystem-7.5\sstart\nTclpObjNormalizePath:\srealpath\srelative\s->\sabsolute:\s'simplefs:'\s->\s'/\ntmp/simplefs:'\nTclpObjNormalizePath:\srealpath\srelative\s->\sabsolute:\s'simplefs:'\s->\s'/\ntmp/simplefs:'\n----\sfilesystem-7.6\sstart\nTclpObjNormalizePath:\srealpath\srelative\s->\sabsolute:\s'simplefs:'\s->\s'/\ntmp/simplefs:'\nTclpObjNormalizePath:\srealpath\srelative\s->\sabsolute:\s'simplefs:'\s->\s'/\ntmp/simplefs:'\n----\sfilesystem-7.7\sstart\nTclpObjNormalizePath:\srealpath\srelative\s->\sabsolute:\s'simplefs:'\s->\s'/\ntmp/simplefs:'\nTclpObjNormalizePath:\srealpath\srelative\s->\sabsolute:\s'simplefs:'\s->\s'/\ntmp/simplefs:'\n----\sfilesystem-7.8\sstart\nTclpObjNormalizePath:\srealpath\srelative\s->\sabsolute:\s'simplefs:'\s->\s'/\ntmp/simplefs:'\n\na\spatch\sto\stclUnixFCmd.c\simplementing\sthis\sworkaround\sis\sbelow,\sit\sfixes\sthe\s\nfailure\sin\sfilesystem-7.8\son\sDarwin.\nIf\syou\sagree,\sI\swould\slike\sto\scommit\sthis\sfor\s8.5a4.\n\nAs\sto\sthe\slikely\sbug\sin\sTclFSNormalizeAbsolutePath,\sit\sappears\sthat\sthe\scheck\s\nfor\sfsRecPtr\s==\s&nativeFilesystemRecord\scan\sfail\seven\sif\sfsRecPtr\sactually\s\ncontains\sthe\snative\sfilesystem:\n\n(gdb)\sp\s&nativeFilesystemRecord\n$1\s=\s(FilesystemRecord\s*)\s0x146c7c\n(gdb)\sp\s*(&nativeFilesystemRecord)\n$2\s=\s{\n\s\sclientData\s=\s0x0,\s\n\s\sfsPtr\s=\s0x146c00,\s\n\s\sfileRefCount\s=\s1,\s\n\s\snextPtr\s=\s0x0,\s\n\s\sprevPtr\s=\s0x7c9068\n}\n(gdb)\sp\sfsRecPtr\n$3\s=\s(FilesystemRecord\s*)\s0x7c9008\n(gdb)\sp\s*fsRecPtr\n$4\s=\s{\n\s\sclientData\s=\s0x0,\s\n\s\sfsPtr\s=\s0x146c00,\s\n\s\sfileRefCount\s=\s1,\s\n\s\snextPtr\s=\s0x0,\s\n\s\sprevPtr\s=\s0x7c9088\n}\n\nthis\sresults\sin\sthe\snormalize\sfunction\sfor\sthe\snative\sFS\sto\sbe\scalled\slast\s\ninstead\sof\sfirst\sas\sintended\n\n\s\s\s\s/*\n\s\s\s\s\s*\sCall\seach\sof\sthe\s"normalise\spath"\sfunctions\sin\ssuccession.\sThis\sis\sa\n\s\s\s\s\s*\sspecial\scase,\sin\swhich\sif\swe\shave\sa\snative\sfilesystem\shandler,\swe\scall\n\s\s\s\s\s*\sit\sfirst.\sThis\sis\sbecause\sthe\sroot\sof\sTcl's\sfilesystem\sis\salways\sa\n\s\s\s\s\s*\snative\sfilesystem\s(i.e.\s'/'\son\sunix\sis\snative).\n\s\s\s\s\s*/\n\none\sway\sto\sfix\sthis\smight\sbe\sto\schange\stests\sfor\sthe\snative\sFS\sin\stclIOUtil.c\sas\s\nfollows\n\n-if\s(fsRecPtr\s==\s&nativeFilesystemRecord)\s{\n+if\s(fsRecPtr->fsPtr\s==\snativeFilesystemRecord.fsPtr)\s{\n\nhowever,\sit\swould\sprobably\sbe\sbetter\sto\sfigure\sout\swhy\sthe\srecord\sfor\sthe\s\nnative\sFS\sin\sfilesystemList\scan\sbecome\sdifferent\sfrom\snativeFilesystemRecord\s\nin\sthe\sfirst\splace,\sI\shaven't\slooked\sinto\sthis.\n\nNote\sthat\sthis\ssecond\sbug\shas\sno\simpact\son\sthe\sfilesystem-7.8\sfailure,\sas\sthe\s\nnative\snormalize\sis\sstill\scalled\son\s'simplefs:/simpledir'\sat\ssome\spoint\sin\s\nTclFSNormalizeToUniquePath\seven\sif\sthe\scheck\sis\schanged\sas\sabove.\n\n\nIndex:\sunix/tclUnixFCmd.c\n===============================================\n====================\nRCS\sfile:\s/cvsroot/tcl/tcl/unix/tclUnixFCmd.c,v\nretrieving\srevision\s1.52\ndiff\s-u\s-p\s-r1.52\stclUnixFCmd.c\n---\sunix/tclUnixFCmd.c25\sMar\s2006\s01:32:11\s-00001.52\n+++\sunix/tclUnixFCmd.c28\sMar\s2006\s08:14:43\s-0000\n@@\s-1884,8\s+1884,17\s@@\sTclpObjNormalizePath(\n\s\s\s\s\snativePath\s=\sTcl_UtfToExternalDString(NULL,\spath,\n\s\s\s\s\slastDir-path,\s&ds);\n\s\s\s\s\sif\s(Realpath(nativePath,\snormPath)\s!=\sNULL)\s{\n-nextCheckpoint\s=\slastDir\s-\spath;\n-goto\swholeStringOk;\n+if\s(*nativePath\s!=\s'/'\s&&\s*normPath\s==\s'/')\s{\n+\s\s\s\s/*\n+\s\s\s\s\s*\srealpath\shas\stransformed\sa\srelative\spath\sinto\san\n+\s\s\s\s\s*\sabsolute\spath,\swe\sdo\snot\sknow\show\sto\shandle\sthis.\n+\s\s\s\s\s*/\n+\s\s\s\sfprintf(stderr,\s"TclpObjNormalizePath:\srealpath\srelative\s->\s\nabsolute\\n");\n+\s\s\s\sTcl_DStringFree(&ds);\n+}\selse\s{\n+\s\s\s\snextCheckpoint\s=\slastDir\s-\spath;\n+\s\s\s\sgoto\swholeStringOk;\n+}\n\s\s\s\s\s}\n\s}\n\s\s\s\s\s}\n\n
J login das
J mimetype text/plain
J priority 9\sImmediate
J username das
K 1064247fffffffffffffffffffffffffffffffff
U das
Z 6bdf0e5ada166e4d5c2ec407f73059c6