-
-
Notifications
You must be signed in to change notification settings - Fork 212
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
New CRAN issues #1308
Comments
I was able to reproduce this locally on macOS; I'll see if I can learn more. |
Which one did you try? |
Indeed, I tried with |
This seems like potentially a bug in
The function
Note that
So they're attempting to read from a zero-length integer vector, which fails. I'm not sure why that would've snuck by tests in the past, though. |
We were just talking to @JanMarvin the other day in another issue so let's call him. I am sure he heard from CRAN too ... Any insight from your end? |
It looks like
where
That is, an IntegerVector is being constructed implicitly from the int |
I also took a look at
And indeed, the failure occurs at code like the following:
where All that said, I'm not sure what we should do:
|
Hi @eddelbuettel I'm poking at it in ycphs/openxlsx#472 (but afaik nobody is actively working on |
@JanMarvin Whoops. My bad. @kevinushey We do it some places (vector/Subsetter.h) and it might be hard to do it "universally" :-/ |
On the |
|
Hi! I maintain 3 packages which are affected, all using Rcpp with the same pattern.
is that ok? If so I guess the fix will be provided in Rcpp? I don't think my issues involve length-0 vectors since in that case my code stops with an error before trying to get the pointer, for example https://github.com/tdhock/FLOPART/blob/main/src/interface.cpp int data_count = data_vec.size();
if(data_count < 2){
Rcpp::stop("need at least two data points");
} |
@tdhock The bug is most probably in your package. Rcpp can just warn (for now) or error (in a future release) so that you are aware of these bugs before CRAN UBSAN/ASAN checks are reported. Note that the UBSAN/ASAN errors I see on CRAN are not on line 55, but on line 57, where you do this:
And I don't see checks for length-0 vectos for these ones. |
@tdhock You could consider doing what I just did: reducing the test surface by not running the tests offending UBSAN. |
hi Inaki and Dirk thanks for the feedback, that is helpful. const int *label_type_ptr=0, *label_start_ptr=0, *label_end_ptr=0;
if(0 < label_count){
label_type_ptr = &label_type_vec[0];
label_start_ptr = &label_start_vec[0];
label_end_ptr = &label_end_vec[0];
}
int status = FLOPART
(&data_vec[0], &weight_vec[0],
data_count, penalty,
label_type_ptr, label_start_ptr, label_end_ptr, label_count, |
This can be closed now. The issues appear to all be addressed based on checking a bit over half the packages listed. Should this, or a related issue arise this can of course be reopened. |
Per incoming email
with short followup
The text was updated successfully, but these errors were encountered: