start: make stack size strategy configurable #18760
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With this PR, one can specify what Linux stack-resizing behaviour by setting the appropriate option in std_options. There are three possibilities:
If you don't set any of these values the default of program_header is chosen, which is the current behaviour, so this PR should have no effect on existing code.
This makes makes it possible to remove unnecessary cruft if one e.g. lacks the CAP_SYS_RESOURCE capability (as that is required for increasing values with setrlimit), or when you don't mind the default 8MiB (Those extra setrlimits totally cramp our style when doing "Hey, look what I can do in X bytes and Y syscalls!" demos).
The ".fixed" option means one could also implement a "manual" version of #1639 by using runtime analysis tools. This entire thing should still be revisited when/if that is handled, but I perhaps this PR is an improvement to the status quo.
(this is a fix of a previous PR, #17830, which I think failed the CI due to allowing stack size shrinking.)