Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

F# compiler crashes with DOTNET_TieredPGO=1 #74295

Closed
EgorBo opened this issue Aug 20, 2022 · 4 comments · Fixed by #74500
Closed

F# compiler crashes with DOTNET_TieredPGO=1 #74295

EgorBo opened this issue Aug 20, 2022 · 4 comments · Fixed by #74500
Assignees
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Milestone

Comments

@EgorBo
Copy link
Member

EgorBo commented Aug 20, 2022

When I try to compile https://github.com/giraffe-fsharp/Giraffe using F# compiler compiled with .NET 7.0P7 I get:

Fatal error. Internal CLR error. (0x80131506)
   at Internal.Utilities.FSharpEnvironment.get_FSharpProductName()
   at FSharp.Compiler.CompilerConfig+TcConfigBuilder.CreateNew(FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, System.String, ReduceMemoryFlag, System.String, Boolean, Boolean, CopyFSharpCoreFlag, Microsoft.FSharp.Core.FSharpFunc`2<System.Tuple`2<System.String,System.DateTime>,Microsoft.FSharp.Core.FSharpOption`1<System.Tuple`3<System.Object,IntPtr,Int32>>>, Microsoft.FSharp.Core.FSharpOption`1<System.String>, FSharp.Compiler.Text.Range)
   at FSharp.Compiler.Driver.main1(Internal.Utilities.Library.CompilationThreadToken, System.String[], FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, Boolean, ReduceMemoryFlag, CopyFSharpCoreFlag, Exiter, DiagnosticsLoggerProvider, DisposablesTracker)
   at FSharp.Compiler.Driver.CompileFromCommandLineArguments(Internal.Utilities.Library.CompilationThreadToken, System.String[], FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, Boolean, ReduceMemoryFlag, CopyFSharpCoreFlag, Exiter, DiagnosticsLoggerProvider, Microsoft.FSharp.Core.FSharpOption`1<Microsoft.FSharp.Core.FSharpFunc`2<TcImports,Microsoft.FSharp.Core.Unit>>, Microsoft.FSharp.Core.FSharpOption`1<Microsoft.FSharp.Core.FSharpFunc`2<System.Tuple`4<TcConfig,TcGlobals,System.String,ILModuleDef>,Microsoft.FSharp.Core.Unit>>)
   at FSharp.Compiler.CommandLineMain.main(System.String[])

Does not reproduce when DOTNET_TieredPGO is disabled (its default value)

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Aug 20, 2022
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Aug 20, 2022
@ghost
Copy link

ghost commented Aug 20, 2022

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

Issue Details

When I try to compile https://github.com/giraffe-fsharp/Giraffe using F# compiler compiled with .NET 7.0P7 I get:

Fatal error. Internal CLR error. (0x80131506)
   at Internal.Utilities.FSharpEnvironment.get_FSharpProductName()
   at FSharp.Compiler.CompilerConfig+TcConfigBuilder.CreateNew(FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, System.String, ReduceMemoryFlag, System.String, Boolean, Boolean, CopyFSharpCoreFlag, Microsoft.FSharp.Core.FSharpFunc`2<System.Tuple`2<System.String,System.DateTime>,Microsoft.FSharp.Core.FSharpOption`1<System.Tuple`3<System.Object,IntPtr,Int32>>>, Microsoft.FSharp.Core.FSharpOption`1<System.String>, FSharp.Compiler.Text.Range)
   at FSharp.Compiler.Driver.main1(Internal.Utilities.Library.CompilationThreadToken, System.String[], FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, Boolean, ReduceMemoryFlag, CopyFSharpCoreFlag, Exiter, DiagnosticsLoggerProvider, DisposablesTracker)
   at FSharp.Compiler.Driver.CompileFromCommandLineArguments(Internal.Utilities.Library.CompilationThreadToken, System.String[], FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, Boolean, ReduceMemoryFlag, CopyFSharpCoreFlag, Exiter, DiagnosticsLoggerProvider, Microsoft.FSharp.Core.FSharpOption`1<Microsoft.FSharp.Core.FSharpFunc`2<TcImports,Microsoft.FSharp.Core.Unit>>, Microsoft.FSharp.Core.FSharpOption`1<Microsoft.FSharp.Core.FSharpFunc`2<System.Tuple`4<TcConfig,TcGlobals,System.String,ILModuleDef>,Microsoft.FSharp.Core.Unit>>)
   at FSharp.Compiler.CommandLineMain.main(System.String[])

Does not reproduce when DOTNET_TieredPGO is disabled (its default value)

Author: EgorBo
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@EgorBo
Copy link
Member Author

EgorBo commented Aug 20, 2022

Does not repro with DOTNET_JitDelegateProfiling=0 cc @jakobbotsch

@EgorBo EgorBo added this to the 7.0.0 milestone Aug 20, 2022
@EgorBo EgorBo removed the untriaged New issue has not been triaged by the area owner label Aug 20, 2022
@jakobbotsch
Copy link
Member

I'm gonna grab this one.

@jakobbotsch jakobbotsch assigned jakobbotsch and unassigned TIHan Aug 23, 2022
@jakobbotsch
Copy link
Member

With some offline chatting we determined that this additionally requires DOTNET_JitCollect64BitCounts=1 to reproduce.

jakobbotsch added a commit to jakobbotsch/runtime that referenced this issue Aug 24, 2022
I missed updating the signature of the 64-bit variant here when the
vtable and delegate profiling helpers were originally split up.

Fix dotnet#74295
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Aug 24, 2022
jakobbotsch added a commit that referenced this issue Aug 29, 2022
* Fix signature for 64-bit delegate profiling helper

I missed updating the signature of the 64-bit variant here when the
vtable and delegate profiling helpers were originally split up.

Fix #74295

* JIT: Randomly collect 64-bit counts

Add some testing.

* Disable collecting 64 bit counters on 32-bit

This needs some work so disable it for now.
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Aug 29, 2022
github-actions bot pushed a commit that referenced this issue Aug 29, 2022
I missed updating the signature of the 64-bit variant here when the
vtable and delegate profiling helpers were originally split up.

Fix #74295
carlossanlop pushed a commit that referenced this issue Aug 29, 2022
)

* Fix signature for 64-bit delegate profiling helper

I missed updating the signature of the 64-bit variant here when the
vtable and delegate profiling helpers were originally split up.

Fix #74295

* JIT: Randomly collect 64-bit counts

Add some testing.

* Disable collecting 64 bit counters on 32-bit

This needs some work so disable it for now.

Co-authored-by: Jakob Botsch Nielsen <[email protected]>
@ghost ghost locked as resolved and limited conversation to collaborators Sep 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants