Hi,

I have a custom application that uses Rcpp and Rinside to execute R code. All 
was well until I was using R-3.0.0, Rcpp 0.10.2 and RInside 0.2.10 but now its 
time to upgrade to the latest version and I can't get even the Rinside samples 
to work in place of my application. My machine has Ubuntu14.04.  The code 
compiles fine but when I run it, I get a segfault during Rinside 
initialization.  I tried to troubleshoot by replacing my code by one of the 
examples rinside_sample0. The example runs fine as is but if I add just a 
single line "Rcpp::DataFrame p; " it segfaults again. Here is the complete 
code. The same code works fine inside the Rinside examples directory.


#include <RInside.h>

int main(int argc, char *argv[])
{

 std::getchar();

 RInside R(argc, argv);

 R["txt"] = "Hello, world!\n";
 Rcpp::DataFrame pf;             <-------- Runs fine if I comment out this line.
 R.parseEvalQ("cat(txt)");

 exit(0);
}




Here is the backtrace of the segfault


Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7597767 in reset_current_error() () from 
/home/prana/trunk/third-party/install/lib/R/library/RInside/lib/libRInside.so
(gdb) bt -10
#261636 0x00007ffff7597769 in reset_current_error() () from 
/home/prana/trunk/third-party/install/lib/R/library/RInside/lib/libRInside.so
#261637 0x00007ffff7597769 in reset_current_error() () from 
/home/prana/trunk/third-party/install/lib/R/library/RInside/lib/libRInside.so
#261638 0x00007ffff7597769 in reset_current_error() () from 
/home/prana/trunk/third-party/install/lib/R/library/RInside/lib/libRInside.so
#261639 0x00007ffff7597769 in reset_current_error() () from 
/home/prana/trunk/third-party/install/lib/R/library/RInside/lib/libRInside.so
#261640 0x00007ffff7598530 in Rcpp::Rcpp_eval(SEXPREC*, SEXPREC*) () from 
/home/prana/trunk/third-party/install/lib/R/library/RInside/lib/libRInside.so
#261641 0x00007ffff7599542 in 
Rcpp::Language_Impl<Rcpp::PreserveStorage>::eval() const () from 
/home/prana/trunk/third-party/install/lib/R/library/RInside/lib/libRInside.so
#261642 0x00007ffff75969c7 in RInside::autoloads() () from 
/home/prana/trunk/third-party/install/lib/R/library/RInside/lib/libRInside.so
#261643 0x00007ffff7595fd3 in RInside::initialize(int, char const* const*, 
bool, bool, bool) () from 
/home/prana/trunk/third-party/install/lib/R/library/RInside/lib/libRInside.so
#261644 0x00007ffff7595a4a in RInside::RInside(int, char const* const*, bool, 
bool, bool) () from 
/home/prana/trunk/third-party/install/lib/R/library/RInside/lib/libRInside.so
#261645 0x000000000040361e in main (argc=1, argv=0x7fffffffdc88) at 
rinside_sample0.cpp:14
(gdb)





I also looked at the libraries that were being loaded at runtime and they are 
exactly the same for both the rinside examples and my app. Pasted below for 
completeness. I am out ofdebugging tricks to get this to work. Any ideas as to 
what's wrong. what am I missing?


prana:trunk/third-party/install/lib/R/library/RInside/examples/standard $ cat 
/proc/21915/maps | awk '{print $6}' | grep '\.so' | sort | uniq
/home/prana/trunk/third-party/install/lib/R/lib/libRblas.so
/home/prana/trunk/third-party/install/lib/R/lib/libRlapack.so
/home/prana/trunk/third-party/install/lib/R/lib/libR.so
/home/prana/trunk/third-party/install/lib/R/library/graphics/libs/graphics.so
/home/prana/trunk/third-party/install/lib/R/library/grDevices/libs/grDevices.so
/home/prana/trunk/third-party/install/lib/R/library/methods/libs/methods.so
/home/prana/trunk/third-party/install/lib/R/library/Rcpp/libs/Rcpp.so
/home/prana/trunk/third-party/install/lib/R/library/RInside/lib/libRInside.so
/home/prana/trunk/third-party/install/lib/R/library/stats/libs/stats.so
/home/prana/trunk/third-party/install/lib/R/library/utils/libs/utils.so
/lib/x86_64-linux-gnu/ld-2.19.so
/lib/x86_64-linux-gnu/libc-2.19.so
/lib/x86_64-linux-gnu/libdl-2.19.so
/lib/x86_64-linux-gnu/libgcc_s.so.1
/lib/x86_64-linux-gnu/libm-2.19.so
/lib/x86_64-linux-gnu/libnsl-2.19.so
/lib/x86_64-linux-gnu/libnss_compat-2.19.so
/lib/x86_64-linux-gnu/libnss_files-2.19.so
/lib/x86_64-linux-gnu/libnss_nis-2.19.so
/lib/x86_64-linux-gnu/libpthread-2.19.so
/lib/x86_64-linux-gnu/librt-2.19.so
/usr/lib/x86_64-linux-gnu/libgfortran.so.3.0.0
/usr/lib/x86_64-linux-gnu/libgomp.so.1.0.0
/usr/lib/x86_64-linux-gnu/libquadmath.so.0.0.0
/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19


prana:trunk/myapp $ cat /proc/21730/maps | awk '{print $6}' | grep '\.so' | 
sort | uniq
/home/prana/trunk/third-party/install/lib/R/lib/libRblas.so
/home/prana/trunk/third-party/install/lib/R/lib/libRlapack.so
/home/prana/trunk/third-party/install/lib/R/lib/libR.so
/home/prana/trunk/third-party/install/lib/R/library/graphics/libs/graphics.so
/home/prana/trunk/third-party/install/lib/R/library/grDevices/libs/grDevices.so
/home/prana/trunk/third-party/install/lib/R/library/methods/libs/methods.so
/home/prana/trunk/third-party/install/lib/R/library/Rcpp/libs/Rcpp.so
/home/prana/trunk/third-party/install/lib/R/library/RInside/lib/libRInside.so
/home/prana/trunk/third-party/install/lib/R/library/stats/libs/stats.so
/home/prana/trunk/third-party/install/lib/R/library/utils/libs/utils.so
/lib/x86_64-linux-gnu/ld-2.19.so
/lib/x86_64-linux-gnu/libc-2.19.so
/lib/x86_64-linux-gnu/libdl-2.19.so
/lib/x86_64-linux-gnu/libgcc_s.so.1
/lib/x86_64-linux-gnu/libm-2.19.so
/lib/x86_64-linux-gnu/libnsl-2.19.so
/lib/x86_64-linux-gnu/libnss_compat-2.19.so
/lib/x86_64-linux-gnu/libnss_files-2.19.so
/lib/x86_64-linux-gnu/libnss_nis-2.19.so
/lib/x86_64-linux-gnu/libpthread-2.19.so
/lib/x86_64-linux-gnu/librt-2.19.so
/usr/lib/x86_64-linux-gnu/libgfortran.so.3.0.0
/usr/lib/x86_64-linux-gnu/libgomp.so.1.0.0
/usr/lib/x86_64-linux-gnu/libquadmath.so.0.0.0
/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19





Thanks
Pratibha
_______________________________________________
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

Reply via email to