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

Unable to load an invalid hash table in debug mode #23

Open
carlsverre opened this issue Sep 19, 2024 · 0 comments
Open

Unable to load an invalid hash table in debug mode #23

carlsverre opened this issue Sep 19, 2024 · 0 comments

Comments

@carlsverre
Copy link

carlsverre commented Sep 19, 2024

Due to the debug_assert here:

debug_assert_eq!(header.sanity_check::<C>(raw_bytes.len()), Ok(()));

it's currently impossible (as far as I can tell) to load an invalid HashTable in debug mode and handle the error at runtime. Perhaps that debug assert should be moved into from_raw_bytes_unchecked?

In my use case I'm using ODHT to store an index within some serialized files. The code which loads these files uses from_raw_bytes to load the index and then checks it's Result to see if it failed.

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