Skip to content

Block unwind leak #2144

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
jruderman opened this issue Apr 7, 2012 · 1 comment
Closed

Block unwind leak #2144

jruderman opened this issue Apr 7, 2012 · 1 comment
Assignees

Comments

@jruderman
Copy link
Contributor

fn useBlock(f: fn~() -> uint) { useBlock({|| 22u }) }
fn main() {
    useBlock({|| 22u });
}

leaks after it runs out of stack space:

leaked memory in rust main loop (3 objects)
Assertion failed: (false), function ~memory_region, file ../src/rt/memory_region.cpp, line 172.
@ghost ghost assigned brson Apr 8, 2012
@brson
Copy link
Contributor

brson commented Apr 9, 2012

This is cute. When I run this my logs show:

rust: task 6662fc0 ran out of stack
rust: task 6662fc0 ran out of stack
rust: task 6662fc0 ran out of stack
rust: task 6662fc0 ran out of stack

What I think is happening is that the task runs out of stack, starts unwinding. In a landing pad it grows the stack again, but it's already spent its stack budget, so runs out of stack again, etc. The landing pads just keep throwing until it hits one that has enough stack, and all the ones that failed leak.

I'm going to try to fix it by removing the stack limit during unwinding. I'm not crazy about that but don't see any other solution besides aborting the runtime when a task runs out of stack.

@brson brson closed this as completed in b42c6d0 Apr 9, 2012
bors added a commit to rust-lang-ci/rust that referenced this issue Sep 22, 2022
mute_stdout_stderr: mute stderr instead of stdin

should fix rust-lang#2143

note: this is entirely untested, I was getting tons of errors on `cargo test` because of some missing setup.
I hope that CI can tell me if this works or not 🙈

r? `@oli-obk`
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