Skip to content
Prev 2904 / 12125 Next

[R-pkg-devel] Help with reproducing (and solving) clang-UBSAN and Solaris installation errors

The UBSAN error:

cvode.cpp:58:11: runtime error: call to function
cv_Roberts_dns(double, Rcpp::Vector<14, Rcpp::PreserveStorage>)
through pointer to incorrect function type 'Rcpp::Vector<14,
PreserveStorage> (*)(double, Rcpp::Vector<14, PreserveStorage>)'
/tmp/RtmplnLW4G/sourceCpp-x86_64-pc-linux-gnu-0.12.17/sourcecpp_a916f8734/filea91617630abf.cpp:9:
note: cv_Roberts_dns(double, Rcpp::Vector<14, Rcpp::PreserveStorage>)
defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior cvode.cpp:58:11 in

sounds like it might be a false positive, since the function
signatures do appear to be identical. Of course, there may be
something more subtle going on, but absent any other ill effects I
think the message can be ignored. For what it's worth, one similar
false positive is reported here at
https://github.com/google/sanitizers/issues/911.

The actual compilation error you're seeing on Solaris:

mksh: Fatal error in reader: = missing from replacement macro reference

implies that you're likely trying to use a GNU-ism in your Makefile /
Makevars. R requires that Makefiles be portable by default, as per
https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Using-Makevars.
If you _really_ need the GNU-isms, you can add something like:

SystemRequirements: GNU make

to request that GNU make is used on all platforms your package is built on.

Best,
Kevin
On Sun, Jul 8, 2018 at 3:53 AM SN248 <sn248 at cornell.edu> wrote: