busybox binaries hangs when trying to do "lstat"

Sid Kapoor sidkapoor2000 at gmail.com
Fri Jun 6 17:25:35 UTC 2008


---------- Forwarded message ----------
From: Sid Kapoor <sidkapoor2000 at gmail.com>
Date: Fri, Jun 6, 2008 at 10:53 PM
Subject: busybox binaries hangs when trying to do "lstat"
To: busybox at busybox.net


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) :


open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\20Z\1\000"...,
512) = 512
fstat64(3, {st_mode=S_IFREG|0777, st_size=1248904, ...}) = 0
mmap2(NULL, 1258876, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE,
3, 0) = 0xb7e65000
mmap2(0xb7f92000, 16384, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x12c) = 0xb7f92000
mmap2(0xb7f96000, 9596, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7f96000
close(3)                                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0xb7e64000
set_thread_area({entry_number:-1 -> 6, base_addr:0xb7e646b0,
limit:1048575, seg_32bit:1, contents:0, read_exec_only:0,
limit_in_pages:1, seg_not_present:0, useable:1}) = 0
mprotect(0xb7f92000, 8192, PROT_READ)   = 0
mprotect(0x36aa000, 4096, PROT_READ)    = 0
getuid32()                              = 0
getpid()                                = 15915
time(NULL)                              = 1212803764
ioctl(0, TIOCGWINSZ, {ws_row=24, ws_col=80, ws_xpixel=724, ws_ypixel=508}) = 0
ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
stat64(".", {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
brk(0)                                  = 0x80df000
brk(0x8100000)                          = 0x8100000
open(".", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
fstat64(3, {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
getdents64(3, /* 32 entries */, 1024)   = 1008
lstat64("./abc", {st_mode=S_IFREG|0755, st_size=48, ...}) = 0
lstat64("./img.jpg", {st_mode=S_IFREG|S_ISGID|S_ISVTX|0745,
st_size=27291, ...}) = 0
lstat64("./Desktop", {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
lstat64("./ControlCenter", {st_mode=S_IFREG|0755, st_size=955503, ...}) = 0
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.

Thanks in advance,
Siddharth



-- 
Siddharth Kapoor
Sr. Software Engg., Monitor Group
Samsung India Software Center(SISC), Noida
Mobile - 9999169466
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: log
Url: http://lists.busybox.net/pipermail/busybox/attachments/20080606/1f6eac5a/attachment.diff 


More information about the busybox mailing list