On Mon, 11 Dec 2000, Richard Dice wrote:

> > It shouldn't be gigabytes -- you want to strace only special events like
> > open and read, and you want to attach to the process only before running
> > the script (run under -X) -- so you should have just a few lines!!!
> > 
> >  % strace -p PID -e trace=open,read
> 
> I was talking about ltrace, not strace, when I said it would take gigs.
> And even then, I was wrong -- it was only about 50mb.  (And that didn't
> take into account specifiying which events to trace on.)

Hmm, its manpage says : Its use is very similar to strace(1).... but it's
irrelevant to the problem..
 
The only relevant bits are those where syscalls interact with the dir fd
more or less, so that's what's left:

> open("/web/ShadNet/sys/cvs/webdocs", O_RDONLY|O_NONBLOCK|0x10000) = 4
> fstat(4, {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
> fcntl(4, F_SETFD, FD_CLOEXEC)           = 0
> brk(0x81ca000)                          = 0x81ca000
[snip interaction with STDOUT(fd=1)]
> getdents(4, /* 43 entries */, 3391)     = 936

fd==4, and we have 43 files.... and it's fine.

now the registry script which is broken:

> open("/web/ShadNet/sys/cvs/webdocs", O_RDONLY|O_NONBLOCK|0x10000) = 5
> fstat(5, {st_mode=S_IFDIR|0755, st_size=1024, ...}) = 0
> fcntl(5, F_SETFD, FD_CLOEXEC)           = 0
> brk(0x858d000)                          = 0x858d000
> alarm(300)                              = 0
> alarm(0)                                = 300
> getdents(5, /* 43 entries */, 2980)     = 936

all fine till now the same 43 entries are read, and the alarm(0)  calls,
which appear on my system as well.

> alarm(300)                              = 0
> alarm(0)                                = 300

apparently 43 times...

What happens if you run the same code on the server with no preloaded
modules and configurations? Only the registry alias?

Obviously using IO::Dir won't help you to debug this problem but will make
it even more complicated.

Another thing to try: 'su - httpd' or whatever user you are running the
server under and now run the script from the command line. Since you
probably don't have the passwd for httpd do 'su' to become root first.

_____________________________________________________________________
Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
http://stason.org/       mod_perl Guide  http://perl.apache.org/guide 
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://logilune.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/  


Reply via email to