Merge pull request #8204 from roc-lang/fix-deep-or-chain-stack-overflow

Fix stack overflows
This commit is contained in:
Luke Boswell 2025-08-18 09:15:11 +10:00 committed by GitHub
commit 272b35f8d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -371,10 +371,25 @@ where
}
}
#[tokio::main]
async fn main() {
fn main() {
env_logger::Builder::from_env("ROCLS_LOG").init();
// Tokio uses a smaller stack size for threads by default,
// this can lead to stack overflows that don't show up with the roc release bin!
let stack_size = 8 * 1024 * 1024; // 8MB
// Build a custom Tokio runtime with configured thread stack size
let runtime = tokio::runtime::Builder::new_multi_thread()
.thread_stack_size(stack_size)
.enable_all()
.build()
.expect("Failed to create Tokio runtime");
// Run the async main function on our custom runtime
runtime.block_on(async_main());
}
async fn async_main() {
let stdin = tokio::io::stdin();
let stdout = tokio::io::stdout();