Open stumoodie opened 6 years ago
Very interesting! I don't know exactly what happens when you restart an R session. How can even the variables be retained in the global environment if R was restarted? But, still, I think I know what is causing this. The restart causes the underlying C objects to be freed from memory, but the R object that is somehow retained still points into this memory so we have a case of dangling pointers. There are ways to let R know about this memory and hopefully not free it when restarting.
I'll leave it with you. Now I know I'll try and avoid this scenario.
Not sure if it could be of any help in this case but you may be interested in this function:
library.dynam(chname = 'libsoc',
package = 'libsoc',
lib.loc = .libPaths()[1])
I was getting the occasional crash related to the SO object and I think I have identified what is causing it. It seems to be that if you use an object that is in your R environment after you restart the R session in R studio then the session crashes. This occurs on the Mac and Windows. To reproduce initialise an So object from a file.
Test is works:
Restart the R session and try the last command again:
This crashes the R session. I've attached the R studio screenshot.