Bug 30878 - tcsh autolist and wildcard / csh wildcard problem
tcsh autolist and wildcard / csh wildcard problem
Status: CLOSED DUPLICATE of bug 73877
Product: Red Hat Linux
Classification: Retired
Component: tcsh (Show other bugs)
7.1
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Miloslav Trmač
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-03-06 17:58 EST by Ulug Unligil
Modified: 2007-04-18 12:32 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-02-21 13:47:56 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
strace tcsh -cf 'ls F99UA1.L.full.segment.final.5.SPHERE*coord' (57.07 KB, text/plain)
2002-01-31 14:56 EST, Donna Hanlon
no flags Details

  None (edit)
Description Ulug Unligil 2001-03-06 17:58:42 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; Win 9x 4.90)


In tcsh, autocomplete fails to show all files.  Wildcards also fail
to show all files; this appears to hold for csh as well.  

Reproducible: Sometimes
Steps to Reproduce:
1.use tcsh
2.go to a directory where the problem has been seen before
3.The same files are always missing from autocomplete/wildcards.
4.I have been unable to predict which files will not appear.  

Actual Results:  Example 1:

xtal18 5:50pm /programs.i386-linux/ssh >ls 2.3.0/

Esample 2: 

xtal18 5:42pm /programs.iris4d/amore >ls -lt *
-rw-r--r--    1 root     root        49353 Feb 21 16:52 symop.d
-rw-r--r--    1 root     root       122587 Feb 21 16:52 tutorial.ps
-rw-r--r--    1 root     root         8123 Feb 21 16:52 maitre.for
-rw-r--r--    1 root     root       197761 Feb 21 16:52 writeup.ps
-rw-r--r--    1 root     root        35659 Feb 21 16:52 factor.d
-rw-r--r--    1 root     root        16336 Feb 21 16:52 setup

Expected Results:  Example 1:  

xtal18 5:50pm /programs.i386-linux/ssh >ls
2.3.0  2.4.0

Example 2:

xtal18 5:42pm /programs.iris4d/amore >ls -lt
total 428
drwxr-xr-x    2 root     root           84 Feb 21 16:52 bin_sgi_6.5_f77
-rw-r--r--    1 root     root        49353 Feb 21 16:52 symop.d
-rw-r--r--    1 root     root       122587 Feb 21 16:52 tutorial.ps
-rw-r--r--    1 root     root         8123 Feb 21 16:52 maitre.for
-rw-r--r--    1 root     root       197761 Feb 21 16:52 writeup.ps
-rw-r--r--    1 root     root        35659 Feb 21 16:52 factor.d
-rw-r--r--    1 root     root        16336 Feb 21 16:52 setup

In example 1, a 'tab' press for autolist fails to show both directories. 

In example 2, a * wildcard in csh fails to show a directory.  

This affects not just directories, but also files.  What file will be 
affected appears random, but the problem is widespread.  Possible problems 
are in cshrc file or in csh itself, I suppose.
Comment 1 s.maass 2001-04-17 13:26:55 EDT
I have the same problem with the tcsh. If the autocomplete fails in the tcsh for one file or
directory, than it also fail in emacs !

Question to all the others: Could it be that it only appears on nfs mounted partitions ???
Comment 2 s.maass 2001-04-22 09:17:23 EDT
midnight commander also hide the directories and files that are always
missing from the tcsh autocomplete.

Until now this bug is only noticed on files and dirs on nfs mounted partitions.
Comment 3 s.maass 2001-04-22 09:24:21 EDT
midnight commander also hide the directories and files that are always
missing from the tcsh autocomplete.

Until now this bug is only noticed on files and dirs on nfs mounted partitions.
Comment 4 Need Real Name 2001-04-22 09:38:34 EDT
This problem somehow seems to be related to the nfs problem reported as Bug -
30944. After installing the patch from
http://www.fys.uio.no/~trondmy/src/2.4.2/linux-2.4.2-dir.dif as suggested there,
the problem disappeared. At least over here ;-).

Comment 5 Stephen Rowles 2001-06-06 13:10:50 EDT
More Detail:

tcsh appears to fail when expanding the * wildcard on nfs mounted directory 
from our SGI fileservers. It does not fail when expanding * on an nfs 
mounted directory served from a redhat 7.1 machine or on the local filesystem.

the section of strace which appears to be important:

strace tcsh -c 'echo *' on a SGI nfs directory gives:

rt_sigprocmask(SIG_SETMASK, [], [INT], 8) = 0
open(".", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
fstat64(3, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
getdents64(3, /* 20 entries */, 32768)  = 800
_llseek(3, 18446744073199903873, 0xbfff0200, SEEK_SET) = -1 EINVAL (Invalid 
argument)
lstat64("libglx.so.1.0.1251", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
lstat64("mga_drv.o", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
lstat64("mgapdesk-1_00-5beta.i386.rpm", {st_mode=S_IFREG|0644, st_size=0, ...}) 
= 0
lstat64("NVdriver", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
lstat64("config-2.4.4", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0


Which has an odd _llseek call.

The same on a local file system produces:

rt_sigprocmask(SIG_SETMASK, [], [INT], 8) = 0
open(".", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
fstat64(3, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
getdents64(3, /* 20 entries */, 4096)   = 800
lstat64("config-2.4.4", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
lstat64("initrd-2.4.4.img", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
lstat64("kdmrc", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
lstat64("libGLcore.so.1.0.1251", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
lstat64("libGL.so.1.0.1251", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
lstat64("libglx.so.1.0.1251", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0

no _llseek call. You also don't get one from a nfs directory served from a 
redhat 7.1 box.

If you do an unsorted directory listing (ls -U) it is always the last listed 
file that is missing.

If you run sh instead (sh -c 'echo *') then this behaves correctly and returns 
all files, so it is definately a tcsh and nfs interaction problem.
Comment 6 Stephen Rowles 2001-06-07 10:16:04 EDT
Bug also present if you use tcsh 6.09.00 as opposed to 6.10.00 when reading nfs 
mounted partions.
Comment 7 Jason Allen 2001-06-11 16:36:39 EDT
The issue doesn't appear to be entirely tcsh specific as we have reproduced the
wildcard expansion problem with bash 2.02.0(1) on dirs NFS mounted from IRIX
6.5.11 .  Bash 2.04.21(1) which ships with RH7.1 seems to work correctly.
Comment 8 Stephen Rowles 2001-06-26 06:12:11 EDT
Having looked at a similar bug about NFS (#30944) there is a patch called linux-
2.4.2-dir.dif which can be found here: http://www.fys.uio.no/~trondmy/src/2.4.2/
This is described as: "An experimental patch for fixing a problem that is due 
to NFSv(2|3) readdir returning (32|64) bit unsigned offsets"

I sucessfully applied this to my 2.4.4 kernel using patch -p1 from the kernel 
source root directory. This appears to have solved all the problems that I have 
been having, including allowing StarOffice 5.2 to work properly again.

So my only outstanding query is why this behaviour is only exhibited in tcsh as 
part of redhat 7.1 and not in sh / bash.
Comment 9 Donna Hanlon 2002-01-31 14:56:27 EST
Created attachment 44177 [details]
strace tcsh -cf 'ls F99UA1.L.full.segment.final.5.SPHERE*coord'
Comment 10 Donna Hanlon 2002-01-31 14:59:20 EST
I'm having similar globbing problems (wildcards not matching when they should)
in tcsh on RedHat 7.1 with IRIX 6.5 nfs file systems.

pulvinar 46% uname -a
Linux pulvinar 2.4.9-12 #1 Tue Oct 30 18:33:49 EST 2001 i686 unknown
pulvinar 47% echo $SHELL
/bin/tcsh
pulvinar 48% ls *coord
ls: No match.
pulvinar 49% sh
sh-2.04$ ls *coord
BAK.F99UA1.L.full.34132.flat.CartStd.coord
BAK.F99UA1.L.full.34132.sphere.SphStd.coord
F99UA1.L.full.34132.flat.at0.5mm.CartStd.coord
F99UA1.L.full.34132.flat.CartStd2.At1mm.coord
F99UA1.L.full.34132.flat.CartStd.At1mm.coord
F99UA1.L.full.34132.flat.CartStd.At1mm.newcut.sm.coord
F99UA1.L.full.34132.flat.CartStd.At1mm.newcut.sm.FLAT_CYCLE1.34132.coord
F99UA1.L.full.34132.flat.CartStd.At1mm.newcut.sm.FLAT_CYCLE2.34132.coord
F99UA1.L.full.34132.flat.CartStd.At1mm.newcut.sm.FLAT_CYCLE3.34132.coord
F99UA1.L.full.34132.flat.CartStd.coord
F99UA1.L.full.34132.sphere.SphStd.At1mm..coord
F99UA1.L.full.34132.sphere.SphStd.coord
F99UA1.L.full.fiducial.SmoothedMW_ACorigin.34132.coord
F99UA1.L.full.fiducial.SmoothedMW_ACorigin.At0.5mm.34132.coord
F99UA1.L.full.fiducial.SmoothedMW_ACorigin.At1mm.34132.coord
F99UA1.L.full.inflated.At1mm.34132.coord
F99UA1.L.full.segment.final.5.CompressedMedialWall.34132.coord
F99UA1.L.full.segment.final.5.ellipsoid.34132.coord
F99UA1.L.full.segment.final.5.fiducial.34132.coord
F99UA1.L.full.segment.final.5.fiducial.clean.34132.coord
F99UA1.L.full.segment.final.5.fiducial.clean_closed.34132.coord
F99UA1.L.full.segment.final.5.fiducial.clean_closed.smMW.34132.coord
F99UA1.L.full.segment.final.5.inflated.34132.coord
F99UA1.L.full.segment.final.5.InitialFlat.34132.coord
F99UA1.L.full.segment.final.5.InitialFlat.sm.34132.coord
F99UA1.L.full.segment.final.5.raw.34132.coord
F99UA1.L.full.segment.final.5.sphere.34132.coord
F99UA1.L.full.segment.final.5.SPHERE.34132.coord
sh-2.04$ 

Unlike the problem described in bug 30944, it is not just one/last file
missing.  Also, bug 30944 says Patch is in released errata kernel 2.4.3-12;
wouldn't this mean it would be included in higher kernel releases (above results
are using 2.4.9-12)?

I also thought the problem was restricted to tcsh, since bash results are good
in the above output; however, the way I found this problem directory was by
running this sh script on both IRIX and Linux and comparing the output:

#!/bin/sh

REV=`uname -a | cut -f1,3 -d' '|sed 's/ /_/g'`
OUTFNAME=files_$REV.txt
echo $OUTFNAME
#rm $OUTFNAME
FILE_SYSTEMS="/surface02 /sums2 /sums3 /stpb"

for FILE_SYSTEM in $FILE_SYSTEMS
do
        find $FILE_SYSTEM -name "*coord" | sort -uf >> $OUTFNAME
done

In this case, files_Linux_2.4.9-12.txt was missing
F99UA1.L.full.segment.final.5.SPHERE.34132.coord -- the last file in the
interactive sh results above.  (I confirmed the file was not missing/moved when
the script was run.)

Using kernel 2.4.2, I also have globbing problems, but with different
directories/files.

The attached file globtrace.txt
(https://bugzilla.redhat.com/bugzilla/showattachment.cgi?attach_id=44177) shows
the output from strace tcsh -cf 'ls F99UA1.L.full.segment.final.5.SPHERE*coord'.
Comment 11 Mark H Johnson 2004-03-03 12:35:08 EST
We are seeing the same symptom - will try to set up a test with a
more modern version to see if its been subsequently fixed.
Comment 12 Miloslav Trmač 2004-08-17 09:09:21 EDT

*** This bug has been marked as a duplicate of 73877 ***
Comment 13 Red Hat Bugzilla 2006-02-21 13:47:56 EST
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.

Note You need to log in before you can comment on or make changes to this bug.