Skip to content

Instantly share code, notes, and snippets.

@sunshowers
Created August 2, 2024 23:54
Show Gist options
  • Save sunshowers/2dacc5902ad4aecc50d215f018f55232 to your computer and use it in GitHub Desktop.
Save sunshowers/2dacc5902ad4aecc50d215f018f55232 to your computer and use it in GitHub Desktop.
diff --git a/compiler/rustc_data_structures/src/stack.rs b/compiler/rustc_data_structures/src/stack.rs
index 7ff1339c5ab..5179e4f770a 100644
--- a/compiler/rustc_data_structures/src/stack.rs
+++ b/compiler/rustc_data_structures/src/stack.rs
@@ -5,7 +5,7 @@
// Only the first stack that is pushed, grows exponentially (2^n * STACK_PER_RECURSION) from then
// on. This flag has performance relevant characteristics. Don't set it too high.
-const STACK_PER_RECURSION: usize = 1024 * 1024; // 1MB
+const STACK_PER_RECURSION: usize = 2 * 1024 * 1024; // 2MB (rain)
/// Grows the stack on demand to prevent stack overflow. Call this in strategic locations
/// to "break up" recursive calls. E.g. almost any call to `visit_expr` or equivalent can benefit
diff --git a/src/ci/run.sh b/src/ci/run.sh
index efaf70078c4..59b49de3d60 100755
--- a/src/ci/run.sh
+++ b/src/ci/run.sh
@@ -6,6 +6,9 @@ if [ -n "$CI_JOB_NAME" ]; then
echo "[CI_JOB_NAME=$CI_JOB_NAME]"
fi
+echo -e '[safe]\n\tdirectory = *' > ~/.gitconfig
+export NO_DOWNLOAD_CI_LLVM=1
+
if [ "$NO_CHANGE_USER" = "" ]; then
if [ "$LOCAL_USER_ID" != "" ]; then
id -u user &>/dev/null || useradd --shell /bin/bash -u $LOCAL_USER_ID -o -c "" -m user
@@ -19,7 +22,6 @@ if [ "$NO_CHANGE_USER" = "" ]; then
# already be running with the right user.
#
# For NO_CHANGE_USER done in the small number of Dockerfiles affected.
- echo -e '[safe]\n\tdirectory = *' > /home/user/gitconfig
exec su --preserve-environment -c "env PATH=$PATH \"$0\"" user
fi
@dommyrock
Copy link

Just read you blog post on this issue where rustc parser wasn't calling stacker often enough to make new stack segments.
What a wild debugging rollercoaster ride.

Disassembling functions from their address on the Call stack was a first for me : )

Thanks for the great write up on this ! https://sunshowers.io/posts/rustc-segfault-illumos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment