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

Make recursing too deep a fatal runtime error and make the limit larger #3695

Closed
brson opened this issue Oct 8, 2012 · 13 comments
Closed

Make recursing too deep a fatal runtime error and make the limit larger #3695

brson opened this issue Oct 8, 2012 · 13 comments
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@brson
Copy link
Contributor

brson commented Oct 8, 2012

What we are doing now leaks (#3555) and I don't know how to fix it yet, so we should not pretend we can enforce stack size limits safely.

@eholk
Copy link
Contributor

eholk commented Oct 8, 2012

Hmm... limits on recursion depth make me cringe.

Why have stack limits at all if we can just keep growing the stack?

@brson
Copy link
Contributor Author

brson commented Oct 8, 2012

As a sanity check. Eating all your ram and having the machine lock up while it swaps and oom kills is no fun. Nobody means to recurse infinitely.

@brson
Copy link
Contributor Author

brson commented Oct 8, 2012

FWIW I tested infinite recursion on Go over the weekend and let the process grow to over 1GB before I killed it manually. Not sure if they just recurse forever or not.

@DonMartio
Copy link

Disregarding the risk of being off topic. Are there any plans implementing tail recursion?

@catamorphism
Copy link
Contributor

@DonMartio - We're not sure yet; see #217.

@brson
Copy link
Contributor Author

brson commented Oct 18, 2012

gcc's __morestack calls abort if allocation fails

@nikomatsakis
Copy link
Contributor

Not critical for 0.6; removing milestone

brson added a commit to brson/rust that referenced this issue Apr 26, 2013
People hit the recursion depth limit too often, it's not possible
to unwind reliably from out-of-stack.

Issues rust-lang#3555, rust-lang#3695
bors added a commit that referenced this issue Apr 27, 2013
People hit the recursion depth limit too often, it's not possible
to unwind reliably from out-of-stack.

Issues #3555, #3695
@catamorphism
Copy link
Contributor

Nominating for milestone 5, production-ready

@graydon
Copy link
Contributor

graydon commented Jul 11, 2013

accepted for production-ready milestone

@jbclements
Copy link
Contributor

+1 to eric holk's comment, basically.

@emberian
Copy link
Member

emberian commented Sep 9, 2013

Visiting for triage; nothing to add.

@eholk
Copy link
Contributor

eholk commented Oct 16, 2013

Is this bug still open after 149047e?

If so, I'm still not convinced it's a good idea. After all, you can make the machine grind to a halt swapping by allocating lots of memory from the heap, and yet we don't put arbitrary limits on the heap size.

@alexcrichton
Copy link
Member

Closing in favor of #11011 which outlines the strategy we should be taking and is a little more up-to-date.

RalfJung pushed a commit to RalfJung/rust that referenced this issue Jun 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

No branches or pull requests

9 participants