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

Kevin Ushey kevinu@hey @ending from gm@il@com
Mon Jul 9 17:47:37 CEST 2018

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>)'
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

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
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.


On Sun, Jul 8, 2018 at 3:53 AM SN248 <sn248 using cornell.edu> wrote:
> Dear all
> I recently submitted an R package to CRAN which was accepted. However, the
> package is failing additional tests, i.e., it fails to install on Solaris
> and also produces a clang-UBSAN issue. These can be seen here
> https://cran.r-project.org/web/checks/check_results_sundialr.html
> I tried to reproduce the installation error for Solaris and clang-UBSAN
> issue using rhub (R package). However, in both cases, I don't see any error
> reported by rhub.
> Solaris installation went fine (Oracle Solaris 10, x86, 32 bit, R-patched
> (experimental)). See the report below:
> https://builder.r-hub.io/status/original/sundialr_0.1.0.tar.gz-b13f34c036448a13cbc147f4fb2cf37b
> and
> No errors were reported when I run 'check_with_sanitizers()' command (I
> assume that is the right command to generate clang-UBSAN errors, though the
> Platform information is - Debian Linux, R-devel, GCC ASAN/UBSAN). See the
> report of the test below:
> https://builder.r-hub.io/status/original/sundialr_0.1.0.tar.gz-a38aa86e16494f41b6f2e2e093547b7b
> I am not sure how to proceed with debugging those errors as I am not able
> to reproduce them. Is there any way to test installation on Solaris (I
> don't have access to one, unfortunately) and reproduce clang-UBSAN issue.
> The clang-UBSAN issue _may_ be related to Rcpp::XPtr and _may_ remain
> unresolved (based on the thread in Rcpp-devel forum earlier (I could have
> mis-interpreted the whole discussion there) -
> http://lists.r-forge.r-project.org/pipermail/rcpp-devel/2017-July/009656.html
> )
> Any help in how to reproduce these issues will be highly appreciated.
> On a separate note - in case these issues remain unresolved, is the package
> doomed to go to CRAN archives then? The package installation and running
> examples went without error/warning/note on all the platforms in rhub.
> Thanks
> SN
>         [[alternative HTML version deleted]]
> ______________________________________________
> R-package-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel

More information about the R-package-devel mailing list