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

{task,Executor}::block_on are unsound #6

Open
Nemo157 opened this issue Jun 15, 2020 · 2 comments
Open

{task,Executor}::block_on are unsound #6

Nemo157 opened this issue Jun 15, 2020 · 2 comments

Comments

@Nemo157
Copy link

Nemo157 commented Jun 15, 2020

It is possible for the future passed to block_on to stash a clone of the provided Waker somewhere, then call wake on it after completion, resulting in an attempt to access the ready variable from the freed block_on stack.

@Disasm
Copy link
Member

Disasm commented Jun 15, 2020

Hmm, is it possible to save this waker in a safe way?

@Nemo157
Copy link
Author

Nemo157 commented Jun 15, 2020

Yes, it could be put into a static WAKER: RefCell<Option<Waker>>; or similar construct.

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