[Rcpp-devel] problems while upgrading to Rcpp 0.11.2

Dirk Eddelbuettel edd at debian.org
Tue Sep 2 21:50:07 CEST 2014


Dear Pratibha,

On 2 September 2014 at 19:22, Pratibha Rana wrote:
| I have a custom application that uses Rcpp and Rinside to execute R code. All

[ Random thought: I might make people a bit more sympathetic for your cause
and questions if you pointed out that a) you are selling a db solution, b)
that these days Vertica is part of HP and c) the code for the R integration
is apparently on GitHub: https://github.com/vertica/DistributedR (or at least
that is where I think it may be).  Why you guys never announced that here
is a bit of a mystery to me. ]

| 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

Well, consider that 

  a) I (and others) develop on Ubuntu 14.04. Things work on Ubuntu 14.04

  b) CRAN tests all packages on several backends, including Ubuntu, Debian,
     FC, OS X and Windows and would tell me (as maintainer) in no uncertain
     terms if it didn't work.

  c) So if it fails to work for you, maybe assume a local issue first?

| 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();

That line makes little sense. I omitted it.

| 
|  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);
| }

Works fine here:

edd at max:~/git/rinside/inst/examples/standard$ cat rinside_vertica.cpp

#include <RInside.h>

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

  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);
}
edd at max:~/git/rinside/inst/examples/standard$ make rinside_vertica
ccache g++-4.8 -I/usr/share/R/include -I/usr/local/lib/R/site-library/Rcpp/include -I/usr/local/lib/R/site-library/RInside/include -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -O3 -Wall -pipe -Wno-unused -pedantic -Wall    rinside_vertica.cpp  -Wl,--export-dynamic -fopenmp  -L/usr/lib/R/lib -lR -lpcre -llzma -lbz2 -lz -lrt -ldl -lm  -lblas -llapack  -L/usr/local/lib/R/site-library/RInside/lib -lRInside -Wl,-rpath,/usr/local/lib/R/site-library/RInside/lib -o rinside_vertica
edd at max:~/git/rinside/inst/examples/standard$ ./rinside_vertica 
Hello, world!
edd at max:~/git/rinside/inst/examples/standard$ 


I maybe running github versions of Rcpp and/or RInside, but the only thing
that may matter is that you probably should

 a) install Rcpp from source
 b) install RInside from source

and then build these examples.

A reproducible issue may help.  This was not reproducible.  Or rather, this
may not even have been a bug.

Regards,  Dirk


| 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 at lists.r-forge.r-project.org
| https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org


More information about the Rcpp-devel mailing list