[Rd] difficulty with sanitizer using bigmemory

pete mohanty pete@moh@nty @end|ng |rom gm@||@com
Sat Jul 20 01:11:47 CEST 2019

Dear all,

bigKRLS, which has been on CRAN for a couple of years, had to be pulled
recently due to what seems to be a sanitizer issue stemming from its use of
bigmemory. bigKRLS works fine (we’ve used it ourselves on many different
platforms and have had over 15,000 downloads without an end user reporting
difficulties because of this issue). Unfortunately, we have been unable to
reproduce the UndefinedBehaviorSanitizer error locally, and are unsure how
to proceed. We corresponded with Michael Kane, author of bigmemory, who
seems to think the issue may be on the CRAN side. At his suggestion, we
switched to filebacked big matrices, which didn’t resolve the issue. We
also tried adding MAIN_LDFLAGS = -fsanitize=undefined,address to the
MAKEVARS, which didn’t do the trick either.

Here are some links:


   bigKRLS repo: https://github.com/rdrr1990/bigKRLS

   bigKRLS file backs all big matrices with a helper function called
   ‘to.big.matrix’ found starting on line 116 of

   Discussion with Michael Kane:

And here is the main error itself:

package bigKRLS_3.0.5.tar.gz has been auto-processed.

The auto-check found additional issues for the *last* version released on

  clang-UBSAN <

  gcc-UBSAN <https://www.stats.ox.ac.uk/pub/bdr/memtests/gcc-UBSAN/bigKRLS>

Clicking through, you find that

> test_check("bigKRLS")

gauss_kernel.cpp:38:40: runtime error: member call on address
0x6120001f2c40 which does not point to an object of type 'BigMatrix'

0x6120001f2c40: note: object is of type 'FileBackedBigMatrix'

[details omitted]

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior
gauss_kernel.cpp:38:40 in

runtime error: member access within address 0x6120001f2c40 which does not
point to an object of type 'BigMatrix'

0x6120001f2c40: note: object is of type 'FileBackedBigMatrix'

But FileBackedBigMatrix are BigMatrix objects and earlier versions of the
package which did not file back generated similar errors. (R CMD check
--as-cran does not yield these errors on Ubuntu 16.04 or MacOS Sierra,
which has made it particularly tricky to work on.)

Any and all help would be greatly appreciated!!


Pete Mohanty and Robert Shaffer

Pete Mohanty, PhD
Science, Engineering & Education Fellow
Stanford University
Department of Statistics

	[[alternative HTML version deleted]]

More information about the R-devel mailing list