Skip to content

[Rcpp-devel] unloading/reloading Rcpp based custom package crashes my R session

5 messages · Anwar Ludin, Dirk Eddelbuettel

#
Hello,

I am experiencing a strange behaviour when unloading/reloading a custom 
package written using Rcpp. The initial load works perfectly and I can 
use the package as intended.
## everything OK

When unloading the package I get the following warning:
Warning message:
In FUN(X[[2L]], ...) :
   Created a package name, ?2013-05-30 14:49:40?, when none found


Trying to reload the packages provokes a core dump of my R session.

Has anyone experienced this?




Regards,

Anwar
#
I've attached the  source package to this mail.
On 05/30/2013 04:59 PM, Anwar Ludin wrote:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: RiskCeteraPricing_1.0.tar.gz
Type: application/x-gzip
Size: 2088 bytes
Desc: not available
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20130530/027ddbc1/attachment.bin>
#
Anwar,
On 30 May 2013 at 16:59, Anwar Ludin wrote:
| I am experiencing a strange behaviour when unloading/reloading a custom 
| package written using Rcpp. The initial load works perfectly and I can 
| use the package as intended.

I my experience you will be best off simply by restarting R.  When I develop
with Rcpp, I tend to do my tests on the command-line using /usr/bin/r (from our
littler project) or Rscript.  You will notice that RStudio, when rebuilding /
reloading also restarts R.   There are some people who claim that you can
cleanly unload so your mileage may differ -- I prefer clean starts.

Dirk
#
Hi Dirk,

Yes I noticed that RStudio was restarting the session whenever you 
rebuild the package. I guess RStudio does this in order to make sure 
that the session is clean. I am however a bit worried from an RStudio 
end-user's perspective because the package can be loaded/unloaded using 
the package selection functionality in RStudio,  and whenever the user 
does that the R session crashes.

Regards,

Anwar
On 05/30/2013 05:38 PM, Dirk Eddelbuettel wrote:
#
On 30 May 2013 at 17:55, Anwar Ludin wrote:
| Yes I noticed that RStudio was restarting the session whenever you 
| rebuild the package. I guess RStudio does this in order to make sure 
| that the session is clean. I am however a bit worried from an RStudio 
| end-user's perspective because the package can be loaded/unloaded using 
| the package selection functionality in RStudio,  and whenever the user 
| does that the R session crashes.

So you may have a bug there.   

Just move your package aside for a moment, and take a (small) published
package from CRAN and try loading/unloading it to test your views on general
principles independently of your packages.

Dirk