Closed

Description
The exact assert I am seeing fail is:
task '<unnamed>' failed at 'assertion failed: self.data.is_none()', /build/buildd/rust-nightly-201403090405~e1681df~precise/src/libstd/comm/oneshot.rs:346
If a task waits on a select and one of the channels is new (still in OneShot mode), and that channel is sent two messages before the other task is scheduled. This assertion will be triggered.
Code to reproduce:
extern crate native;
use std::io::timer::Timer;
use std::comm::{Chan, Select};
#[start]
fn start(argc: int, argv: **u8) -> int {
native::start(argc, argv, main)
}
fn select_task(p: &Port<()>)
{
let mut timer = Timer::new().unwrap();
timer.sleep(25);
let select = Select::new();
let mut handle = select.handle(p);
unsafe {handle.add()};
let _ = select.wait();
return;
}
fn main()
{
let mut timer = Timer::new().unwrap();
let (p, c) = Chan::new();
spawn(proc() {
select_task(&p)
});
timer.sleep(50);
c.send(());
c.send(());
}
Metadata
Metadata
Assignees
Labels
No labels
Activity
sfackler commentedon Mar 10, 2014
cc @alexcrichton
std: Relax an assertion in oneshot selection
alexcrichton commentedon Mar 10, 2014
Thanks for the small test case to reproduce!
Auto merge of rust-lang#12802 - rust-lang:jonas-schievink-patch-1, r=…
fulfill expectations in `check_unsafe_derive_deserialize`
Auto merge of rust-lang#12804 - B14CK313:master, r=y21