-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Race leads to panic in oneshot::Sender::send() #4225
Copy link
Copy link
Closed
Labels
A-tokioArea: The main tokio crateArea: The main tokio crateC-bugCategory: This is a bug.Category: This is a bug.I-crashProblems and improvements related to program crashes/panics.Problems and improvements related to program crashes/panics.I-unsound 💥A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessA soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessM-syncModule: tokio/syncModule: tokio/sync
Metadata
Metadata
Assignees
Labels
A-tokioArea: The main tokio crateArea: The main tokio crateC-bugCategory: This is a bug.Category: This is a bug.I-crashProblems and improvements related to program crashes/panics.Problems and improvements related to program crashes/panics.I-unsound 💥A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessA soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessM-syncModule: tokio/syncModule: tokio/sync
Version
Reproduced with tokio 1.12.0 and 1.13.0
Platform
Description
There is a race between
send(),try_recv(), andoneshot::Receiver::close(). The following program yields a panic roughly every 3 seconds on my 18c/36t workstation, compiled with Rust 1.56.1 in release mode:All of the panics occur when
send()attemptsinner.consume_value().unwrap(). For example:I suspect this is a race where the
rx.close(); rx.try_recv()happens between theif !inner.complete()check and theinner.consume_value().unwrap().