Skip to content
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

Channels leak when sent over channels #763

Closed
robarnold opened this issue Jul 28, 2011 · 3 comments
Closed

Channels leak when sent over channels #763

robarnold opened this issue Jul 28, 2011 · 3 comments
Assignees

Comments

@robarnold
Copy link
Contributor

Minimal-ish test case:
https://gist.github.com/1110969

If I reduce it further, it seems to either not reproduce or it will deadlock or it will crash. Hopefully all the same cause!

@ghost ghost assigned eholk Jul 28, 2011
@eholk
Copy link
Contributor

eholk commented Jul 28, 2011

I'm guessing this is leaking the chan(p) that's being sent to request_task. The thing is, I can't figure out how this is any different from around line 192 of task-perf-word-count.rs (https://github.com/graydon/rust/blob/master/src/test/bench/task-perf-word-count.rs#L192)...

@brson
Copy link
Contributor

brson commented Jul 28, 2011

https://gist.github.com/1112731

Same test case. New syntax.

@brson
Copy link
Contributor

brson commented Jul 28, 2011

I think probably recv isn't calling drop on the value it's receiving into. In the following test case, if you uncomment the commented line it no longer leaks.

use std;
import std::task;

tag request {
  quit;
  close(chan[bool]);
}                                                                                                                                                                             

type ctx = chan[request];

fn request_task(c: chan[ctx]) {
    let p: port[request] = port();
    c <| chan(p);
    let req: request;
    p |> req;
    //req = quit;                                                                                                                                                             
    p |> req;                                                                                                                                                                 
}

fn new() -> ctx {
    let p: port[ctx] = port();
    let t = spawn request_task(chan(p));
    let cx: ctx;
    p |> cx;
    ret cx;
}

fn main() {
    let cx = new();

    let p: port[bool] = port();
    cx <| close(chan(p));
    cx <| quit;
}

@ghost ghost assigned brson Jul 29, 2011
@brson brson closed this as completed in 3896524 Jul 29, 2011
bors pushed a commit to rust-lang-ci/rust that referenced this issue Oct 26, 2020
This makes it possible to create rlibs for any target without installing
a toolchain for the target

Fixes rust-lang#763
ZuseZ4 pushed a commit to EnzymeAD/rust that referenced this issue Mar 7, 2023
* Handle non-strict select

* Fix non-strict phi
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
celinval added a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
* Add --enable-unstable option

Unstable options now require users to explicitly enable them. This is
important because the unstable options can be unsound or give spurious
CEX.

* Disable spurious pointer checks by default

We have been seeing a lot of spurious CEX related to pointer out of
bounds checks in arithmetic operations. It is actually valid rust in
some cases, and we can't differentiate the valid ones from the invalid
ones today. Thus, I'm disabling them by default.

Note that dereferencing invalid pointers is caught by different checks
and they should not be affected by this change.

This changes fixes rust-lang#563 and rust-lang#763.

Co-authored-by: Zyad Hassan <88045115+zhassan-aws@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants