Open QuarticCat opened 1 year ago
This might also relate to #29.
Tnx @QuarticCat I saw it a few months ago, I didn't get the time to fix it yet, it's the only bug that is stopping Kanal from the 0.1 release. I will remove one-shot channel if I don't find a sound solution for it in an acceptable time.
@fereidani Just wanted to bump this issue and also perhaps see if you had a concrete deadline in mind for the solution here. I'm using kanal in an upcoming project and it looks awesome, and the 0.1 release would be incredible.
@Qwuke I'm going to remove oneshot from kanal and make it separate crate, I'm a bit busy with work now, oneshot needs excessive refactor and testing to be stabilize. I'll revisit as soon as I got free time.
Problem
Continuing from #34, I audited oneshot and found a data racing problem. The quickest way to reproduce it is using MIRI.
How to trigger it
FINISHED
but it hasn't actually finished receiving yet.FINISHED
, so it drops theOneshotInternal
, which contains the waker.wake
. BANG!Possible solution
You can add a state before
FINISHED
indicating that the data is transferring. An existing example isAtomicWaker
, which has aREGISTERING
state indicating that the waker is being replaced.