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

crash on linux calling layout_from_lsh_forest with 0-size LSHForest #34

Open
doublethefish opened this issue Aug 10, 2022 · 0 comments
Open

Comments

@doublethefish
Copy link
Collaborator

Repo:

  1. build with debug symbol on linux (I used the python:3.9.10-bullseye docker image)
  2. call into layout_from_lsh_forest with a zero-size LSHForest
  3. observe a crash when de-referencing an invalid end-iterator

The cause seems to be float max_x = *max_element(x.begin(), x.end()); where we dereference the invalid end-iterator returned by max_element when called with an empty container. This should crash more often, but although I've not looked into it properly, but because we dereference into a float we probably just get garbage data on the other platforms.

I have a fix for this code path and MSTFromLSHForest where we return an tuple of empty objects for an empty forest. The fix is on the development branch.

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

No branches or pull requests

1 participant