Skip to content

stack closure leak #2270

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

Closed
thatmattbone opened this issue Apr 22, 2012 · 1 comment
Closed

stack closure leak #2270

thatmattbone opened this issue Apr 22, 2012 · 1 comment

Comments

@thatmattbone
Copy link

On my x86_64 linux box running the latest version of Rust from git (as of this morning):

fn main() {
    let bar: fn() = {|| };
    bar();
}

Causes a leak:

Unreclaimed object found at 0x1b5a6a0: ((), ())
leaked memory in rust main loop (1 objects)
leak: ./src/rt/memory_region.cpp:172: memory_region::~memory_region(): Assertion `false' failed.
Aborted

Obviously this isn't very useful code, but I was just getting started and playing around with closures when I came across it. This might be a dupe of #2036 but I'm not smart enough to know :)

@brson
Copy link
Contributor

brson commented Apr 22, 2012

It is a dupe of #2036.

@brson brson closed this as completed Apr 22, 2012
bors added a commit to rust-lang-ci/rust that referenced this issue Sep 22, 2022
test that futexes induce appropriate synchronization

This fails when I remove the `validate_lock_acquire` or `validate_lock_release` from `futex_wake`. So finally we got those code paths actually covered in tests. :)
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
jieyouxu added a commit to jieyouxu/rust that referenced this issue Mar 11, 2025
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

2 participants