Dear Sir or Madam,<br><br>I first noticed this problem yesterday.  Every C++ program that instantiates RInside has a segmentation violation upon exit.  (That's after doing everything it was supposed to do the way it was expected to do it.)  What am I doing wrong?<br>
<br>A minimal example is<br><br>#include <RInside.h><br>int main(int argc, char *argv[]) {<br>    RInside R(argc, argv);<br>    exit(0);<br>}<br><br>On<br><br>Ubuntu 10.04 LTS<br>R version 2.15.2 (2012-10-26) -- "Trick or Treat"<br>
Rcpp version 0.10.1<br>RInside version 0.2.10<br><br>To clear up the problem this morning, I nuked all R system code (sudo apt-get remove r-base) and packages from my machine (sudo rm -rf /usr/local/lib/R and other places).  I freshly installed R (sudo apt-get install r-base) and the RInside package (> install.packages( 'RInside' )).  I copied the rinside_sample0.cpp and its Makefile into a fresh directory, added ``CXXFLAGS:=$(filter-out -O3,$(CXXFLAGS))'' to the Makefile to facilitate debugging, compiled<br>
<br>$ make rinside_sample0<br>g++ -I/usr/share/R/include -I/usr/local/lib/R/site-library/Rcpp/include -I/usr/local/lib/R/site-library/RInside/include -pipe -g -Wall    rinside_sample0.cpp  -L/usr/lib64/R/lib -lR  -lblas -llapack -L/usr/local/lib/R/site-library/Rcpp/lib -lRcpp -Wl,-rpath,/usr/local/lib/R/site-library/Rcpp/lib -L/usr/local/lib/R/site-library/RInside/lib -lRInside -Wl,-rpath,/usr/local/lib/R/site-library/RInside/lib -o rinside_sample0<br>
<br>and ran the code to get<br><br>$ ./rinside_sample0<br>Segmentation fault<br><br>In gdb I get<br><br>$ gdb ./rinside_sample0<br>GNU gdb (GDB) 7.1-ubuntu<br>Copyright (C) 2010 Free Software Foundation, Inc.<br>License GPLv3+: GNU GPL version 3 or later <<a href="http://gnu.org/licenses/gpl.html">http://gnu.org/licenses/gpl.html</a>><br>
This is free software: you are free to change and redistribute it.<br>There is NO WARRANTY, to the extent permitted by law.  Type "show copying"<br>and "show warranty" for details.<br>This GDB was configured as "x86_64-linux-gnu".<br>
For bug reporting instructions, please see:<br><<a href="http://www.gnu.org/software/gdb/bugs/">http://www.gnu.org/software/gdb/bugs/</a>>...<br>Reading symbols from /home/mob/src/example/rinside_sample0...done.<br>
(gdb) run<br>Starting program: /home/mob/src/example/rinside_sample0 <br>[Thread debugging using libthread_db enabled]<br><br>Program received signal SIGSEGV, Segmentation fault.<br>0x00007ffff603e7af in ~Rostream (this=0x7ffff625cba0, __in_chrg=<value optimized out>, __vtt_parm=<value optimized out>) at ../inst/include/Rcpp/iostream/Rostream.h:41<br>
41    ../inst/include/Rcpp/iostream/Rostream.h: No such file or directory.<br>    in ../inst/include/Rcpp/iostream/Rostream.h<br><br>I have downloaded the RInside and Rcpp sources and will reinstall them, hopefully without -O3 and with -g so I can get more informative results.<br>
<br>Sincerely,<br>Mario<br><br><br>-- <br><div>Mario Bourgoin<br><br></div>