Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Infinite loop in the virtual filesystem code

Closed / Fixed873311ffffffffffffffffffffffffffffffffffCreated 23 years agoUpdated 23 years ago
Descriptionplain2004-01-08 20:59:55
In tclIOUtil.c about line 650 in the
TclFinalizeFilesystem()
function we have:

    fsRecPtr = filesystemList;
    while (fsRecPtr != NULL) {
        tmpFsRecPtr = filesystemList->nextPtr;
                      ^^^^^^^^^^^^^^
                      should be fsRecPtr

        if (fsRecPtr->fileRefCount <= 0) {
            /* The native filesystem is static, so we
don't free it */
            if (fsRecPtr != &nativeFilesystemRecord) {
                ckfree((char *)fsRecPtr);
            }
        }
        fsRecPtr = tmpFsRecPtr;
    }
    filesystemList = NULL;

The effect of this error is that if you have ever called
Tcl_FSRegister(), you get stuck in an infinite loop when
you try to shut down.

In case the copy/paste above gets mangled by this bug
tracking system (which seems likely) I will restate the
bug in prose:  The "filesystemList" variable on line 625
of tclIOUtil.c version 1.92 should be "fsRecPtr".
dkf Ticket [873311ffff]: 1 change [History diff]2004-01-09 17:01:09
vincentdarleyplain2004-01-09 20:20:32
Logged In: YES 
user_id=32170

Thank you.  This has been fixed in the 8.4 branch now, and
will soon be fixed in 8.5 too.
vincentdarley Closed ticket [873311ffff]. [History diff]2004-01-09 22:26:12
Log in (anonymous is fine) to add a comment.