{task,Executor}::block_on are unsound
Opened this issue · 2 comments
Nemo157 commented
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 commented
Hmm, is it possible to save this waker in a safe way?
Nemo157 commented
Yes, it could be put into a static WAKER: RefCell<Option<Waker>>;
or similar construct.