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 nondeterministic bug in RecvSelection::deinit #69

Merged
merged 1 commit into from
Feb 7, 2021

Conversation

mbrubeck
Copy link
Contributor

@mbrubeck mbrubeck commented Feb 7, 2021

Using Arc::ptr_eq on trait object pointers can fail unpredictably because of rust-lang/rust#46139.

This can prevent a Hook from being removed when its RecvSelection is de-inited, which makes it incorrectly push Tokens to a queue owned by a Selector that no longer exists.

I found this bug using a test case provided by @scaphe in the Rust Users forum here: https://users.rust-lang.org/t/flume-question-possible-bug/55259

This may also be the cause of #44.

Using Arc::ptr_eq on trait object pointers can fail unpredictably
because of rust-lang/rust#46139.

This can prevent a Hook from being removed when its RecvSelection is
de-inited, which makes it incorrectly push Tokens to a queue owned by a
Selector that no longer exists.

This may be the cause of zesterer#44.
@zesterer
Copy link
Owner

zesterer commented Feb 7, 2021

Good catch! I'd forgotten that trait object vtables can be different across compilation units. I'll release a new version.

@zesterer zesterer merged commit 2bba4be into zesterer:master Feb 7, 2021
@zesterer
Copy link
Owner

zesterer commented Feb 7, 2021

I've released 0.10.2, which includes this fix. Thanks so much!

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 this pull request may close these issues.

2 participants