Skip to content

Allow controlling rustc stacker segment sizes via the environment? #128472

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
sunshowers opened this issue Aug 1, 2024 · 1 comment
Closed

Allow controlling rustc stacker segment sizes via the environment? #128472

sunshowers opened this issue Aug 1, 2024 · 1 comment

Comments

@sunshowers
Copy link
Contributor

While attempting to diagnose #128422, one of the issues that came up was that it is impossible to control stacker's segment sizes via the environment.

Typically, stack sizes can be controlled via the RUST_MIN_STACK environment variable, but that doesn't work for the stacker-based stacks that rustc creates. The code that invokes stacker is here, and it currently hardcodes a 1MiB stack size. The ability to set a larger stack size would have made it possible to work around the issue in #128422.

Would it make sense to have an environment variable for this? There are a few possible directions:

  1. If RUST_MIN_STACK is set, create stack segments with size max(1MiB, RUST_MIN_STACK). I think generally speaking, if RUST_MIN_STACK is set in the environment, there's probably some kind of stack exhaustion that's being worked around. This is the most obvious way to do it I think.
  2. Have a separate environment variable. The environment variable doesn't have to be documented -- even if it just exists in source code, enterprising folks will be able to find it.

I'm not sure if this should be filed here or in https://github.com/rust-lang/stacker/, but I think it's worth addressing somewhere.

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 1, 2024
@sunshowers
Copy link
Contributor Author

sunshowers commented Aug 1, 2024

@jieyouxu jieyouxu removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants