Hello Dirk, I have what appears to be a reproducible example of the "Rcpp_precious_remove" problem that a few people have complained about. It is reproducible on my Mac Mini, but may not appears when you try because it is OS and compiler dependent. There is no problem under Windows, for example. There seems to be a gc bug lurking.
The test C++ source file (a simple REPL loop), makefile, and lldb (debugger) backtrace are attached to this message. When I compile and run on my Mac is fails with a seg fault every time. I have been able to trigger this problem under Ubuntu in a more complicated project using CMake. It fails every time. Furthermore, gdb shows that the failure happens on line 261 of RInside.cpp (where global_env_m = new Rcpp::Environment()). The comment immediately above this failure point says there is exposure to "a minimal risk of garbage collection" (based on feedback from Doug Bates and Luke Tierney). Perhaps the risk is greater than you anticipated? BTW, if I build the REPL app and link to a locally built version of RInside library, and not to the version installed by R, the REPL app works on my Mac Mini! This is probably due to the fact that stack/heap corruption can reveal itself in mysterious ways depending on the precise configuration employed. Thanks, Dominick On Thu, Jul 15, 2021 at 8:13 AM Dirk Eddelbuettel <e...@debian.org> wrote: > > On 15 July 2021 at 08:24, ma wh wrote: > | Colleague of mine wrote some R last week that was working OK, and hasn't > been changed in itself since that time. This week it's ceased working( I've > tried it on my machine and also see a fail, the following error is > encountered: > | > | Error in C_valid_tz(tzone): Function 'Rcpp_precious_remove' not provided > by package 'Rcpp' > | > | Searching around there aren't many hits. Those I do find seem quite > recent (stackoverflow questions or GitHub issues logged in various > projects, dates of posting are within the last few days). None of the > posted queries seem to have a solution, one person said restarting RStudio > helped, but not in my case. The SO question I found was marked as deleted. > The GitHub issue I found was "I solved it" but no mention of how. The SO > question was asking about svg export: > https://stackoverflow.com/questions/68345118/exporting-a-ggplot-in-svg-call-a-non-esixting-function > | The GitHub were also asking about packages I don't use - > | https://github.com/r-spatial/spdep/issues/60 > | https://github.com/drizopoulos/JMbayes2/issues/5 > | > | Anyone on the list have any pointers? Thanks > > Packages following a the GNU style often have a file ChangeLog which > "details > changes made to the code". Rcpp follows this convention, see 2021-07-05 and > 2021-01-017. > > Packages following the R packaging conventions often have a file > inst/NEWS.rd > (also rendered as NEWS at CRAN). Rcpp follow this conventions, see the Rcpp > 1.0.7 release (even if the functions is not named). > > Packages have source code you can search.I like `ag` aka "the > silversearcher": > > edd@rob:~/git/rcpp(master)$ ag -c Rcpp_precious_remove > ChangeLog:2 > inst/include/Rcpp/routines.h:3 > inst/include/RcppCommon.h:2 > src/rcpp_init.cpp:1 > src/barrier.cpp:1 > edd@rob:~/git/rcpp(master)$ > > It is still there, and available via the standard export mechanism. > > I recommend your friend take a look. The function is a) still there yet has > also b) been supplanted by a more sufficient alternative. > > Otherwise, a reproducible example would be the only way to make this > concrete. > > Hope this helps, Dirk > > -- > https://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org > _______________________________________________ > Rcpp-devel mailing list > Rcpp-devel@lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
(lldb) bt * thread #1, queue = com.apple.main-thread, stop reason = EXC_BAD_ACCESS (code=1, address=0x0) * frame #0: 0x000000010647ee99 Rcpp.so`Rcpp::Rcpp_precious_remove(token=0x0000000000000000) at barrier.cpp:[opt] frame #1: 0x0000000100003467 repl`Rcpp::Rcpp_precious_remove(SEXPREC*) + 119 frame #2: 0x00000001000033e5 repl`Rcpp::Rcpp_PreciousRelease(SEXPREC*) + 21 frame #3: 0x00000001000033ad repl`Rcpp::PreserveStorage<Rcpp::RObject_Impl<Rcpp::PreserveStorage> >::~PreserveStorage() + 29 frame #4: 0x0000000100003388 repl`Rcpp::RObject_Impl<Rcpp::PreserveStorage>::~RObject_Impl() + 24 frame #5: 0x0000000100003365 repl`Rcpp::RObject_Impl<Rcpp::PreserveStorage>::~RObject_Impl() + 21 frame #6: 0x0000000100003345 repl`RInside::Proxy::~Proxy() + 21 frame #7: 0x0000000100002fd5 repl`RInside::Proxy::~Proxy() + 21 frame #8: 0x0000000100002e77 repl`main + 183 frame #9: 0x00007fff7260bcc9 libdyld.dylib`start + 1 (lldb) exit
makefile
Description: Binary data
#include <RInside.h> int main(int argc, char *argv[]) { RInside R(argc, argv, false, false, true); R.parseEval("options(prompt = 'R > ')"); R.parseEval("X11()"); R.repl() ; R.parseEval("dev.off()"); exit(0); }
_______________________________________________ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel