Skip to content
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

Decrease default wasm stack to 512k from 1M #3861

Merged
merged 1 commit into from
Feb 28, 2022

Conversation

alexcrichton
Copy link
Member

This commit aims to achieve the goal of being able to run the test suite
on Windows with --test-threads 1, or more notably allowing Wasmtime's
defaults to work better with the main thread on Windows which appears to
have a smaller stack by default than Linux by comparison. In decreasing
the default wasm stack size a test is also update to probe for less
stack to work on Windows' main thread by default, ideally allowing the
full test suite to work with --test-threads 1 (although this isn't
added to CI as it's not really critical).

Closes #3857

This commit aims to achieve the goal of being able to run the test suite
on Windows with `--test-threads 1`, or more notably allowing Wasmtime's
defaults to work better with the main thread on Windows which appears to
have a smaller stack by default than Linux by comparison. In decreasing
the default wasm stack size a test is also update to probe for less
stack to work on Windows' main thread by default, ideally allowing the
full test suite to work with `--test-threads 1` (although this isn't
added to CI as it's not really critical).

Closes bytecodealliance#3857
@github-actions github-actions bot added wasmtime:api Related to the API of the `wasmtime` crate itself wasmtime:config Issues related to the configuration of Wasmtime labels Feb 28, 2022
@github-actions
Copy link

Subscribe to Label Action

cc @peterhuene

This issue or pull request has been labeled: "wasmtime:api", "wasmtime:config"

Thus the following users have been cc'd because of the following labels:

  • peterhuene: wasmtime:api

To subscribe or unsubscribe from this label, edit the .github/subscribe-to-label.json configuration file.

Learn more.

@github-actions
Copy link

github-actions bot commented Feb 28, 2022

Label Messager: wasmtime:config

It looks like you are changing Wasmtime's configuration options. Make sure to
complete this check list:

  • If you added a new Config method, you wrote extensive documentation for
    it.

    Our documentation should be of the following form:

    Short, simple summary sentence.
    
    More details. These details can be multiple paragraphs. There should be
    information about not just the method, but its parameters and results as
    well.
    
    Is this method fallible? If so, when can it return an error?
    
    Can this method panic? If so, when does it panic?
    
    # Example
    
    Optional example here.
    
  • If you added a new Config method, or modified an existing one, you
    ensured that this configuration is exercised by the fuzz targets.

    For example, if you expose a new strategy for allocating the next instance
    slot inside the pooling allocator, you should ensure that at least one of our
    fuzz targets exercises that new strategy.

    Often, all that is required of you is to ensure that there is a knob for this
    configuration option in wasmtime_fuzzing::Config (or one
    of its nested structs).

    Rarely, this may require authoring a new fuzz target to specifically test this
    configuration. See our docs on fuzzing for more details.

  • If you are enabling a configuration option by default, make sure that it
    has been fuzzed for at least two weeks before turning it on by default.


To modify this label's message, edit the .github/label-messager/wasmtime-config.md file.

To add new label messages or remove existing label messages, edit the
.github/label-messager.json configuration file.

Learn more.

Copy link
Member

@cfallin cfallin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems fine to me -- the stack size is "arbitrary" by default anyway as the size of stack frames is implementation-defined.

In practice of course downstream consumers may want to alter the size now if they had been silently relying on the old default... would you mind adding a note to that effect in the running release-notes doc?

(I know we both should do this eagerly for many more changes besides this one, and also we would probably note this anyway when looking over committed changes before the next release, but want to be extra-sure this one is noted)

@alexcrichton
Copy link
Member Author

Sounds good to me! I opened that up at #3862 as I figured I might as well go ahead and document everything else as well.

@alexcrichton alexcrichton merged commit aeaca20 into bytecodealliance:main Feb 28, 2022
@alexcrichton alexcrichton deleted the smaller-wasm-stack branch February 28, 2022 18:18
fitzgen added a commit that referenced this pull request Mar 31, 2022
This test is disabled on Windows because we determined it is too risky to back
port #3861 to the 0.34.x
release branch.
fitzgen added a commit that referenced this pull request Mar 31, 2022
* Bump Wasmtime to 0.34.2

[automatically-tag-and-release-this-commit]

* Add release notes for 0.34.2

* Disable stack overflow tests on Windows

This test is disabled on Windows because we determined it is too risky to back
port #3861 to the 0.34.x
release branch.

* Switch back to windows-2019 on CI (#3854)

Looks like windows-2022 is failing, let's perhaps pin for now?

Co-authored-by: Wasmtime Publish <wasmtime-publish@users.noreply.github.com>
Co-authored-by: Nick Fitzgerald <fitzgen@gmail.com>
Co-authored-by: Alex Crichton <alex@alexcrichton.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wasmtime:api Related to the API of the `wasmtime` crate itself wasmtime:config Issues related to the configuration of Wasmtime
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stack overflow tests don't work on the main thread on Windows
2 participants