busybox binaries hangs when trying to do "lstat"

Ralf Friedl Ralf.Friedl at online.de
Fri Jun 6 17:36:19 UTC 2008


Sid Kapoor wrote:
> Hi all,
>
> The busybox 'ls' applet uses the kernel(system) calls such as lstat to
> locate mounted file system information. When a file system has been
> mounted from an NFS server and that server is temporarily unavailable,
> the calls 'lstat' uses may block in the kernel, resulting in the whole
> terminal in a hung-up status.
>
> I NFS mounted a folder at the mount point '/root/tmp/'. When the
> server was unavailable, and 'ls' was executed at /root, it tried to
> locate mounted file system's information. Eventually the system did
> not respond to the 'lstat' call and the system hanged. The final lines
> of the log of the strace command while executing 'ls' is as follows
> (full log file is attached with this mail) :
>
>
> lstat64("./tmp", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
> --- SIGHUP (Hangup) @ 0 (0) ---
> +++ killed by SIGHUP +++
>
> Can anyone tell the reason why is this happening? Is it a bug in
> busybox? Waiting for reply.
>   
The last line from strace shows that lstat succeeds.
You may consider the NFS option 'soft' for your mount.

The reason why busybox ls uses lstat is that is uses colored display of 
names by default, even with no options or environment variables set.

Regards
Ralf Friedl



More information about the busybox mailing list