[R] dyn.load the same code more than once?

Matthew Wiener mcw at ln.nimh.nih.gov
Fri Jan 5 18:00:32 CET 2001

Hi.  I'm still working on figuring out why some C code that interfaced
nicely with R-1.1.1 is causing segmentation faults in R-1.2.0.  Brian
Ripley advised me that R-1.2.0 can be more sensitive to array overruns
than was R-1.1.1, so I'm looking for overruns.  But in the course of
running R with a debugger I've come across something else.

Without thinking about it much, I put the dyn.load statement loading my
compiled code into the function immediately before the code is called.
This means that the dyn.load call is being executed over and over.  This
has never seemed to cause a problem, but under the debugger I get an error
after several times that some address cannot be accessed (the exact
address changes from time to time).  If I'm not in the debugger, this
doesn't happen, but perhaps it has something to do with my eventual memory

So my question is:  can multiple loading of code cause a problem?  If so,
what kind? 

Also, I'll try loading the code in my .First function instead.  Can this
lead to any problems (like memory issues if I load lots of functions)?

I'm working on an alpha running Red Hat Linux.


Matt Wiener

r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list