Skip to content
Tcl Source Code View Ticket
Login

View Ticket

error stack report failure

Closed / Fixed573758ffffffffffffffffffffffffffffffffffCreated 24 years agoUpdated 24 years ago
Descriptionplain2002-06-25 18:28:35
Problem seen today from tcl 8.4b1 built from the
activestate ftp snapshot of the cvs head - June 25, 2002.

Platform: SPARC Solaris 2.6
Sun C compiler
configured --prefix=/usr/tcl84 --enable-symbols
--enable-shared


$ tclsh8.3 ~/bin/b64encode /etc/motd
couldn't open "": no such file or directory
    while executing
"open [lindex $argv 1] "r""
    invoked from within
"if { $argc > 0 } {
        set fin [open [lindex $argv 1] "r"]
 } else {
        set fin stdin
 }"
    (file "/home/lwv26/bin/b64encode" line 7)
lvirden
 $ tclsh8.4 ~/bin/b64encode /etc/motd
    while executing
"open [lindex $argv 1] "r""
    invoked from within
"if { $argc > 0 } {
        set fin [open [lindex $argv 1] "r"]
 } else {
        set fin stdin
 }"
    (file "/home/lwv26/bin/b64encode" line 7)
l
Notice the missing "couldn't open" message in 8.4b1?

From the wiki chat, this occured:
aku
Oh, the creation of the error stack is off somehow
dgp
proabably an error in the new VFS code.  File it.
aku
Didn't we have changes in that area ?
dgp
is this new since 8.4a4 ?
lvirden
I don't know - I dont have 8.4a4 around.
lvirden
what category would this error be in?
dgp
seems to be no error message when the path does not
belong to any file system ?
dgp
35. File System
dgp
aku, see end of Tcl_FSOpenFileChannel().
lvirden
there doesn't appear to be an 8.4b1 group to which I
can assign this - so I will use 8.4a5 ...
lvirden Ticket [573758ffff]: 1 change [History diff]2002-06-26 01:34:29
dgpplain2002-06-26 03:20:42
Logged In: YES 
user_id=80530

more from the chat:

dgp
so possibly 2 bugs in Tcl then.
dgp
1) Why isn't an empty path referred to the native filesystem.
dgp
2) When no filesystem claims a path, report an error to that
effect.
vincentdarleyplain2002-06-26 22:10:10
Logged In: YES 
user_id=32170

(1) is not a bug.  "" is not a valid path in the native 
filesystem under any circumstances that I am aware of, 
and for technical reasons it is best that the native 
filesystem never claim it.

(2) of course is a bug.  The relevant code which needs to 
go at the end of Tcl_FSOpenFileChannel is:

    /* File doesn't belong to any filesystem that can open 
it */
    errno = ERROR_FILE_NOT_FOUND;
    if (interp != NULL) {
Tcl_AppendResult(interp, "couldn't open \"", 
 Tcl_GetString
(pathPtr), "\": ",
 Tcl_PosixError(interp), 
(char *) NULL);
    }

feel free to test and apply...
dkfplain2002-06-26 22:16:51
Logged In: YES 
user_id=79902

It seems there are a number of paths through the FS code
that can end up bailing out without generating the correct
error code; the problem comes because of missing
   Tcl_SetErrno(ENOENT);
from Tcl_FSOpenFileChannel(), Tcl_FSUtime(),
Tcl_FSFileAttrStrings(), Tcl_FSFileAttrsGet(),
Tcl_FSFileAttrsSet(), Tcl_FSDeleteFile(),
Tcl_FSCreateDirectory(), Tcl_FSRemoveDirectory(), *probably*
Tcl_FSLoadFile() and Tcl_FSLink(), and *possibly*
Tcl_FSMatchInDirectory() and Tcl_FSGetCwd() (though the
logic for them is a bit more complex than I can hack through
in a few minutes without deep prior knowledge.)

Tcl_FSOpenFileChannel() is the definite culprit when it
comes to this bug; please add a test as well.  (Bumped the
priority, as this is such an unhelpful error message!)
vincentdarleyplain2002-06-26 22:56:59
Logged In: YES 
user_id=32170

Applying fix to cvs head. -- Thanks.
Log in (anonymous is fine) to add a comment.