Comments (8)
Let me try again with gcc
instead of clang
and update this thread in a few hours.
from rcppannoy.
There is nothing reproducible in your bug report so my ability to help you from here is limited.
Did you use 0.0.7 from CRAN as your base, or the current master from GitHub (which is marginally ahead and which I called 0.0.7.1) ? FWIW it is worth I can run R CMD check
on both just fine (and this build and installs to run tests). But this stuff has been affected by R changes and/or g++ changes.
from rcppannoy.
i pushed some pretty extensive changes to annoy yesterday but don't think it's a part of rcppannoy yet right? just wanted to double check
from rcppannoy.
Hi @erikbern and thanks for being so proactive. RcppAnnoy does not automagically copy code from Annoy; it is pretty much a manual copy (along with copious regression checks).
Now, I can't speak for @mikepb, but I dont't think he copied code either. At this point we need more details (as eg provided by R's sessionInfo()
along with OS, compiler, ... versions. As I said, "works for me" and also works at CRAN or else they'd come after me..
from rcppannoy.
Sorry, this was my bad! I had NA
for the item value. Here's reproducible code:
sessionInfo()
R version 3.2.3 (2015-12-10)
Platform: x86_64-apple-darwin15.2.0 (64-bit)
Running under: OS X 10.11.3 (El Capitan)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] RcppAnnoy_0.0.7
loaded via a namespace (and not attached):
[1] Rcpp_0.12.3 codetools_0.2-14
f <- 1049
knn <- new(AnnoyEuclidean, f)
sv <- rnorm(f)
knn$addItem(NA, sv)
*** caught segfault ***
address 0xfffff7c600000008, cause 'memory not mapped'
Traceback:
1: .External(list(name = "CppMethod__invoke_void", address = <pointer: 0x7fb5e3431380>, dll = list(name = "Rcpp", path = "/usr/local/lib/R/3.2/site-library/Rcpp/libs/Rcpp.so", dynamicLookup = TRUE, handle = <pointer: 0x7fb5e3558f40>, info = <pointer: 0x10a7af3d0>), numParameters = -1L), <pointer: 0x7fb5e3544400>, <pointer: 0x7fb5e354d760>, .pointer, ...)
2: knn$addItem(NA, sv)
Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
Should the API check for this error condition?
from rcppannoy.
Looks like the segfault likely comes from annoy passing the NA
to realloc
, which then crashes the program.
https://github.com/eddelbuettel/rcppannoy/blob/master/inst/include/annoylib.h#L422
from rcppannoy.
Thanks for looking into this. We can probably catch that.
from rcppannoy.
Sorry for taking so long. This basically blew up whenever x
in knn$addItem(x, vector)
was negative, and NA
is a special negative value (actually, - INT_MAX
). But because we passed from R's SEXP
to an int32_t
already, I no longer have R's NA tests (easily) so I just test for negative values.
Commit and fix coming up.
from rcppannoy.
Related Issues (20)
- Vignette build on windows errors HOT 17
- Warning during compilation with Ropen HOT 5
- Expose `set_seed` method HOT 4
- More granular documentation HOT 5
- error installing rcppannoy on Mac 10.9.5, R 3.4.4 HOT 3
- Error in loading RcppAnnoy HOT 2
- RcppAnnoy fails to compile HOT 4
- Error during compilation of RcppAnnoy HOT 9
- rcppannoy loading/installation error HOT 6
- New / remaining sanitizer issues HOT 17
- Version 0.0.15 broke BiocNeighbors HOT 7
- 0.0.16 build from source issues on macOS HOT 5
- Vignette update HOT 9
- More content for RcppAnnoy.h HOT 4
- Unable to Save HOT 3
- Pass the whole matrix to addItem and getNNs function HOT 6
- Multithreading HOT 7
- Any plan for API like RcppHSNW or RANN? HOT 8
- R CMD build issue on Windows with R 4.2 HOT 9
- Run reverse depends checks HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rcppannoy.