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

Satyaprakash Nayak @n248 @ending from cornell@edu
Mon Jul 9 19:04:16 CEST 2018


Thank you very much Kevin for your response.

I got R development with clang-6.0 working on a Ubuntu machine yesterday so
will investigate this further to see if there is anything more subtle going
on w.r.t. UBSAN issue and report here.

Regarding Solaris, I have code such as

SOURCES = $(cvode.cpp RcppExports.cpp)
OBJECTS = $(SOURCES:.cpp=.o)

Maybe that's causing a problem, I read section 1.6 of R extensions
mentioned

" Commonly misused GNU extensions are conditional inclusions (ifeq and the
like), ${shell ...}, ${wildcard ...} and similar, and the use of +=68
<https://cran.r-project.org/doc/manuals/r-release/R-exts.html#FOOT68> and :=
. "

I will try with

OBJECTS = cvode.o RcppExports.o

but since, rhub is not giving an error, I am not sure how I can really test
this.

Thanks for your suggestion about

SystemRequirements: GNU make

That may be the final solution for me to get this working on Solaris.

Best
Satya


On Mon, Jul 9, 2018 at 11:48 AM Kevin Ushey <kevinushey using gmail.com> wrote:

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

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list