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

Deallocator running out of stack space #8295

Closed
jjwhitney opened this issue Aug 5, 2013 · 2 comments

Comments

@jjwhitney
Copy link

commented Aug 5, 2013

Deallocation of object chains seems to require stack space proportional to the size of the chain. The following example, for instance, fails with a "ran out of stack" error:

extern mod extra;

use extra::dlist::DList;
use extra::container::Deque;

fn main() {
    let mut m = ~ DList::new::<int>();

    for _ in range(0, 17000000) {
        m.push_front(0);
    }
    println("This line is printed");
    // Does not exit cleanly: "ran out of stack"
}
@brson

This comment has been minimized.

Copy link
Contributor

commented Aug 5, 2013

This is a problem for the new scheduler that doesn't yet implement split stacks. The Node dtor tail-recurses and the dlist benchmarks overflow the stack.

brson added a commit to brson/rust that referenced this issue Aug 5, 2013
extra: Don't recurse in DList drop glue. rust-lang#8295
The compiler-generated dtor for DList recurses deeply to drop Nodes.
For big lists this can overflow the stack.
@brson

This comment has been minimized.

Copy link
Contributor

commented Aug 5, 2013

Fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.