From murdoch@dunc@n @end|ng |rom gm@||@com  Mon Feb 18 22:28:13 2019
From: murdoch@dunc@n @end|ng |rom gm@||@com (Duncan Murdoch)
Date: Mon, 18 Feb 2019 16:28:13 -0500
Subject: [Rd] Error in rbind(info, getNamespaceInfo(env, "S3methods"))
In-Reply-To: <CAOuOy3dRhE47j_W71qDeCc+sKruj2DC0-2AGD1Wyd_t0Bsr8Dg@mail.gmail.com>
References: <CAOuOy3dRhE47j_W71qDeCc+sKruj2DC0-2AGD1Wyd_t0Bsr8Dg@mail.gmail.com>
Message-ID: <4bc49f19-5fd4-d515-03eb-28954ac5ee55@gmail.com>

On 18/02/2019 4:08 p.m., Matt Dowle wrote:
> Dear all,
> 
> I'm experiencing an unusual installation error for one package. Could
> anyone suggest how I can best investigate this from here please?  I'm sorry
> this isn't very much to go on. Hopefully someone can point me in the right
> direction.

When packages are installed, a hidden environment is created called 
".__NAMESPACE__.".  It contains a number of objects; it looks as though 
one of yours called "S3methods" is corrupted.  I can't guess whether it 
is one coming from staRdom or one already in your library, but it 
appears yours doesn't have the usual number of columns (which I think is 3).

So you could get a list of all packages in your library, and run

sapply(allpackages, function(x) 
ncol(asNamespace(x)$.__NAMESPACE__.$S3methods))

to see which of them don't return 3 as the number of columns.  (This 
will load all of them, so might need to be broken up into batches.)

Duncan Murdoch

> 
> The problem seems to be my library.  It is large (3,418 packages) and I'd
> like to avoid rebuilding it, if possible.  All packages are up to date
> according to update.packages().
> 
> The error is :
> ** byte-compile and prepare package for lazy loading
> Error in rbind(info, getNamespaceInfo(env, "S3methods")) :
>    number of columns of matrices must match (see arg 2)
> ERROR: lazy loading failed for package ?staRdom?
> * removing ?/home/mdowle/build/revdeplib/staRdom?
> 
> This package (staRdom) has had a recent update but CRAN checks page is
> showing OK, mostly:
> https://cran.r-project.org/web/checks/check_results_staRdom.html.   The two
> errors there don't seem to be related.
> 
> The package installs no problem when I don't include my revdeplib.  But
> when I do include my revdeplib it fails with the error above.
> 
> I can reproduce as follows :
> 
> $ export R_LIBS=~/build/revdeplib/
> $ R
>> .libPaths()
> [1] "/home/mdowle/build/revdeplib" "/usr/lib/R/library"
>> install.packages("staRdom")
> Installing package into ?/home/mdowle/build/revdeplib?
> (as ?lib? is unspecified)
> trying URL 'http://cloud.r-project.org/src/contrib/staRdom_1.0.12.tar.gz'
> Content type 'application/x-gzip' length 2669832 bytes (2.5 MB)
> ==================================================
> downloaded 2.5 MB
> * installing *source* package ?staRdom? ...
> ** package ?staRdom? successfully unpacked and MD5 sums checked
> ** R
> ** data
> *** moving datasets to lazyload DB
> ** inst
> ** byte-compile and prepare package for lazy loading
> Error in rbind(info, getNamespaceInfo(env, "S3methods")) :
>    number of columns of matrices must match (see arg 2)
> ERROR: lazy loading failed for package ?staRdom?
> * removing ?/home/mdowle/build/revdeplib/staRdom?
> The downloaded source packages are in
>          ?/tmp/RtmprvTDCg/downloaded_packages?
> Warning message:
> In install.packages("staRdom") :
>    installation of package ?staRdom? had non-zero exit status
>>
>> sessionInfo()
> R version 3.5.2 (2018-12-20)
> Platform: x86_64-pc-linux-gnu (64-bit)
> Running under: Ubuntu 18.04.2 LTS
> 
> Matrix products: default
> BLAS: /usr/lib/x86_64-linux-gnu/openblas/libblas.so.3
> LAPACK: /usr/lib/x86_64-linux-gnu/libopenblasp-r0.2.20.so
> 
> locale:
>   [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
>   LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
>   LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
> LC_PAPER=en_US.UTF-8
>   [8] LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C
>             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
> 
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
> 
> loaded via a namespace (and not attached):
> [1] compiler_3.5.2 tools_3.5.2
>>
> 
> 
> If I don't include my revdeplib library,  it works fine :
> 
> $ R
>> .libPaths()
> [1] "/usr/local/lib/R/site-library" "/usr/lib/R/site-library"
>   "/usr/lib/R/library"
>> install.packages("staRdom")
> Installing package into ?/usr/local/lib/R/site-library?
> (as ?lib? is unspecified)
> trying URL 'http://cloud.r-project.org/src/contrib/staRdom_1.0.12.tar.gz'
> Content type 'application/x-gzip' length 2669832 bytes (2.5 MB)
> ==================================================
> downloaded 2.5 MB
> 
> * installing *source* package ?staRdom? ...
> ** package ?staRdom? successfully unpacked and MD5 sums checked
> ** R
> ** data
> *** moving datasets to lazyload DB
> ** inst
> ** byte-compile and prepare package for lazy loading
> ** help
> *** installing help indices
> ** building package indices
> ** installing vignettes
> ** testing if installed package can be loaded
> * DONE (staRdom)
> 
> The downloaded source packages are in
>          ?/tmp/RtmpmSiZLa/downloaded_packages?
>>
>> sessionInfo()
> R version 3.5.2 (2018-12-20)
> Platform: x86_64-pc-linux-gnu (64-bit)
> Running under: Ubuntu 18.04.2 LTS
> 
> Matrix products: default
> BLAS: /usr/lib/x86_64-linux-gnu/openblas/libblas.so.3
> LAPACK: /usr/lib/x86_64-linux-gnu/libopenblasp-r0.2.20.so
> 
> locale:
>   [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
>   LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
>   LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
> LC_PAPER=en_US.UTF-8
>   [8] LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C
>             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
> 
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
> 
> loaded via a namespace (and not attached):
> [1] compiler_3.5.2 tools_3.5.2
>>
> 
> I'm not sure how to debug this because both install.packages() and `R CMD
> check` start a new instance of R. How do a get debugger() prompt at the
> point of the error? All I can think of is inserting a browser() in my own
> compile of R-devel. But that seems a big step. I thought I'd post here
> first to see if anyone had any suggestions in how to proceed.
> 
> Thanks in advance,
> Matt
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



[Rd] Error in rbind(info, getNamespaceInfo(env, "S3methods"))
Duncan Murdoch