-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Assertion failure in mpsc/shared.rs on stable #42852
Comments
If you can, could you post the code that causes this failure? That way we can reproduce this problem quicker. |
I'll need to boil it down to something minimal, right now it happens in a long-running server application when accepting a new client request. |
I don't expect anyone to dive this far into my code, but here is the exit from my library into std where the assertion fails: The conditions are, vaguely:
|
Wow, that was remarkably easy to reproduce in a minimal example: use std::sync::mpsc::channel;
use std::time::Duration;
use std::thread;
fn main() {
let (send, recv) = channel();
thread::spawn(move || {
thread::sleep(Duration::from_secs(1));
let send = send.clone();
thread::sleep(Duration::from_secs(1));
});
loop {
match recv.recv_timeout(Duration::from_millis(20)) {
Ok(s) => {let r: String = s;}
Err(_) => {}
}
}
} I put this into a fresh cargo project and ran it with
Same system specs as before
|
Reproduced the error in the playground with the above code snippet: Same error running it in the playground on nightly The integer32 playground reproduces it as well. |
I believe this is a duplicate of #39364 so closing in favor of that, but thanks for the report! |
Hello! I have a Rust program that is failing with this assertion failure and associated traceback. There is no unsafe code involved and I'm not doing anything fancy with channels.
Rust version 1.18.0 (stable) (see verbose version info below)
Here's the error and backtrace (the unexpected large number on the left side is different each run; a few examples are 4527882240, 4458676224):
rustc 1.18.0 (03fc9d6 2017-06-06)
binary: rustc
commit-hash: 03fc9d6
commit-date: 2017-06-06
host: x86_64-apple-darwin
release: 1.18.0
LLVM version: 3.9
The text was updated successfully, but these errors were encountered: