From abdd6775925861742d45404279263a864612bc94 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Wed, 1 Oct 2025 17:36:08 +0200 Subject: [PATCH 1/3] Double the iterations in StackOverflowRepro - see if it fails in MacOS --- .../EmittedIL/TryCatch/StackOverflowRepro.fs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TryCatch/StackOverflowRepro.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TryCatch/StackOverflowRepro.fs index 310a6615aba..3866f7d8205 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TryCatch/StackOverflowRepro.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TryCatch/StackOverflowRepro.fs @@ -25,10 +25,10 @@ let rec viaActivePattern (a:int) = [] let main (args:string[]) = - let iterations = 4096 + let iterations = 4096 * 2 try viaActivePattern iterations with | ex -> printf "%s" (ex.GetType().ToString()) - 0 \ No newline at end of file + 0 From 3c1d2c3e7d3f5204d75c4d2264085fcaf4695894 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Wed, 1 Oct 2025 17:38:24 +0200 Subject: [PATCH 2/3] Improve assertion for stack overflow error handling Enhanced assertion to include StdErr output in failure case. --- .../EmittedIL/TryCatch/TryCatch.fs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TryCatch/TryCatch.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TryCatch/TryCatch.fs index bc3efb3cae2..b13739fa603 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TryCatch/TryCatch.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TryCatch/TryCatch.fs @@ -63,8 +63,9 @@ module TryCatch = let fsharpCoreFile = typeof>.Assembly.Location File.Copy(fsharpCoreFile, Path.Combine(Path.GetDirectoryName(dllFile), Path.GetFileName(fsharpCoreFile)), true) let result = CompilerAssert.ExecuteAndReturnResult (dllFile, isFsx=false, deps = s.Dependencies, newProcess=true) + printfn "%A" result - Assert.True(result.StdErr.Contains "stack overflow" || result.StdErr.Contains "StackOverflow") + Assert.True(result.StdErr.Contains "stack overflow" || result.StdErr.Contains "StackOverflow", result.StdErr) | _ -> failwith (sprintf "%A" compilationResult) From 9b14a758dba90641190ab772075139519313ab04 Mon Sep 17 00:00:00 2001 From: Tomas Grosup Date: Wed, 1 Oct 2025 19:13:38 +0200 Subject: [PATCH 3/3] Apply suggestion from @T-Gro --- .../EmittedIL/TryCatch/StackOverflowRepro.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TryCatch/StackOverflowRepro.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TryCatch/StackOverflowRepro.fs index 3866f7d8205..22f501c4f85 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TryCatch/StackOverflowRepro.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TryCatch/StackOverflowRepro.fs @@ -25,7 +25,7 @@ let rec viaActivePattern (a:int) = [] let main (args:string[]) = - let iterations = 4096 * 2 + let iterations = 4096 try viaActivePattern iterations with