-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
Errors when loading RCDT provided by rPackages.RCDT #344213
Comments
I can indeed reproduce. Also I tried with RStudio using
and trying to load RCDT in RStudio makes it crash. But I don't get anything about the author names and such. |
Can't reproduce on x86_64-linux. I could run the first example from the vignette just fine. Could it be an mac issue?
|
I'm on opensuse and so is OP, but you're on NixOs, right? could this be related to some graphics issue? |
That prompt is the standard R signal handler that gets triggered on a SIGSEGV, e.g.,:
No idea why it's not showing the full message though. Likely the package has memory errors which are triggering a segfault on load. I also couldn't reproduce the error, same |
Posting your |
So when running
and
When calling session info in the pure shell I get the following:
Which seems the same as calling it in the impure shell, there I however get some warnings during startup of the R-session, which should also be visible in the screenshots
|
The X authorisation issues is a bit strange, |
I think that the issue is actually
then loading
I even tried with another package that has
|
Is it something in https://github.com/dmurdoch/rgl/blob/fbedc326e291c3ec28a9ccac7d030f04b05edfa3/R/zzz.R#L16 |
I wouldn't know because I can't reproduce the rgl segfault either. BTW, the X connection in --pure shell can be restored if you keep the display and xauthority variables. Like so: (or rWrapper) |
I tried the nix-shell arguments proposed and loading rgl inside radian. This gave more traceback information than in R session, but segfault remains.
|
Are theese related? |
Inspired by nix-community/nixGL#145 (comment) i created a nix shell using the following lines in which I loaded rgl without error.
I similarly tried creating a shell with RCDT:
This allowed me to run the first example of the vignette without problem. |
Very cool, I guess this is what we should do in situations where Nix gets used outside of NixOS! I think that we could document this in https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/r.section.md, what do you think @jbedo ? |
Not really an R problem, would be good to document elsewhere and cross reference in R. Also, lack of GL shouldn't cause a segfault so might be worth opening an issue upstream with RGL. |
rix_tests/test_RCDT on main [!?] took 1m 3.9s
⇣4% ➜ nix-shell --pure -p R rPackages.callr rPackages.RCDT
[nix-shell:~/rix_tests/test_RCDT]$ R
R version 4.3.3 (2024-02-29) -- "Angel Food Cake"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin23.4.0 (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
During startup - Warning messages:
1: Setting LC_CTYPE failed, using "C"
2: Setting LC_COLLATE failed, using "C"
3: Setting LC_TIME failed, using "C"
4: Setting LC_MESSAGES failed, using "C"
5: Setting LC_MONETARY failed, using "C"
> library(RCDT)
> # vertices
R <- sqrt((5-sqrt(5))/10) # outer radius
r <- sqrt((25-11*sqrt(5))/10) # circumradius of the inner pentagon
k <- pi/180 # factor to convert degrees to radians
X <- R * vapply(0L:4L, function(i) cos(k * (90+72*i)), numeric(1L))
Y <- R * vapply(0L:4L, function(i) sin(k * (90+72*i)), numeric(1L))
x <- r * vapply(0L:4L, function(i) cos(k * (126+72*i)), numeric(1L))
y <- r * vapply(0L:4L, function(i) sin(k * (126+72*i)), numeric(1L))
vertices <- rbind(
c(X[1L], Y[1L]),
c(x[1L], y[1L]),
c(X[2L], Y[2L]),
c(x[2L], y[2L]),
c(X[3L], Y[3L]),
c(x[3L], y[3L]),
c(X[4L], Y[4L]),
c(x[4L], y[4L]),
c(X[5L], Y[5L]),
c(x[5L], y[5L])
)
# constraint edges: indices
edges <- cbind(1L:10L, c(2L:10L, 1L))
# constrained Delaunay triangulation
del <- delaunay(vertices, edges)
# plot
opar <- par(mar = c(0, 0, 0, 0))
plotDelaunay(
del, type = "n", asp = 1, fillcolor = "distinct", lwd_borders = 3,
xlab = NA, ylab = NA, axes = FALSE
)
> sessionInfo()
R version 4.3.3 (2024-02-29)
Platform: aarch64-apple-darwin23.4.0 (64-bit)
Running under: macOS Sonoma 14.2.1
Matrix products: default
BLAS: /nix/store/4kqdh4mk7fjnly8daba1cjycj815055m-blas-3/lib/libblas.dylib
LAPACK: /nix/store/x7im9yssybhdqwif49y96pwb57vhrds4-openblas-0.3.26/lib/libopenblasp-r0.3.26.dylib; LAPACK version 3.12.0
locale:
[1] C
time zone: Europe/Zurich
tzcode source: internal
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] RCDT_1.3.0
loaded via a namespace (and not attached):
[1] digest_0.6.35 rgl_1.3.1 R6_2.5.1
[4] base64enc_0.1-3 fastmap_1.1.1 xfun_0.42
[7] gtools_3.9.5 magrittr_2.0.3 KernSmooth_2.23-22
[10] knitr_1.45 htmltools_0.5.7 cli_3.6.2
[13] bitops_1.0-7 scatterplot3d_0.3-44 caTools_1.18.2
[16] Rvcg_0.22.2 colorsGen_1.0.0 Polychrome_1.5.1
[19] compiler_4.3.3 tools_4.3.3 Rcpp_1.0.12
[22] gplots_3.1.3.1 colorspace_2.1-0 jsonlite_1.8.8
[25] rlang_1.1.3 htmlwidgets_1.6.4
> .libPaths()
[1] "/nix/store/i2lrv63rk1vnbzv1wdx96z3qh3sky2m9-r-callr-3.7.5/library"
[2] "/nix/store/9h3wcnfvpllzfzpz2a3dxck1pc77llsj-r-processx-3.8.4/library"
[3] "/nix/store/5bslj3jdv339s8fs0xiq5c6b2mqnyafg-r-ps-1.7.6/library"
[4] "/nix/store/ncxfsalamqngfmlm6hrfq6d0sz3qwpfh-r-R6-2.5.1/library"
[5] "/nix/store/ymajv0n37q1i9wnzwq4vxj6y0ib3plpi-r-RCDT-1.3.0/library"
[6] "/nix/store/724kqs057i1qkk6kff70f77qm56d4yzg-r-BH-1.84.0-0/library"
[7] "/nix/store/ngagk6z8adkn4kya0nbjcffnkcnzkabd-r-colorsGen-1.0.0/library"
[8] "/nix/store/7d3042dp9qf19arb2al89dh28jwhc8s6-r-colorspace-2.1-0/library"
[9] "/nix/store/pdks4yipwimcdajanjyp2r3a9sf03frj-r-gplots-3.1.3.1/library"
[10] "/nix/store/xz5hck83vjlrg0dl31y9pjxrnnwhi59q-r-caTools-1.18.2/library"
[11] "/nix/store/3nd3fy6dihivqagf60saqjc03fav9n96-r-bitops-1.0-7/library"
[12] "/nix/store/58bib2y8mm7ybfm0z5jpvf04m8mblv3q-r-gtools-3.9.5/library"
[13] "/nix/store/2840qlij0qgfvzqq74v3aah52nc8pab9-r-KernSmooth-2.23-22/library"
[14] "/nix/store/31ml30rgvq7z8zy3bv705b7sw9dm98lx-r-Polychrome-1.5.1/library"
[15] "/nix/store/24hri2m92xqrha8nwd4xb95jyqzly7r0-r-scatterplot3d-0.3-44/library"
[16] "/nix/store/dc61882nv54b63g7am60xg76amcyh8q0-r-Rcpp-1.0.12/library"
[17] "/nix/store/942q1h7rgi7wdl9g9nl9icrsh1xlgmk4-r-RcppArmadillo-0.12.8.1.0/library"
[18] "/nix/store/97q5fm6lwn0hzxxfxdl1pw8ks2amch5i-r-rgl-1.3.1/library"
[19] "/nix/store/j6vyl4jphvixys5x0ad52njqk4s93wcw-r-base64enc-0.1-3/library"
[20] "/nix/store/7m0bajvqhng7dsg5lr1yzkmff9wg8gf9-r-htmltools-0.5.7/library"
[21] "/nix/store/cgd4aqg763lp0vvzh9b24ci7dkkzkw6r-r-digest-0.6.35/library"
[22] "/nix/store/49rqk71cds9b0fy6qjcpivv0mqivrbf6-r-ellipsis-0.3.2/library"
[23] "/nix/store/xz0nk9x7gmgc88xw6wmq6lkppdvxc60j-r-rlang-1.1.3/library"
[24] "/nix/store/yriy7b600sqac2crkq6mpk1i41hl9k8y-r-fastmap-1.1.1/library"
[25] "/nix/store/69i6h6vnkbdnkfpr96pi9jzrp96g2fnm-r-htmlwidgets-1.6.4/library"
[26] "/nix/store/x5whgkl6573w39j9zhraq1090dbk5ag9-r-jsonlite-1.8.8/library"
[27] "/nix/store/zka8py06kx4hvmjl5cw17bdfpzqj3k2n-r-knitr-1.45/library"
[28] "/nix/store/n2d764m3yvl8qrq7p0ymbi0d09ahvpkw-r-evaluate-0.23/library"
[29] "/nix/store/705g6a21mwg4hbcdz89n34xb1jw93lir-r-highr-0.10/library"
[30] "/nix/store/0d5ks6cls6ja8izqaydy96pfsnnw6hmz-r-xfun-0.42/library"
[31] "/nix/store/mmv11vq65x9d6p6zfwfv78q4x18jy50s-r-yaml-2.3.8/library"
[32] "/nix/store/p6g3igq0sym2ndkaz64fqxmxmk19kqs8-r-rmarkdown-2.26/library"
[33] "/nix/store/y6yk3q9fydvzih1d51b8wzqr85a9hgnb-r-bslib-0.6.2/library"
[34] "/nix/store/263q8ny5sf6y0jln1j42vawrni5yihiw-r-cachem-1.0.8/library"
[35] "/nix/store/8n0abpp67f8ygxfh5xncagagimypgvm5-r-jquerylib-0.1.4/library"
[36] "/nix/store/g9dbrhl1q2hv40smh9gq242qfd5l5lz6-r-lifecycle-1.0.4/library"
[37] "/nix/store/0ckvnrldgdxk2ngx7ppljs5gp7i4ybai-r-cli-3.6.2/library"
[38] "/nix/store/d03rnf4js0ch0vn24cbj06w2yyni8dbw-r-glue-1.7.0/library"
[39] "/nix/store/x3lh2w2r59n5n471bk07x5jd5pxlxfsw-r-memoise-2.0.1/library"
[40] "/nix/store/9wicxxwxl5cy4vq6xavidx5hg33jyfgc-r-mime-0.12/library"
[41] "/nix/store/762b9hgq2bgvzf7ym1m2i3gzf9kbjsb2-r-sass-0.4.9/library"
[42] "/nix/store/l1aa6fs8kz7q81x8vjav4zd3n2awvnyn-r-fs-1.6.3/library"
[43] "/nix/store/j4sgi9whay0ldghkrgascb7i5cxfiy18-r-rappdirs-0.3.3/library"
[44] "/nix/store/qlrw9n9rf43mnvldvag5w5y7fzsbwcv9-r-fontawesome-0.5.2/library"
[45] "/nix/store/ckvriqfsqk82xf8j3k1036x4a7534pj9-r-tinytex-0.50/library"
[46] "/nix/store/wqxsnk1qff2dc23q3lijiz4syzysxcyw-r-magrittr-2.0.3/library"
[47] "/nix/store/8jwj3ambqs3j19l0jnw9rwabwkyawibm-r-Rvcg-0.22.2/library"
[48] "/nix/store/pha2c9f9vd2lfka2v5aq3lp46pcbarik-r-RcppEigen-0.3.4.0.0/library"
[49] "/nix/store/5ylipgzwqx1xs6cadrv5wxrjsial7wlr-apple-framework-CoreFoundation-11.0.0/Library"
[50] "/nix/store/mcl9p6myk7dszrij2c1y87qigv5mh17y-R-4.3.3/lib/R/library" @HVinther what is your libpath? i have had many segmentation faults before on macOS because of linked system libs and permission issues, unfortunately in nix the default is that |
If you don't have it, run |
In the project where I discovered the problem I did indeed generate the default.nix with rix. I do also have a non empty .Rprofile file generated by rix. When calling .libPaths() in a R session in a nix-shell created from that expression I only get paths starting with /nix/store/. In the temporary shell example used to recreate the problem found in my project shell I do get an R folder inside my HOME directory when calling .libPaths(). However this folder is empty. |
I've now also removed R and all R-packages from my host system. Now when I call .libPaths() from a nix-shell R session only nix/store paths are returned wether from a rix written expression or from a temporary shell. In both cases the graphics issue persists. Ie. either rgl fails to connect to an X11 display if the shell is pure and the XAUTHORITY is unkeept or there is a seqfault on load. |
I guess nixgl is the solution then, on non-NixOS systems. @HVinther can we close this issue? |
Yes, thank you all for your help and time. |
Describe the bug
The R package RCDT does not load properly. In a terminal R session, the package unexpectedly provides a prompt, when attempting to load the package with
library("RCDT")
. Entering a string just gives a new prompt. Entering an integer gives a segmentation fault.When attempting the same inside the console of the ide positron, the package does load and is useable, but it gives a warning about the author string.
When trying to load the package using callr (used in pipeline tools such as targets), the call errors out and also gives the warning message described above.
The three scenarios can be seen in the screenshots.
Steps To Reproduce
Steps to reproduce the behavior:
nix-shell -p R rPackages.callr rPackages.RCDT
R
library("RCDT")
Alternatively
nix-shell -p R rPackages.callr rPackages.RCDT
library("RCDT")
in the consoleAlternatively
nix-shell -p R rPackages.callr rPackages.RCDT
callr::r(\(x){version},package = "RCDT")
in the consoleExpected behavior
Package loads with no errors or warnings. Expected behaviour can be seen by installing the docker image rocker/r2u and then installing RCDT and callr inside the image using
install.packages
.Screenshots
In terminal session:
In positron ide:
Using with callr in positron ide:
Additional context
Issue originally discovered when using the
{rix}
for R and thus reported in (ropensci/rix#329 (comment)) but found to persist using just nix.Notify maintainers
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.Add a 👍 reaction to issues you find important.
The text was updated successfully, but these errors were encountered: