dmurdoch / rgl

rgl is a 3D visualization system based on OpenGL. It provides a medium to high level interface for use in R, currently modelled on classic R graphics, with extensions to allow for interaction.
https://dmurdoch.github.io/rgl/
GNU General Public License v2.0
86 stars 21 forks source link

Loading library rgl leaves an infinite process under Windows Server 2016 #108

Open ribeiroi opened 3 years ago

ribeiroi commented 3 years ago

On Windows Server 2016. This is not happening on Windows 10. Already tried both CRAN and latest version from GitHub. Used R versions 4.0.4 and 4.1.0. This is happening both in R and RScript (RScript is more visible because it prevents RScript from finishing).

Test 1: Open R, type library(rgl), close R. Open Task Manager, there will be an open R instance.

Test 2: create a test.R with just library(rgl) inside; open Command Prompt, call RScript test.R; it will never leave RScript, it will hang there indefinitely.

There are no error messages, and all code, including those after library(rgl) are executed.

Seems to be a memory leak or something that rgl library is not closing properly, leaving open even after closing R.

dmurdoch commented 3 years ago

I don't have access to Windows Server 2016, just Windows 10, where I also don't see this. I don't know what debugging tools are available to you (in fact, I don't really know modern Windows debugging at all), but if you could force a stack trace of the leftover process, it might be informative.

adilapapaya commented 3 years ago

Apologies if this is the wrong place - it seemed related to this issue so I posted it here but can open a new issue if you'd prefer.

I'm seeing the same thing on R 3.6.3, Mac OS Catalina (10.15.7): library(rgl) causes the R session to hang / get stuck indefinitely at that step, and I have to force quit that session.

This happened to me after an upgrade to the latest version of XQuartz (to 2.8.1). Reverting back to XQuartz 2.8.0 seems to have fixed the issue.

@dmurdoch are you on an older version of XQuartz? @ribeiroi, could this be related to your issue?

Also, thank you for this library!!! :)

dmurdoch commented 3 years ago

I believe there may be problems if your XQuartz version doesn't match the version of XQuartz used to build the rgl binary you are trying to load. One way to fix this is to build rgl yourself, which is what I do. I have nothing to do with the binary builds on CRAN, and I don't know what version of XQuartz they use.