Skip to content

(old) rgl package crashes MacGUI using R 3.2.3 in El Cap, new compiled one does not.

4 messages · David Winsemius, Duncan Murdoch

#
Earlier today I had been getting an warning message when loading pkg:rgl (and then failing to get any plotting to an X11 window),  so I decided to re-install the binary 0.95.1201 from a CRAN mirror:

XQuartz 2.7.8 has been installed and reinstalled multiple times including just a few minutes before this. Also have current XCode and CLT.
R version 3.2.3 (2015-12-10)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11.2 (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] grDevices utils     datasets  stats     graphics  grid      methods  
[8] base     

other attached packages:
[1] rgl_0.95.1201   rms_4.4-0       SparseM_1.7     Hmisc_3.17-0   
[5] ggplot2_2.0.0   Formula_1.2-1   survival_2.38-3 sos_1.3-8      
[9] brew_1.0-6      lattice_0.20-33

loaded via a namespace (and not attached):
[1] Rcpp_0.12.2         cluster_2.0.3       splines_3.2.3      
[4] munsell_0.4.2       colorspace_1.2-6    multcomp_1.4-1     
[7] plyr_1.8.3          tools_3.2.3         nnet_7.3-11        
[10] gtable_0.1.2        nlme_3.1-122        quantreg_5.19      
[13] TH.data_1.0-6       latticeExtra_0.6-26 MatrixModels_0.4-1 
[16] polspline_1.1.12    Matrix_1.2-3        gridExtra_2.0.0    
[19] RColorBrewer_1.1-2  codetools_0.2-14    acepack_1.3-3.3    
[22] rpart_4.1-10        sandwich_2.3-4      scales_0.3.0.9000  
[25] mvtnorm_1.0-3       foreign_0.8-66      zoo_1.7-12         
[28] proto_0.3-10       


This is( ... er was) the crash log when done from the macGUI. When running from a Terminal window I get no error and the XQuartz/X11 window displays everything without problem. 

I also tried renaming the .Rprofile file that loads all that other stuff to hide it from the GUI-launch process, and just loading with rgl and the base packages and it still crashes (i.e. the MacGUI window disappears and a crash report appears.) 

Last minute update: I then installed the source version: rgl_0.95.1435.tar.gz and it loaded without complaint and executes the code in either session type:

In a Terminal window session with nothing in the .Rprofile:

install.packages("/Users/davidwinsemius/Downloads/rgl_0.95.1435.tar.gz", repo=NULL, dependencies=TRUE, type="source") 


Then in MacGUI:

library(rgl)
spheres3d(0,0,0,front="lines",back="lines")
set.seed(101)
n <- 50
theta <- runif(n,0,2*pi)
u <- runif(n,-1,1)
x <- sqrt(1-u^2)*cos(theta)
y <- sqrt(1-u^2)*sin(theta)
z <- u
points3d(x,y,z,col="red")

I see that the compile process fails with a message:

----------------------
	? checking files in ?vignettes? ... OK
	? checking examples ... ERROR
Running examples in ?rgl-Ex.R? failed
The error most likely occurred in:
srfc3d> #
srfc3d> # volcano example taken from "persp"
srfc3d> #
srfc3d> 
srfc3d> data(volcano)

srfc3d> z <- 2 * volcano # Exaggerate the relief
-------------------

I tried running the contents of test/demo.R and got 21 different rgl windows, but no error. I was eventually able to find the offending code of : 'rgl-Ex.R' in the rgl.pixels.Rd file and copied and that code in a  GUI session with no errors reported.

So I guess the question is ... why is the build process for the Mavericks/Yosemite/El Capitan machines still failing to produce a current (working) version of rgl?

--- 

snipped crash logs.
#
On 30/12/2015 9:40 PM, David Winsemius wrote:
[lots deleted]
I think it does probably does produce a working version, but it fails 
the tests on that particular machine.

I believe the problem is that the CRAN test machine uses an unusual X 
server.  I've asked for details on a couple of occasions so I could 
reproduce the error, but received no response.  I don't know if the 
server is buggy or rgl just fails to do some checks that are unnecessary 
on other servers.

The latest error is occurring in rgl.pixels, and the underlying C++ code 
there is a little sloppy with type conversions (e.g. it assumes GL_FLOAT 
is float, which is not necessarily true), and is probably also sloppy 
with run-time checks.  I don't think the type sloppiness could be a 
cause of the error (I think it would fail for all servers if so), and I 
can't spot the run-time sloppiness.

Duncan Murdoch
#
Is there any way to put a ##Not run ..... ### "bracket" around that code?
David Winsemius
Alameda, CA, USA
#
On 31/12/2015 1:06 PM, David Winsemius wrote:
Sure, I could mark those examples with \donttest{} or \dontrun{}, but 
that only works around the bug in the case that it's a bug at CRAN, and 
in that case, it would be better for them to update their X server.  I'd 
say it's at least as likely to be a bug in the package, and removing the 
tests that are failing would then be a really bad idea.

Anyone who is willing to live with the error can build rgl themselves.

Duncan Murdoch