Tcl Source Code

View Ticket
Login
Ticket UUID: 469c5ea507367fa9f8c8587c2502d93e0f425231
Title: VFS breaks when [pwd] is non-existent native directory
Type: Bug Created on: 2018-11-08 17:41:53
Submitter: dgp Assigned to: nobody
Subsystem: 37. File System Severity: Severe
Priority: 5 Medium Last modified: 2018-11-08 17:44:25
Status: Open Closed by: nobody
Resolution: None Closed on:
Version: 8.5+
Description:
Debian records this bug in Tcl filesystem operations:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=913189
User Comments:
dgp added on 2018-11-08 17:42:33:
Copying their demo:

o reproduce:

$ rm -rf d
$ mkdir d
$ cd d
$ rm -rf ../d
$ env - pwd
pwd: couldn't find directory entry in '..' with matching i-node
$ tclsh8.6
% file delete spong
error deleting "spong": bad address in system call argument
%

strace shows:

getcwd(0x7ffcf224aeb0, 4097)            = -1 ENOENT (No such file or directory)
lstat(NULL, 0x7ffcf224c100)             = -1 EFAULT (Bad address)

dgp added on 2018-11-08 17:44:25:
Comments there continue:

"Not sure why `file delete spong' needs to call cwd at all, but
certainly it should have a proper error check."

Tcl's Virtual File System tends to do a lot of 'cwd' calling to
determining which of the mounted filesystems a pathname should belong to.

It appears this failure dates back to the arrival of VFS in Tcl 8.5.