Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Infinite recursion on [cd]

Closed / Fixed845778ffffffffffffffffffffffffffffffffffCreated 23 years agoUpdated 23 years ago
Descriptionplain2003-11-20 13:19:52
Under Windows 2000, with tclsh8.5 snapshot 20031119:
cd g:
cd c:
crash with an infinite recursion.

Here is the stack:

Tcl_FSGetPathType(Tcl_Obj * 0x00912458) line 242 + 
13 bytes

Tcl_FSGetNormalizedPath(Tcl_Interp * 0x00000000, 
Tcl_Obj * 0x00912458) line 1219 + 9 bytes
TclFSEnsureEpochOk(Tcl_Obj * 0x00912458, 
Tcl_Filesystem * * 0x0003321c) line 1444 + 11 bytes
Tcl_FSGetFileSystemForPath(Tcl_Obj * 0x00912458) line 
3718 + 13 bytes
Tcl_FSGetCwd(Tcl_Interp * 0x00000000) line 2349 + 12 
bytes

Tcl_FSGetNormalizedPath(Tcl_Interp * 0x00000000, 
Tcl_Obj * 0x00912458) line 1244 + 9 bytes
TclFSEnsureEpochOk(Tcl_Obj * 0x00912458, 
Tcl_Filesystem * * 0x000332f0) line 1444 + 11 bytes
Tcl_FSGetFileSystemForPath(Tcl_Obj * 0x00912458) line 
3718 + 13 bytes
Tcl_FSGetCwd(Tcl_Interp * 0x00000000) line 2349 + 12 
bytes

Tcl_FSGetNormalizedPath(Tcl_Interp * 0x00000000, 
Tcl_Obj * 0x00912458) line 1244 + 9 bytes
TclFSEnsureEpochOk(Tcl_Obj * 0x00912458, 
Tcl_Filesystem * * 0x000333c4) line 1444 + 11 bytes
Tcl_FSGetFileSystemForPath(Tcl_Obj * 0x00912458) line 
3718 + 13 bytes
Tcl_FSGetCwd(Tcl_Interp * 0x00000000) line 2349 + 12 
bytes

...
dkfplain2003-11-20 21:41:27
Logged In: YES 
user_id=79902

Can't even begin to reproduce here as I don't have a G
drive.  :)

Care to tell us a bit more about your system configuration?
bericplain2003-11-20 22:28:20
Logged In: YES 
user_id=493507

G is a mounted samba volume, but this does not work with my 
cd-rom drive too.
The wish console crash at the first [cd g:], while tclsh crash 
at the second [cd].
nobodyplain2003-11-20 23:06:54
Logged In: NO 

This bug is most likely caused by the relatively recent
normalization of volume-relative paths in Tcl.  I'll look
into fixing it.
vincentdarleyplain2003-11-21 01:44:03
Logged In: YES 
user_id=32170

I've fixed this in 8.5a0. I'm reassigning to Jeff to fix in
8.4.5 if he deems appropriate (my strong recommendation is
'yes').

I've also compared behaviour between Tcl 8.3 and 8.4/8.5 in
this area and the handling of volume relative paths is now
the same as 8.3 (except normalized where appropriate).

I'm attaching the patch that was used to fix the bug in 8.5a0.
vincentdarleyplain2003-11-21 01:44:04
File Added - 68116: cdrecursefix.patch
hobbsplain2003-11-21 01:52:49
Logged In: YES 
user_id=72656

please apply patch to core-8-4-branch as well.
vincentdarleyplain2003-11-21 02:11:40
Logged In: YES 
user_id=32170

Fixed in 8.4 branch too.
hobbsplain2004-05-05 05:20:13
Logged In: YES 
user_id=72656

It turns out that another problem was related to this that I
have added a way-hacky work-around in 8.4 for.  The simple
script:

set env(HOME) c:
cd
pwd

would crash due to infinite recursion.  This is not an issue
in 8.5 with TCL_FILESYSTEM_VERSION_2, but is in 8.4
(although ugly work-around exists in core post-2004-05-04).
Log in (anonymous is fine) to add a comment.

Attachments: