Skip to content

rgl crashes R.app in El Capitan

11 messages · Duncan Murdoch, David Winsemius, John Fox +1 more

#
Dear r-sig-mac list members,

I can reliably crash R.app in R 3.2.2 under El Capitan with

  library(rgl)
  demo("rgl")  # a few returns

My session info:
R version 3.2.2 (2015-08-14)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11 (El Capitan)

locale:
[1] en_CA.UTF-8/en_CA.UTF-8/en_CA.UTF-8/C/en_CA.UTF-8/en_CA.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] rgl_0.95.1367

I see this problem only in R.app, not when R is run in a terminal or in RStudio.

This problem was original brought to my attention by Jose Conde (to whom I'm cc'ing this message), who encountered the problem using the scatter3d() function in the car package via the Rcmdr, but the problem isn't unique to either scatter3d() or the Rcmdr. In the case of scatter3d() the command

    scatter3d(prestige ~ income + education, data=Prestige)

which draws a regression surface, reliably crashes R.app, but

    scatter3d(prestige ~ income + education, data=Prestige, surface=FALSE)

which plots only points (as spheres) doesn't.

I hope that this provides enough clues to diagnose the problem.

John

-----------------------------
John Fox, Professor
McMaster University
Hamilton, Ontario
Canada L8S 4M4
web: socserv.mcmaster.ca/jfox
#
On 13/10/2015 3:03 PM, Fox, John wrote:
I don't have El Capitan, I'm still running under OS X 10.9.5
(Mavericks), and it doesn't crash.

Since you're using the latest rgl, you must have built it yourself --
CRAN doesn't distribute binaries for it (at least for Mavericks).  Did
you get any errors or warnings during compilation?

Duncan Murdoch
#
Dear Duncan,
That was my experience as well -- I didn't experience this problem under either Mavericks or Yosemite. BTW, I reinstalled R 3.2.2 and XQuartz after upgrading to El Capitan. I usually upgrade fairly early to see whether there are any problems.
Right again. I ran update.packages() to make sure that the error wasn't fixed and compiled packages that didn't yet have Mac binaries. AFAICS, there were no errors in compiling the rgl package.

BTW, my apologies for posting my message twice -- my mailer complained about the address in the first message and I thought it wasn't sent.

Thanks for looking into this,
 John
1 day later
#
One of my students has El Capitan, so I got to see this.  It appears
it's the old aglrgl.so problem.  I should just give up on native
support, since I don't really know how to debug it.

The "simple" fix is to delete the aglrgl.so file.  This means R.app will
use the X11 driver, the same as the terminal version or RStudio would
use.  Some users will have problems with this:

 - It means they need Xquartz installed.
 - You need admin privileges to delete aglrgl.so, and you need to know
how to find it.  To find it, in R you can run

system.file("libs/aglrgl.so", package="rgl")

in R; I see

"/Library/Frameworks/R.framework/Versions/3.2/Resources/library/rgl/libs/aglrgl.so"

but others may see it elsewhere.  I don't know if there is a way to
delete it from R; I'd expect

unlink(system.file("libs/aglrgl.so", package="rgl"))

to fail because of permission problems, but I'm not sure of that.

I'm not going to attempt to describe Xquartz installation, but Google
should be able to help.

Duncan Murdoch
On 13/10/2015 4:05 PM, Fox, John wrote:
#
Hi Duncan,

Thanks for looking into this. Please see below:
Actually, that works for me and fixes the problem.
Jose encountered this problem using the Rcmdr package, which already requires XQuartz due to Tcl/Tk, but more generally the car package doesn't need XQuartz. XQuartz installation is simple in any event.

One thing is unclear to me, however. Will you simply remove aglrgl.so from the next version of rgl? If so, you should be able to test for the presence of XQuartz and print a warning message in its absence.

Best,
 John
#
On Oct 15, 2015, at 9:28 AM, Duncan Murdoch wrote:

            
Every R-Mac-suer _should_ have that installed.
Maybe not.
No failure. Runs without complaint and succeeds at least on an earlier version of OSX, as well as on my Yosemite-laptop (I then reinstalled the package to get it back.) I suppose security could have become more tight in El Cap.
Xquartz installation is trivial for most Mac-users. Just download the installer package and double-click.

Thanks for your efforts, Duncan.
#
On 15/10/2015 2:21 PM, Fox, John wrote:
Yes, I'll be dropping aglrgl.so.  rgl can run without any display (using 
options(rgl.useNULL = TRUE) and writing WebGL or some other kinds of 
output to a file), so I'm not sure whether a warning will be needed; 
I'll have to think about use cases.

Duncan Murdoch
#
Hi Duncan,

Thanks again for taking care of this.

John
3 days later
#
Hello all.

For your information, I just updated Xquartz to version 2.7.8, and the problem persists.

Thanks.

Jos?

Jos? G. Conde, MD, MPH
Catedr?tico, Escuela de Medicina
Director, CentIT2
Recinto de Ciencias M?dicas, UPR

Tel  (787) 763-9401  Fax (787) 758-5206

Correo electr?nico: jose.conde1 at upr.edu

URL: http://rcmi.rcm.upr.edu
#
Dear Jos?
I think that you may have misunderstood the source of the problem, which isn't in XQuartz but in the rgl package when R.app is run under El Capitan. Duncan will remove aglrgl.so from the rgl package to fix the problem, and you may do so in the interim, as he explained.

Best,
 John
#
OK, now I got it.

Thanks all for your patience.

Jos?

Jos? G. Conde
Professor, School of Medicine
Director, CentIT2
UPR Medical Sciences Campus 

Tel  (787) 763-9401 Fax (787) 758-5206

Email: jose.conde1 at upr.edu

URL: http://rcmi.rcm.upr.edu