Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TBB issues when CRAN runs tests on package #169

Open
MurrayEfford opened this issue May 4, 2021 · 6 comments
Open

TBB issues when CRAN runs tests on package #169

MurrayEfford opened this issue May 4, 2021 · 6 comments

Comments

@MurrayEfford
Copy link

Firstly, please direct me to a more suitable list if this is not where I should seek help with RcppParallel.

CRAN would like me to fix clang-ASAN and clang-UBSAN issues from RcppParallel when I submit packages 'secr' and 'openCR'. These are completely arcane to me. The problem only seems to arise when running tests. Is there a setting in RcppParallel >=5.1.1 that will get me through?

The test results are at
https://www.stats.ox.ac.uk/pub/bdr/memtests/clang-ASAN/secr/tests/testthat.Rout.fail
and
https://www.stats.ox.ac.uk/pub/bdr/memtests/clang-UBSAN/openCR/tests/testthat.Rout

Here is a typical snippet from the first:

library(testthat)
test_check("secr")
Loading required package: secr
This is secr 4.4.1. For overview type ?secr
../../src/tbb/scheduler.cpp:328:16: runtime error: member call on address 0x7f795c81ff40 which does not point to an object of type 'tbb::task'
0x7f795c81ff40: note: object has invalid vptr
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Thanks
Murray

@kevinushey
Copy link
Contributor

kevinushey commented May 4, 2021

Your best hope is to disable TBB when testing on CRAN. This can be done by setting the environment variable

Sys.setenv(RCPP_PARALLEL_BACKEND = "tinythread")

in your tests. Unfortunately the TBB library does a variety of things that trip the ASAN / UBSAN checkers on CRAN and there's really just not much I can do about it.

@MurrayEfford
Copy link
Author

Thanks for your prompt and very helpful response. I can easily do that.

@dipterix
Copy link

Hi @kevinushey, I encountered an error while trying to install RcppParallel. The package fail to compile with TBB

(tbb) Building TBB using bundled sources ...
make[1]: Entering directory `/tmp/RtmpbCHtDl/R.INSTALL198fd18d3795c/RcppParallel/src/tbb/src'
../build/common.inc:74: *** "" is not supported. Add build/.inc file with os-specific settings .  Stop.
make[1]: Leaving directory `/tmp/RtmpbCHtDl/R.INSTALL198fd18d3795c/RcppParallel/src/tbb/src'
make: *** [tbb] Error 2
ERROR: compilation failed for package ‘RcppParallel’

I was wondering if there is any compile flag to disable TBB and use tinythread only?

@kevinushey
Copy link
Contributor

If you supply -DRCPP_PARALLEL_USE_TBB=0 to the compiler during compilation, that should suffice. You might need to do that via Makevars. (It would be nice if RcppParallel made it easier to do via the configure script though.)

@dipterix
Copy link

I see... Does that mean I have to edit the makevars instead of using configure.args?

@eddelbuettel
Copy link
Member

It's a non-autoconf configure script calling R code.

If you take a hard look at it, maybe you propose a concise PR that would listen to an outer environment variable (or alike) to avoid hand edits? Not sure we have good precedents but there may be some somewhere...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants