Skip to content

native::start should get a more accurate estimate of the stack bounds #11359

Closed
@huonw

Description

@huonw
Member

It currently just assumes that it's always 2MB.

This logic was added by #11360.

Activity

alexcrichton

alexcrichton commented on Mar 24, 2014

@alexcrichton
Member

On linux (and possibly other related unices), we can use getrlimit(RLIMIT_STACK) to learn a bit about the stack limit.

steveklabnik

steveklabnik commented on Feb 10, 2015

@steveklabnik
Member

native::start is now totally gone, so I believe this is now irrelevant.

jshs

jshs commented on Feb 13, 2015

@jshs

The stack size of the main thread is still estimated in std::rt, so I think the issue remains relevant.

pnkfelix

pnkfelix commented on Mar 3, 2015

@pnkfelix
Member

reopening: the code in question is still just guessing, AFAICT, and appears to be triggering an overflow (or underflow) panic on the branch with arithmetic overflow checking: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/3910/steps/test/logs/stdio

steveklabnik

steveklabnik commented on Mar 24, 2016

@steveklabnik
Member

Triage: the FIXME comment is now gone, and I don't know the internals well enough to determine if this is something that's still relevant. I think the removal of morestack would have made this go away?

alexcrichton

alexcrichton commented on Mar 24, 2016

@alexcrichton
Member

Ah yeah this is long since gone

added a commit that references this issue on Aug 24, 2023

Auto merge of rust-lang#11359 - Alexendoo:unwrap-or-default-check-sug…

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 overflows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @steveklabnik@alexcrichton@pnkfelix@huonw@jshs

        Issue actions

          native::start should get a more accurate estimate of the stack bounds · Issue #11359 · rust-lang/rust