You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use std;
import std::task;
fn a() {
fn doit() {
fn b(c: chan[chan[int]]) {
let p = port[int]();
task::send(c, chan(p));
}
let p = port[chan[int]]();
spawn b(chan(p));
task::recv(p);
}
let i = 0;
while i < 100 {
doit();
i += 1;
}
}
fn main() {
while (true) {
let t = spawn a();
task::join(t);
}
}
This eventually fail somewhere in the channel destruction path, either from trying to grab a lock that doesn't exist or double freeing memory. I believe it's because the port (on one thread) and the task sending to that port (on another thread) are both trying to destroy the same channel. Run with RUST_THREADS>1.