Skip to content

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

Description

@brson

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.

Activity

  1. eholk commented on Oct 8, 2012

    @eholk
    Contributor

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

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

  2. brson commented on Oct 8, 2012

    @brson
    ContributorAuthor

    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.

  3. brson commented on Oct 8, 2012

    @brson
    ContributorAuthor

    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.

  4. DonMartio commented on Oct 8, 2012

    @DonMartio

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

  5. catamorphism commented on Oct 8, 2012

    @catamorphism
    Contributor

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

  6. brson commented on Oct 18, 2012

    @brson
    ContributorAuthor

    gcc's __morestack calls abort if allocation fails

  7. nikomatsakis commented on Mar 24, 2013

    @nikomatsakis
    Contributor

    Not critical for 0.6; removing milestone

  8. added a commit that references this issue on Apr 27, 2013
  9. catamorphism commented on Jul 8, 2013

    @catamorphism
    Contributor

    Nominating for milestone 5, production-ready

  10. graydon commented on Jul 11, 2013

    @graydon
    Contributor

    accepted for production-ready milestone

  11. jbclements commented on Jul 11, 2013

    @jbclements
    Contributor

    +1 to eric holk's comment, basically.

  12. emberian commented on Sep 9, 2013

    @emberian
    Contributor

    Visiting for triage; nothing to add.

  13. eholk commented on Oct 16, 2013

    @eholk
    Contributor

    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.

  14. alexcrichton commented on Dec 17, 2013

    @alexcrichton
    Member

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

  15. added a commit that references this issue on Jun 29, 2024
  16. added a commit that references this issue on Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsC-enhancementCategory: An issue proposing an enhancement or a PR with one.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions