-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
wasm: Increase default stack size to 1MB #50083
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit increases the dfeault stack size allocated to the wasm32-unknown-unknown target to 1MB by default. Currently the default stack size is one wasm page, or 64 kilobytes. This default stack is quite small and has caused a stack overflow or two in the wild by accident. The current "best practice" for fixing this is to pass `-Clink-args='-z stack-size=$bigger'` but that's not great nor always easy to do. A default of 1MB matches more closely with other platforms where it's "pretty big" by default. Note that it was tested and if the users uses `-C link-args` to pass a custom stack size that's still resepected as lld seems to take the first argument, and where rustc is passing it will always be last.
kennytm
added
the
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
label
Apr 19, 2018
@bors r+ |
📌 Commit e58629b has been approved by |
bors
added
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Apr 20, 2018
kennytm
added a commit
to kennytm/rust
that referenced
this pull request
Apr 20, 2018
…=michaelwoerister wasm: Increase default stack size to 1MB This commit increases the dfeault stack size allocated to the wasm32-unknown-unknown target to 1MB by default. Currently the default stack size is one wasm page, or 64 kilobytes. This default stack is quite small and has caused a stack overflow or two in the wild by accident. The current "best practice" for fixing this is to pass `-Clink-args='-z stack-size=$bigger'` but that's not great nor always easy to do. A default of 1MB matches more closely with other platforms where it's "pretty big" by default. Note that it was tested and if the users uses `-C link-args` to pass a custom stack size that's still resepected as lld seems to take the first argument, and where rustc is passing it will always be last.
bors
added a commit
that referenced
this pull request
Apr 20, 2018
Rollup of 7 pull requests Successful merges: - #50031 (Clarified E0015 message.) - #50058 (Added build disk usage information) - #50081 (Update stdsimd submodule) - #50083 (wasm: Increase default stack size to 1MB) - #50104 (Disable auto-detection of libxml2 when compiling llvm.) - #50114 (Fix bad merge in #49991) - #50117 (must explicitly request file name when using with_file_name.) Failed merges:
kubkon
added a commit
to kubkon/zig
that referenced
this pull request
Jun 4, 2020
This commit increases the default Wasm stack to 1MB from the default of 1 Wasm page which equal 64KB. This seems like a reasonable default size while at the same time not overly large. Also, Rust lang seems to be favouring this default as well: [rust-lang#50083]. [rust-lang#50083]: rust-lang/rust#50083
andrewrk
pushed a commit
to ziglang/zig
that referenced
this pull request
Jun 8, 2020
This commit increases the default Wasm stack to 1MB from the default of 1 Wasm page which equal 64KB. This seems like a reasonable default size while at the same time not overly large. Also, Rust lang seems to be favouring this default as well: [rust-lang#50083]. [rust-lang#50083]: rust-lang/rust#50083
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
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.
This commit increases the dfeault stack size allocated to the
wasm32-unknown-unknown target to 1MB by default. Currently the default stack
size is one wasm page, or 64 kilobytes. This default stack is quite small and
has caused a stack overflow or two in the wild by accident.
The current "best practice" for fixing this is to pass
-Clink-args='-z stack-size=$bigger'
but that's not great nor always easy to do. A default of1MB matches more closely with other platforms where it's "pretty big" by
default.
Note that it was tested and if the users uses
-C link-args
to pass a customstack size that's still resepected as lld seems to take the first argument, and
where rustc is passing it will always be last.