[R-pkg-team] Bug#947004: S4Vectors Segmentation fault after r-base-core update (Was: Bug#947004: Tests segfaults (since the r-base-core update?))

Pages, Herve hpages at fredhutch.org
Sun Jan 12 20:34:37 GMT 2020


AFAIK the only standard way to run tests is by sourcing whatever files 
are in the tests/ folder of a package. This is actually what 'R CMD 
check' does to run the tests.

When you use the following commands
```
require("S4Vectors")
S4Vectors:::.test()
```
or
```
BiocGenerics:::testPackage("S4Vectors")
```
in your build system scripts, you're using the commands contained in the 
files found in the tests/ folder and **hardcoding** them in your 
scripts. This is fragile because the content of these files could change 
anytime (and will very likely change in the near future e.g. when 
S4Vectors or other packages with RUnit-based tests switch to 
testthat-based tests).

OTOH when you source the files in the tests/ folder you remain agnostic 
of the exact commands that are used to run the tests. This is robust.

Back to the segfault issue. The fact that it goes away when replacing 
require("S4Vectors"); S4Vectors:::.test() with 
BiocGenerics:::testPackage("S4Vectors") sounds like luck, that's all 
there is to it. And you didn't get such luck when doing the same for 
IRanges. It's worrying that a "fix" for a serious issue like a segfault 
relies on luck. In other words, someone should take the time to go to 
the bottom of this issue so we **really** understand what's going on.

Thanks,
H.


More information about the R-pkg-team mailing list