Closed ammaraskar closed 3 years ago
Thanks for this info! I will try to fix that.
I think this fix would break some existing code for the more strict bound check. I will create a 0.7.0 release for the changes.
We have to do more complex checks to determine if the generator is send. The implementation is not that easy.
a new release 0.7 should be published soon
Sadly sendable Generator
is currently unsound because thread local variables may leak non-sendable values from within the our coroutine.
See https://blaz.is/blog/post/lets-pretend-that-task-equals-thread/ and https://users.rust-lang.org/t/controversial-opinion-keeping-rc-across-await-should-not-make-future-send-by-itself/100554/12 for details.
Opened separate #58
Hi there, we (Rust group @sslab-gatech) are scanning crates on crates.io for potential soundness bugs. We noticed that
Generator
implementsSend
as long as the closure has a static lifetime. However, this should also probably be bounded byT: Send
, otherwise it's possible to smuggle across non-Send types across thread boundaries.Here's an example of a data race in safe Rust code through a Generator.
Output: