Skip to content
Prev 9735 / 10988 Next

[Rcpp-devel] grDevices issue with RInside

hi dirk,

i've got it!

Rst.rhome is assigned here from getenv() (and no copy is made):

https://github.com/eddelbuettel/rinside/blob/d94b999b1f9a5b9a7c1eaefc89abe40ea0d2d4d2/src/RInside.cpp#L164

It makes it's way down inside of R, and is assigned to R_Home:

https://github.com/wch/r-source/blob/3234382b4b4632b114fc8400885300b04e4934a0/src/gnuwin32/system.c#L724

strings returned by getenv() are invalidated by subsequent calls to 
getenv().

the offending code exists in a #ifdef _WIN32 which is why it's windows only.

i'll have a PR for you shortly.

this has been a bit of an epic.

jonathon