Increase stack size in examples/threads.c#7651
Merged
alexcrichton merged 1 commit intoDec 6, 2023
Merged
Conversation
This commit is an attempt to address the CI failure popping up in bytecodealliance#7636. I can reproduce the failure locally and it appears to be due to the fact that macOS is giving spawned threads via `pthread_create` a 512K stack by default. Cranelift when compiled in debug mode is taking more stack than this (but working in release mode). I was talking with Trevor and Jamey about possible ways to reduce the stack size here but for now I'm going with Jamey's suggestion of increasing the stack size as the best course of action for now.
elliottt
approved these changes
Dec 6, 2023
Member
elliottt
left a comment
There was a problem hiding this comment.
Looks good to me! It's also nice that we'll use 2MB across all platforms for this test now, instead of allowing for varying defaults.
maxbrunsfeld
added a commit
to zed-industries/zed
that referenced
this pull request
Feb 26, 2024
After upgrading to Wasmtime 18, we got crashes when running Zed in debug mode. While bisecting the Wasmtime commits and trying to identify the source of the crash, we noticed this Wasmtime PR, which increased the stack size of background threads in an example. This alerted us to the possibility that a stack overflow might be happening due to a lot of stack usage by cranelift. bytecodealliance/wasmtime#7651 Co-authored-by: Marshall <marshall@zed.dev>
maxbrunsfeld
added a commit
to zed-industries/zed
that referenced
this pull request
Feb 27, 2024
…s in debug builds (#8452) After upgrading to Wasmtime 18, we got crashes when running Zed in debug mode. While bisecting the Wasmtime commits and trying to identify the source of the crash, we noticed this Wasmtime PR, which increased the stack size of background threads in an example. This alerted us to the possibility that a stack overflow might be happening due to a lot of stack usage by cranelift. bytecodealliance/wasmtime#7651 Release Notes: - N/A Co-authored-by: Marshall <marshall@zed.dev>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 is an attempt to address the CI failure popping up in #7636. I can reproduce the failure locally and it appears to be due to the fact that macOS is giving spawned threads via
pthread_createa 512K stack by default. Cranelift when compiled in debug mode is taking more stack than this (but working in release mode). I was talking with Trevor and Jamey about possible ways to reduce the stack size here but for now I'm going with Jamey's suggestion of increasing the stack size as the best course of action for now.