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

Fix rchk and asan/ubsan errors #193

Closed
paleolimbot opened this issue Jul 1, 2022 · 2 comments · Fixed by #194
Closed

Fix rchk and asan/ubsan errors #193

paleolimbot opened this issue Jul 1, 2022 · 2 comments · Fixed by #194

Comments

@paleolimbot
Copy link
Collaborator

Identified by @edzer here: #186 (comment)

@paleolimbot
Copy link
Collaborator Author

The rchk issue appears to be that it thinks the deleter for (a unique pointer to a) RGeography is an allocating function?

Function cpp_s2_cell_center(Rcpp::Vector<14, Rcpp::PreserveStorage>)::Op::processCell(S2CellId, long)
  [UP] unprotected variable <unnamed var:   %4 = alloca %struct.SEXPREC*, align 8> while calling allocating function std::__1::unique_ptr<RGeography, std::__1::default_delete<RGeography> >::~unique_ptr() /home/docker/R-svn/packages/build/Xnv2po3A/s2/src/s2-cell.cpp:357

@paleolimbot
Copy link
Collaborator Author

I had to ask in r-lib for help...the pattern that triggers this is if (condition) { return some_sexp_from_a_unique_ptr; } else { return R_NilValue; } and is likely a false error (but we still have to find a workaround...probably just go back to using Rcpp::XPtr<>()).

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

Successfully merging a pull request may close this issue.

1 participant