Bug 22761

Summary: ls locks up on directory listing
Product: Base System Reporter: dannyman <dannyman>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me CC: dannyman
Priority: Normal    
Version: 3.5-RELEASE   
Hardware: Any   
OS: Any   

Description dannyman 2000-11-11 02:20:01 UTC
0-18:05 dannyman@never ~> truss ls ~firooz/work/feeds/incoming/sportsticker/11-10
syscall ioctl(1,TIOCGETA,0xbfbfd96c)
        returns 0 (0x0)
syscall ioctl(1,TIOCGWINSZ,0xbfbfd9bc)
        returns 0 (0x0)
syscall getuid()
        returns 501 (0x1f5)
syscall readlink("/etc/malloc.conf",0xbfbfd8f0,63)
        errno 2 'No such file or directory'
syscall mmap(0x0,4096,0x3,0x1002,-1,0x0)
        returns 671551488 (0x28071000)
syscall break(0x807d000)
        returns 0 (0x0)
syscall break(0x807e000)
        returns 0 (0x0)
syscall break(0x807f000)
        returns 0 (0x0)
syscall break(0x8080000)
        returns 0 (0x0)
syscall stat("/home/firooz/work/feeds/incoming/sportsticker/11-10",0xbfbfd8d8)
        returns 0 (0x0)
syscall open(".",0,00)
        returns 3 (0x3)
syscall fchdir(0x3)
        returns 0 (0x0)
syscall stat("/home/firooz/work/feeds/incoming/sportsticker/11-10",0xbfbfd8ac)
        returns 0 (0x0)

Command works on all other systems, including Solaris x86, Linux, and a
3.5-STABLE running a non-SMP kernel.  User reports that he can not get
directory listing via FTP, or od the directory.

Can not ^C or ^Z in tcsh or zsh, can not kill or kill -9 the process:

0-18:15 dannyman@never ~> ps -u dannyman | grep ls
dannyman 91056  0.0  0.0   356  196  r5- D     5:50PM   0:00.00 ls -F -l /home/
dannyman 95831  0.0  0.1   836  464  rg  I+    6:05PM   0:00.03 truss ls /home/
dannyman 95833  0.0  0.0   356  196  rg  D+    6:05PM   0:00.01 ls /home/firooz
0-18:15 dannyman@never ~> kill 91056 95831 95833
0-18:15 dannyman@never ~> kill -9 91056 95831 95833
0-18:16 dannyman@never ~> ps -u dannyman | grep ls
dannyman 91056  0.0  0.0   356  196  r5- D     5:50PM   0:00.00 ls -F -l /home/
dannyman 95833  0.0  0.0   356  196  rg  D     6:05PM   0:00.01 ls /home/firooz

Okay, so I was able to kill truss. :)

I am able to cat an arbitrary file within the directory.
Comment 1 dannyman 2000-11-11 07:16:20 UTC
Additional data from Firooz:

O.K.  I moved all the files out of "11-10" and into another directory, "y".
Then I renamed the empty "11-10" directory to "x", and renamed "y" to
"11-10".  Now, you can do an ls of 11-10 that contains all the files of the
original 11-10, but you can't do an ls of the empty directory "x".  It
either has to do with the inode for x or with the contents of x as shown by
the od command.  Unfortunately, I cannot do an od of x, because of NFS.
Below is the result of stat on x.  The only notable thing (that can also be
seen by an ls -l command) is the size of the directory, which has remained
large after deleting all those files, but this has to do with the way
directories are implemented.  Most implementations do not do garbage
collection on directories every time you remove files from them.

By the way, this all is under ~firooz/work/feeds/incoming/sportsticker.

-Firooz
File name = /home/firooz/work/feeds/incoming/sportsticker/x

File type = directory

File mode = 00040755

Inode number = 5533051

Device id = 33540

Raw device id = 0

Number of links = 2

User ID = 570

Group ID = 101

File size in bytes = 663552

Time of last access = Fri Nov 10 20:23:24 2000

Time of last modification = Fri Nov 10 20:22:37 2000

Time of last inode change = Fri Nov 10 20:38:29 2000

Preferred I/O block size = 512

Number of 512-byte blocks = 1304
Comment 2 Doug Barton freebsd_committer freebsd_triage 2000-11-11 21:08:15 UTC
State Changed
From-To: open->closed


What you have here is not actually a problem report. This 
really should have been posted to 
freebsd-questions@freebsd.org, where you would have been 
told that the NFS code is greatly improved in version 4, 
and your best bet is to either upgrade to 4-Stable asap; 
or wait till 4.2-RELEASE comes out in a few days and 
upgrade then.  

Either way, please follow up to questions- if you need 
further assistance.