New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
infinite loop of as.vector(x, mode) in default_usage.s4method #475
Comments
Update: I reverted back to R v3.2.3 and do not get the same error. This seems to be an issue with roxygen2 and R v. 3.3.0 |
Thought this was fixed with R v.3.3.1, but it was not. |
I've narrowed the problem down even further. It seems to be due to an environment that gets associated with a method that roxygen2 creates when doing its magic. Something happens when this method definition with its associated environment is in the workspace that causes the error. As a test, I created a signature identical to the one that causes the error and tried the Files are here: error test rdata files.zip ## Testing signature objects
I then confirmed what it was in the method definition by creating one that was close to the one causing the error, then swapping parts from each until the error stopped happening. It turns out that it is the environment defined in the @.Data slot: ## Testing method definition:
|
I wonder if this should be posted on R-devel? I noticed a similar issue with loading of S4 objects; it appears that the class definitions are sometimes not materialized correctly. |
I've been thinking the same thing. I posted it to r-help a few days ago but just got crickets. I was waiting until the end of the week to re-post to r-devel. |
Based on a suggestion by Luke Tierney, I removed packages one-by-one to see if I could make the error go away with that. When I removed Matrix (v1.2-6 on R 3.3.1), I got no error. Matrix automatically reinstalls (same version), but all is good now. |
Reinstalled all package dependencies and roxygen worked. Thanks for the help. |
Hello, I tried reinstalling all package dependencies and roxygen2 multiple times and in different ways and I still got the issue. Any precisions about what you exactly did and how ? |
When I call roxygenise() on my package, I get the following error:
Error: C stack usage 7969260 is too close to the limit
After running traceback(), it appears an infinite loop is happening with
as.vector(x, mode)
. I've used the results of traceback and debug to trace this back to a call toas.character(x$value@defined)
that is being formed in roxygen2:::default_usage.s4method in the s4method function defined there, but actually called in roxygen2:::build_rd when theescape(eval(arg, env))
line is executed.I have attached a zip file with .rdata files containing the result of
tb <- traceback()
and the object that causes the loop (x).
tb.and.x.zip
I can replicate this error by calling:
as.character(x$value@defined)
Here is the result of
str(x)
:List of 3
$ alias : NULL
$ value :Formal class 'MethodDefinition' [package "methods"] with 4 slots
.. ..@ .Data :function (x, ...)
.. ..@ target :Formal class 'signature' [package "methods"] with 3 slots
.. .. .. ..@ .Data : chr "gtypes"
.. .. .. ..@ names : chr "x"
.. .. .. ..@ package: chr "roxygen_devtest"
.. ..@ defined:Formal class 'signature' [package "methods"] with 3 slots
.. .. .. ..@ .Data : chr "gtypes"
.. .. .. ..@ names : chr "x"
.. .. .. ..@ package: chr "roxygen_devtest"
.. ..@ generic: atomic [1:1] nInd
.. .. ..- attr(*, "package")= chr "adegenet"
$ methods: NULL
and here is
str(x$value@defined)
:Formal class 'signature' [package "methods"] with 3 slots
..@ .Data : chr "gtypes"
..@ names : chr "x"
..@ package: chr "roxygen_devtest"
This has only started happening recently (in the past week) and I've been unable to work out what changes I've made in my package could be related to it. It initially occurred with the version of roxygen2 currently on CRAN, and I updated to the version from GitHub and had the same behavior.
I have not been able to work out which file is being parsed to produce this, but if you can tell me what clues I should use to look, I'm happy to do so to see if there is something wonky about the documentation.
My sessionInfo() is as follows:
R version 3.3.0 (2016-05-03)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11.4 (El Capitan)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] swfscMisc_1.1.1 mapdata_2.2-6 maps_3.1.0
[4] reshape2_1.4.1 Rcpp_0.12.5 RColorBrewer_1.1-2
[7] pegas_0.9 Hmisc_3.17-4 Formula_1.2-1
[10] survival_2.39-4 lattice_0.20-33 ggplot2_2.1.0
[13] copula_0.999-14 adegenet_2.0.1 ade4_1.7-4
[16] apex_1.0.2 phangorn_2.0.3 ape_3.4
[19] roxygen2_5.0.1.9000
loaded via a namespace (and not attached):
[1] splines_3.3.0 gtools_3.5.0 shiny_0.13.2
[4] assertthat_0.1 sp_1.2-3 stats4_3.3.0
[7] latticeExtra_0.6-28 LearnBayes_2.15 quadprog_1.5-5
[10] chron_2.3-47 digest_0.6.9 polyclip_1.5-6
[13] colorspace_1.2-6 htmltools_0.3.5 httpuv_1.3.3
[16] Matrix_1.2-6 plyr_1.8.3 gmodels_2.16.2
[19] xtable_1.8-2 mvtnorm_1.0-5 scales_0.4.0
[22] gdata_2.17.0 tensor_1.5 ADGofTest_0.3
[25] mgcv_1.8-12 nnet_7.3-12 magrittr_1.5
[28] mime_0.4 deldir_0.1-12 nlme_3.1-128
[31] MASS_7.3-45 gsl_1.9-10.1 foreign_0.8-66
[34] tools_3.3.0 data.table_1.9.6 pspline_1.0-17
[37] stringr_1.0.0 munsell_0.4.3 cluster_2.0.4
[40] stabledist_0.7-0 grid_3.3.0 goftest_1.0-3
[43] igraph_1.0.1 boot_1.3-18 gtable_0.2.0
[46] abind_1.4-3 DBI_0.4-1 R6_2.1.2
[49] gridExtra_2.2.1 nnls_1.4 dplyr_0.4.3
[52] seqinr_3.1-3 fastmatch_1.0-4 spdep_0.6-4
[55] stringi_1.0-1 spatstat_1.45-2 parallel_3.3.0
[58] rpart_4.1-10 acepack_1.3-3.3 coda_0.18-1
The text was updated successfully, but these errors were encountered: