[Rd] installed.packages Error: subscript out of bounds

Hervé Pagès hpages at fhcrc.org
Fri Nov 12 01:15:51 CET 2010


I can see this has been addressed, thanks!

I found a couple more issues with installed.packages().

The values returned in the Archs column don't seem to really make
sense on Unix:

   > installed.packages()[1:5, c("Version", "Archs", "Built")]
              Version   Archs           Built
   affxparser "1.22.0"  "affxparser.so" "2.12.0"
   affy       "1.28.0"  "affy.so"       "2.12.0"
   affydata   "1.11.10" NA              "2.12.0"
   affyILM    "1.2.0"   "affyILM.so"    "2.12.0"
   affyio     "1.18.0"  "affyio.so"     "2.12.0"

Also the man page for installed.packages would need to be updated to
list this new Archs column (Value section).

Thanks,
H.


On 11/10/2010 01:13 PM, Hervé Pagès wrote:
> Hi,
>
> Today we've seen the following problem with the R-2.12 that we use
> for our Windows builds:
>
>  > installed.packages()
> Error: subscript out of bounds
>
> After some investigation we discovered that the cause of this failure
> was that 1 of the 890 packages currently installed on the machine
> (Windows Server 2003 R2) had its DESCRIPTION file empty:
>
> E:\biocbld\bbs-2.7-bioc\R\library>ls -al DLBCL
> total 1
> drwxr-xr-x+ 1 biocbuild2 root 0 2010-11-08 14:11 .
> drwxr-xr-x+ 1 biocbuild2 root 0 2010-11-10 00:14 ..
> -rwxr-xr-x+ 1 biocbuild2 root 0 2010-11-08 14:11 DESCRIPTION
> -rwxr-xr-x+ 1 biocbuild2 root 357 2010-11-08 14:11 INDEX
> drwxr-xr-x+ 1 biocbuild2 root 0 2010-11-08 14:11 data
> drwxr-xr-x+ 1 biocbuild2 root 0 2010-11-08 14:11 help
> drwxr-xr-x+ 1 biocbuild2 root 0 2010-11-08 14:11 html
>
> Then from R:
>
>  > library(DLBCL)
> Error in library(DLBCL) : there is no package called 'DLBCL'
>  > packageDescription("DLBCL")
> Error in packageDescription("DLBCL") :
> DESCRIPTION file of package 'DLBCL' is corrupt
>  > installed.packages()
> Error: subscript out of bounds
>
> I have no idea how this DESCRIPTION file ended up empty. I've never
> seen this before. Probably a very rare race condition that would be
> very hard to reproduce.
>
> Anyway would it be possible to have installed.packages() give
> a more informative error message when this happens? That would
> make it behave more consistently with packageDescription().
>
> Does something like this sound reasonable?
>
> hpages at latitude:~/svn/R-trunk$ svn diff src/library/utils/R/packages.R
> Index: src/library/utils/R/packages.R
> ===================================================================
> --- src/library/utils/R/packages.R (revision 53546)
> +++ src/library/utils/R/packages.R (working copy)
> @@ -453,6 +453,11 @@
> domain = NA, call. = FALSE)
> next
> }
> + if (NROW(desc) < 1L) {
> + warning(gettextf("file '%s' is corrupt", pkgpath),
> + domain = NA, call. = FALSE)
> + next
> + }
> desc <- desc[1,]
> Rver <- strsplit(strsplit(desc["Built"], ";")[[1L]][1L],
> "[ \t]+")[[1L]][2L]
>
> Thanks,
>
> H.
>


-- 
Hervé Pagès

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M2-B876
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: hpages at fhcrc.org
Phone:  (206) 667-5791
Fax:    (206) 667-1319



More information about the R-devel mailing list