-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime: allow recursion depth limit #4692
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
Labels
Milestone
Comments
I propose that we introduce in package runtime/debug: // SetMaxStack sets the maximum amount of memory that // can be used by a single goroutine stack. // If any goroutine reaches this limit, the program crashes. // Reducing the maximum only limits future stack growth. // SetMaxStack returns the previous setting. // The initial setting is 1 GB. // // SetMaxStack is useful mainly for limiting the damage done by // goroutines that enter an infinite recursion. func SetMaxStack(bytes int64) int64 Labels changed: added go1.2. Status changed to Accepted. |
Issue #2556 has been merged into this issue. |
https://golang.org/cl/12541052/ Owner changed to @rsc. Status changed to Started. |
*** Submitted as https://code.google.com/p/go/source/detail?r=aeb72c90c10e *** runtime: impose stack size limit The goal is to stop only those programs that would keep going and run the machine out of memory, but before they do that. 1 GB on 64-bit, 250 MB on 32-bit. That seems implausibly large, and it can be adjusted. Fixes issue #2556. Fixes issue #4494. Fixes issue #5173. R=khr, r, dvyukov CC=golang-dev https://golang.org/cl/12541052 Status changed to Fixed. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: