Skip to content

fsc fails with StackOverflowException on a file with > 485 let bindings #1536

@estokes

Description

@estokes

Please provide a succinct description of the issue.

C:\Users\Eric>"C:\Program Files (x86)\Microsoft SDKs\F#\4.0\Framework\v4.0\fsc.exe" -o:obj\Debug\Test.dll -g --debug:full --noframework --define:DEBUG --define:TRACE --optimize- -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp.NETFramework\v2.0\2.3.0.0\FSharp.Core.dll" -r:C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll -r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" -r:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll --target:library --nowarn:00052 --warn:5 --warnaserror:76 --vserrors --LCID:1033 --utf8output --fullpaths --flaterrors --highentropyva- --sqmsessionguid:d9b14b80-365b-425e-811d-066cf3c283cb Test.fs
Microsoft (R) F# Compiler version 14.0.23413.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

Process is terminated due to StackOverflowException.

Related information

I generated a test case with the following function, but I will also attach the generated file
Test.zip

let testlet path i =
    let head =
        [|"module TestCase"
          "open System"
          ""|]
    let binds = [|0..i-1|] |> Array.map (fun i -> sprintf "let x%d = \"%d\"" i i)
    System.IO.File.Delete(path)
    System.IO.File.WriteAllLines(path, Array.append head binds)

Provide any related information

  • Operating system

Windows 10 build 14393.105

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions