From 96f49c8a7cec207b9c654c868206ae1f29e573a7 Mon Sep 17 00:00:00 2001 From: Nick Mills-Barrett Date: Thu, 26 Sep 2024 09:55:24 +0100 Subject: [PATCH] Disable stack shrinking by default This is an attempt to fix a Android crash based on a loosely related issue on the Go GitHub. Since we cannot reproduce the crash this is a best effort guess. --- src/runtime/runtime1.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/runtime/runtime1.go b/src/runtime/runtime1.go index 92a7e021ee23b5..330b3d61b4905d 100644 --- a/src/runtime/runtime1.go +++ b/src/runtime/runtime1.go @@ -381,6 +381,11 @@ func parsedebugvars() { debug.madvdontneed = 1 } + // Beep beep: disable stack shrinking, possibly to fix: + // https://linear.app/beeper/issue/BLEEP-25986#comment-99e33468 + // https://github.com/golang/go/issues/64781 + debug.gcshrinkstackoff = 1 + godebug := gogetenv("GODEBUG") p := new(string)