Skip to content

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

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

Closed
huonw opened this issue Jan 7, 2014 · 6 comments
Closed

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

huonw opened this issue Jan 7, 2014 · 6 comments
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows

Comments

@huonw
Copy link
Member

huonw commented Jan 7, 2014

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

This logic was added by #11360.

@alexcrichton
Copy link
Member

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

@steveklabnik
Copy link
Member

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

@jshs
Copy link

jshs commented Feb 13, 2015

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

@pnkfelix pnkfelix reopened this Mar 3, 2015
@pnkfelix
Copy link
Member

pnkfelix commented Mar 3, 2015

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
Copy link
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
Copy link
Member

Ah yeah this is long since gone

flip1995 pushed a commit to flip1995/rust that referenced this issue Aug 24, 2023
…gestion, r=dswij

Check that the suggested method exists in unwrap_or_default

Fixes rust-lang#11355

changelog: none
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
Projects
None yet
Development

No branches or pull requests

5 participants