Closed ifellows closed 2 years ago
Thanks for the report. I get a malloc() error and core dump.
R$ DVI(df[c("c")])
malloc(): corrupted top size
Aborted (core dumped)
Is that what you get?
Yup. Tracked it down to the C code called from runPercentRank
, but didn't get any further.
The problem is that df
has 284 rows, but DVI needs at least 353 observations to calculate one result with the default argumen values. It uses 100 observations for magnitude
and stretch
and then 252 observations for n
. So it adds 100 NA
at the beginning of your series, which only leaves 184 observations for the runPercentRank()
calculation.
All that said, it shouldn't crash your R session. The same bug exists in the C code for other functions (e.g. wilderSum()
). But those don't crash because the R code checks for valid values for n
given the number of leading NA
. I'll work on a patch for all affected functions.
Description
I am getting segfaults from the DVI function
Minimal, reproducible example
Session Info