Closed
Description
Another SDK release, another lament.
I'm using fsdocs which processes some scripts to generate HTML. What worked yesterday, stopped working after I downloaded dotnet 8 RC 1.
Fatal error. Internal CLR error. (0x80131506)
at System.Runtime.Serialization.SerializationGuard.<ThrowIfDeserializationInProgress>g__ThrowIfDeserializationInProgress|0_0(System.Runtime.Serialization.SerializationInfo, System.String, Int32 ByRef)
at System.Diagnostics.Process.Start()
at <StartupCode$FSharp-Compiler-Service>.$FxResolver.executeProcess$cont@56(System.String, System.String, Microsoft.FSharp.Core.FSharpOption`1<System.String>, Int32, Microsoft.FSharp.Core.Unit)
at FSharp.Compiler.FxResolver.executeProcess(System.String, System.String, Microsoft.FSharp.Core.FSharpOption`1<System.String>, Int32)
at <StartupCode$FSharp-Compiler-Service>[email protected](System.String)
at System.Collections.Concurrent.ConcurrentDictionary`2[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[Microsoft.FSharp.Core.FSharpResult`2[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], FSharp.Core, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]].GetOrAdd(System.__Canon, System.Func`2<System.__Canon,Microsoft.FSharp.Core.FSharpResult`2<System.__Canon,System.__Canon>>)
at FSharp.Compiler.FxResolver.tryGetDesiredDotNetSdkVersionForDirectoryInfo()
at FSharp.Compiler.FxResolver.tryGetDesiredDotNetSdkVersionForDirectory()
at <StartupCode$FSharp-Compiler-Service>[email protected](Microsoft.FSharp.Core.Unit)
at System.Lazy`1[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].ViaFactory(System.Threading.LazyThreadSafetyMode)
at System.Lazy`1[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].ExecutionAndPublication(System.LazyHelper, Boolean)
at System.Lazy`1[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].CreateValue()
at FSharp.Compiler.FxResolver.tryGetSdkDir()
at <StartupCode$FSharp-Compiler-Service>[email protected](Microsoft.FSharp.Core.Unit)
at System.Lazy`1[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].ViaFactory(System.Threading.LazyThreadSafetyMode)
at System.Lazy`1[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].ExecutionAndPublication(System.LazyHelper, Boolean)
at System.Lazy`1[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].CreateValue()
at FSharp.Compiler.FxResolver.getImplementationAssemblyDir()
at <StartupCode$FSharp-Compiler-Service>[email protected](Microsoft.FSharp.Core.Unit)
at System.Lazy`1[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].ViaFactory(System.Threading.LazyThreadSafetyMode)
at System.Lazy`1[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].ExecutionAndPublication(System.LazyHelper, Boolean)
at System.Lazy`1[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].CreateValue()
at FSharp.Compiler.FxResolver.tryGetNetCoreRefsPackDirectoryRoot()
at <StartupCode$FSharp-Compiler-Service>[email protected](Microsoft.FSharp.Core.Unit)
at System.Lazy`1[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].ViaFactory(System.Threading.LazyThreadSafetyMode)
at System.Lazy`1[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].ExecutionAndPublication(System.LazyHelper, Boolean)
at System.Lazy`1[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].CreateValue()
at FSharp.Compiler.FxResolver.tryGetSdkRefsPackDirectory()
at <StartupCode$FSharp-Compiler-Service>[email protected](FSharp.Compiler.FxResolverLockToken)
at Internal.Utilities.Library.Lock`1[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].AcquireLock[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](Microsoft.FSharp.Core.FSharpFunc`2<System.__Canon,System.__Canon>)
at FSharp.Compiler.FxResolver.GetDefaultReferences(Boolean)
at FSharp.Compiler.ScriptClosure+ScriptPreprocessClosure.CreateScriptTextTcConfig[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, System.String, System.String, CodeContext, Boolean, Boolean,
Microsoft.FSharp.Core.FSharpOption`1<System.Tuple`2<System.__Canon,Microsoft.FSharp.Collections.FSharpList`1<System.Tuple`2<PhasedDiagnostic,FSharp.Compiler.Diagnostics.FSharpDiagnosticSeverity>>>>, Microsoft.FSharp.Core.FSharpFunc`2<TcConfigBuilder,Microsoft.FSharp.Core.Unit>, Boolean, Boolean, Microsoft.FSharp.Core.FSharpOption`1<System.String>, Microsoft.FSharp.Core.FSharpFunc`2<System.Tuple`2<System.String,System.DateTime>,Microsoft.FSharp.Core.FSharpOption`1<System.Tuple`3<System.Object,IntPtr,Int32>>>, ReduceMemoryFlag)
at FSharp.Compiler.ScriptClosure+ScriptPreprocessClosure.GetFullClosureOfScriptText(FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, System.String, System.String, FSharp.Compiler.Text.ISourceText, CodeContext, Boolean, Boolean, Boolean, Microsoft.FSharp.Core.FSharpOption`1<System.String>, LexResourc
eManager, Microsoft.FSharp.Core.FSharpFunc`2<TcConfigBuilder,Microsoft.FSharp.Core.Unit>, Boolean, Microsoft.FSharp.Core.FSharpFunc`2<System.Tuple`2<System.String,System.DateTime>,Microsoft.FSharp.Core.FSharpOption`1<System.Tuple`3<System.Object,IntPtr,Int32>>>, ReduceMemoryFlag, FSharp.Compiler.DependencyManager.DependencyProvider)
at FSharp.Compiler.ScriptClosure+LoadClosure.ComputeClosureOfScriptText(FSharp.Compiler.CodeAnalysis.LegacyReferenceResolver, System.String, System.String, FSharp.Compiler.Text.ISourceText, CodeContext, Boolean, Boolean, Boolean, Microsoft.FSharp.Core.FSharpOption`1<System.String>, LexResourceManager, Mi
crosoft.FSharp.Core.FSharpFunc`2<TcConfigBuilder,Microsoft.FSharp.Core.Unit>, Boolean, Microsoft.FSharp.Core.FSharpFunc`2<System.Tuple`2<System.String,System.DateTime>,Microsoft.FSharp.Core.FSharpOption`1<System.Tuple`3<System.Object,IntPtr,Int32>>>, ReduceMemoryFlag, FSharp.Compiler.DependencyManager.DependencyProvider)
at <StartupCode$FSharp-Compiler-Service>[email protected](System.Threading.CancellationToken)
at Internal.Utilities.Library.Cancellable+toAsync@898-1[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Invoke(System.Threading.CancellationToken)
at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvokeNoHijackCheck[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Threading.CancellationToken, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](Microsoft.FSharp.Control.AsyncActivation`1<System.__Canon>, System.Threading.CancellationToken, Microsoft.FSharp.Core.FSharpFunc`2<System.Threading.CancellationToken,Microsoft.FSharp.Control.FSharpAsync`1<System.__Canon>>)
at Microsoft.FSharp.Control.Trampoline.Execute(Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Control.AsyncReturn>)
at Microsoft.FSharp.Control.AsyncPrimitives.RunImmediate[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.Threading.CancellationToken, Microsoft.FSharp.Control.FSharpAsync`1<System.__Canon>)
at Microsoft.FSharp.Control.AsyncPrimitives.RunSynchronously[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.Threading.CancellationToken, Microsoft.FSharp.Control.FSharpAsync`1<System.__Canon>, Microsoft.FSharp.Core.FSharpOption`1<Int32>)
at Microsoft.FSharp.Control.FSharpAsync.RunSynchronously[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](Microsoft.FSharp.Control.FSharpAsync`1<System.__Canon>, Microsoft.FSharp.Core.FSharpOption`1<Int32>, Microsoft.FSharp.Core.FSharpOption`1<System.Threading.CancellationToken>)
at FSharp.Formatting.Internal.CompilerServiceExtensions+FSharpAssemblyHelper+getNetCoreAppFrameworkDependencies@71.Invoke(Microsoft.FSharp.Core.Unit)
at System.Lazy`1[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].ViaFactory(System.Threading.LazyThreadSafetyMode)
at System.Lazy`1[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].ExecutionAndPublication(System.LazyHelper, Boolean)
at System.Lazy`1[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].CreateValue()
at FSharp.Formatting.Internal.CompilerServiceExtensions+FSharpAssemblyHelper.getCheckerArguments[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.__Canon, System.__Canon, Boolean, Microsoft.FSharp.Core.FSharpOption`1<System.String>, System.Collections.Generic.IEnumerable`1<System.String>, System.Collections.Generic.IEnumerable`1<System.String>, System.Collections.Generic.IEnumerable`1<System.String>)
at FSharp.Formatting.CodeFormat.CodeFormatter+processSourceCode@353-1.Invoke(System.IO.StringReader)
at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvoke[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](Microsoft.FSharp.Control.AsyncActivation`1<System.__Canon>, System.__Canon, Microsoft.FSharp.Core.FSharpFunc`2<System.__Canon,Microsoft.FSharp.Control.FSharpAsync`1<System.__Canon>>)
at Microsoft.FSharp.Control.Trampoline.Execute(Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Core.Unit,Microsoft.FSharp.Control.AsyncReturn>)
at <StartupCode$FSharp-Core>[email protected](System.Object)
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading.PortableThreadPool+WorkerThread.WorkerThreadStart()
Process finished with exit code -1,073,741,819
Repro steps
- Install the RC 1 SDK
- Create console application
- Add reference to FCS (
dotnet add package FSharp.Compiler.Service --version 43.8.100-preview.23418.2
) - Update
Program.fs
:
open System.IO
open FSharp.Compiler.CodeAnalysis
open FSharp.Compiler.Text
let checker = FSharpChecker.Create()
let tempFile = Path.GetTempFileName() |> (fun p -> Path.ChangeExtension(p, ".fsx"))
printfn "%s" tempFile
File.Create(tempFile).Dispose()
let options =
checker.GetProjectOptionsFromScript(
tempFile,
SourceText.ofString "",
assumeDotNetFramework = false
)
|> Async.RunSynchronously
File.Delete tempFile
printfn "%A" options
Expected behaviour
I'm able to get the project options.
Actual behaviour
This is failing to execute dotnet --version
in
fsharp/src/Compiler/Driver/FxResolver.fs
Lines 54 to 111 in 88b14c4
Fatal error. Internal CLR error. (0x80131506)
What is very frustrating is that the unit tests in
fsharp/tests/service/ScriptOptionsTests.fs
Lines 26 to 45 in a296258
are still working for me on my local machine.
Known workarounds
/
Related information
Provide any related information (optional):
- Operating system Windows 11
- .NET Runtime: .NET 8 rc 1
Metadata
Metadata
Assignees
Type
Projects
Status
Done