[R-pkg-devel] Failed test automatic checks CRAN

Ivan Krylov |kry|ov @end|ng |rom d|@root@org
Sun May 11 23:23:28 CEST 2025


On Sat, 10 May 2025 16:48:16 +0200
Lorenzo Sostero <lorenzo.sostero using unibs.it> wrote:

> Flavor: r-devel-windows-x86_64
> Check: tests, Result: ERROR
>     Running 'testthat.R'
>   Running the tests in 'tests/testthat.R' failed.
>   Complete output:
>     > library(testthat)
>     > library(EmiR)
>     > test_check("EmiR")  
>     0%   10   20   30   40   50   60   70   80   90   100%
>     [----|----|----|----|----|----|----|----|----|----|

The process crashes trying to access the contents of a zero-length
vector:

Thread 1 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1564.0x634]
0x00007ff81e1409df in PSPopulation::init (this=this using entry=0xf243ff59d0)
(gdb) info locals
j = 0
i = 0
progress_bar = <optimized out>
delta = 10.4
pop_size = <optimized out>
d = 4
alpha = {<Rcpp::PreserveStorage<Rcpp::Vector<14,
Rcpp::PreserveStorage>>> = {
 data = 0x2d9ce6732e8, token = 0x2d9ce66d5c0}, <...>,
 cache = {start = 0x1, size = 0}}
(gdb) frame 1
#1  0x00007ff81e0f7b4c in ____C_A_T_C_H____T_E_S_T____0 ()
    at test-example.cpp:106
106       pop_noseed1.init();
(gdb) p (R_xlen_t)XLENGTH(pop_noseed1.m_config.m_alpha.data)
$7 = 0
(gdb) p (double*)REAL(pop_noseed1.m_config.m_alpha.data)
$8 = (double *) 0x1

This should be reproducible on R-4.5.0 or R-devel without extra
configuration flags. Previously this used to read some other memory
that didn't belong to the vector; now the data pointers of such vectors
are invalid, so dereferencing them causes a crash:
https://stat.ethz.ch/pipermail/r-devel/2025-April/083994.html
 
For your future questions: when asking for help with code, it's best to
provide a link to the code in question. This time, it was possible to
find the package at <https://cran.r-project.org/incoming/archive/>.

-- 
Best regards,
Ivan



More information about the R-package-devel mailing list