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

Unsoundness in HashMap::clear #98

Closed
ibraheemdev opened this issue Sep 27, 2021 · 2 comments
Closed

Unsoundness in HashMap::clear #98

ibraheemdev opened this issue Sep 27, 2021 · 2 comments

Comments

@ibraheemdev
Copy link
Collaborator

HashMap::clear does not have K\V: Send + Sync bounds, even though it calls defer_destroy on nodes and values, which might call the destructors on another thread. Unless I am missing something, this is unsound and could cause undefined behavior.

@jonhoo
Copy link
Owner

jonhoo commented Sep 29, 2021

Ah, yes, you are entirely right! Good catch. Would you mind submitting a PR with a fix?

@ibraheemdev
Copy link
Collaborator Author

Fixed as a side-affect of #102, K/V: 'static is no longer required.

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

2 participants