[Rd] lstat and NFS server not responding

Prof Brian Ripley ripley@stats.ox.ac.uk
Tue, 3 Apr 2001 17:37:37 +0100 (BST)

On Tue, 3 Apr 2001, Friedrich Leisch wrote:

> >>>>> On Tue, 3 Apr 2001 07:06:47 +0100 (BST),
> >>>>> Prof Brian D Ripley (PBDR) wrote:
>   > On Mon, 2 Apr 2001, Paul Gilbert wrote:
>   >> In a somewhat unusual circumstance I have been having trouble when
>   >> making R from source and with "R CMD build dse"
>   >> forcing the machine to look for an NFS server which was not available,
>   >> and then stalling. Our system administrator traced this back to the fact
>   >> that these go through all the directories back to "/" , doing an lstat
>   >> on everything. He suggests that that seems odd, but it doesn't take long
>   >> normally.  The problem was apparently caused by the fact that something
>   >> (possible a cdrom) on /mnt had not been unmounted properly.
>   >>
>   >> We have fixed the problem but since it was rather difficult to track
>   >> down I thought  I would point it out in case others experience a similar
>   >> difficulty. Also, is there a good explanation for doing an lstat on
>   >> everything up to /?
>   > Do you know what was doing it?  Since R CMD build is basically a Perl
>   > program, I can only guess that Perl was doing this, and it looks like a
>   > Perl quirk/bug that perhaps you need to track down and report (if your Perl
>   > version is current).  One thing I did notice is that the R scripts use
>   > Cwd::getcwd in Perl when the manual page recommends Cwd::cwd, and reading
>   > the code suggests Cwd::getcwd is the culprit.  (Any explanation,
>   > Fritz/Kurt?)
> No particular reason ... the only one is that I've always used getcwd
> (and didn't even know that cwd exists). My manpage says ``It is
> recommended that cwd (or another *cwd() function) is used in all code
> ...'' which I wouldn't take as a particulartly strong recommendation
> for cvw, but I'd be fine.

The code says (5.6.0)

# The 'natural and safe form' for UNIX (pwd may be setuid root)

sub _backtick_pwd {
    my $cwd;
    chop($cwd = `pwd`);

# Since some ports may predefine cwd internally (e.g., NT)
# we take care not to override an existing definition for cwd().

*cwd = \&_backtick_pwd unless defined &cwd;

which looks like a recommendation for cwd to me.

> Paul, could you try if that fixes your problem (i.e., replace all
> occurrences of ``getcwd'' by ``Cwd::cwd'' in the build script and run
> it again)?

(just cwd seems to work.)

Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch