Skip to content

Task that outlives root task leaks memory #126

@jyasskin

Description

@jyasskin
$ cat ~/tmp/test2.rs 
fn child2(str s) {
}

fn main() {
  spawn child2("hi");
}
$ ./rustboot -L . ~/tmp/test2.rs -o ~/tmp/test2 && ~/tmp/test2
rt: fatal, 'leaked memory in rust main loop (1 objects)' failed, rt/rust.cpp:32

Passing an int instead of a str (as spawn.rs does) doesn't leak, and having the main thread yield several times (as spawn-fn.rs does) allows the child to exit, which also avoids the leak.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions