Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Good grief! Thousands of calls to stat()
- X-seq: zsh-workers 5127
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: Good grief! Thousands of calls to stat()
- Date: Sat, 30 Jan 1999 13:40:19 -0800
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
In the course of looking at Drazen's tty-initialization bugs/questions, I
happened to try running
strace -f zsh -i 2>& 1 > /dev/null < /dev/null
(for version 3.1.6-pws-6). Imagine my surprise when hundreds of screenfuls
of calls to stat() went by -- in fact, there appears to be a loop that calls
stat() once for each file in /dev, and that loop runs three times.
After much peering at the surrounding output, I finally stuck some calls to
write() into setupvals() and tracked it as far as createparamtable() -- the
first system call after entering createparamtable() is the brk() to allocate
the space, and it finally surfaces 4130 system calls later, nearly all of
which are stat("/dev/somethingorother").
Anybody have any idea what's going on here? I'll try to narrow it further,
but with all the functions that get run callback-style when certain of the
parameters are changed, it's a real pain.
There's even a call to ioctl(0, TIOCGWINSZ, ...) happening among those 4130
system calls, which is really strange because by that time SHTTY is already
fd 10 and only ioctl(SHTTY, TIOCGWINSZ, ...) appears in the zsh source.
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Messages sorted by:
Reverse Date,
Date,
Thread,
Author