fsharp icon indicating copy to clipboard operation
fsharp copied to clipboard

`System.AccessViolationException` opening default aws-cdk fsharp template

Open chrissimon-au opened this issue 1 year ago • 10 comments

AWS-CDK offers a (not officially supported) FSharp template.

When using this template and opening it in VSCode with Ionide, after restoring dependencies, opening FSharp files in the project doesn't function (e.g. tooltips, hints), System.AccessViolationException message can be found in the F# output log and the extension appears to be crashed (from that point it doesn't work for other .fs files even if they aren't from the template).

Although the issue is occurring in VSCode the exception stacktrace appears to suggest an FSharp compiler issue.

Repro steps

Detailed repro steps are provided in a repo: https://github.com/chrissimon-au/fcs-AccessViolationException-repro

The commit history itemises the steps used to create the repository, and the README describes steps to reproduce the errors.

Expected behavior

FSharp files in the cdk template project should work like normal FSharp files with hover, hints, autocomplete, etc.

Actual behavior

No normal functions and System.AccessViolationException exceptions in the log.

Known workarounds

See repro repo: https://github.com/chrissimon-au/fcs-AccessViolationException-repro#workarounds

Related information

All details are in the reproduction repository as it uses a vscode devcontainer:

  1. DotNet 6.0 (dotnet:0-6.0-bullseye)
  2. CDK version: cdk version 2.83.1 (build 006b542)
  3. Reproduced with Ionide v7.5.4 (current release version) and v7.6.1 (current pre-release version)

The full error log is:

Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at System.Buffer.Memmove(Byte ByRef, Byte ByRef, UIntPtr)
   at System.IO.UnmanagedMemoryStream.WriteCore(System.ReadOnlySpan`1<Byte>)
   at FSharp.Compiler.IO.MemoryMappedFileExtensions+MemoryMappedFile-TryFromByteMemory-Static@390.Invoke(System.IO.MemoryMappedFiles.MemoryMappedViewStream)
   at FSharp.Compiler.IO.MemoryMappedFileExtensions.trymmf(Int64, Microsoft.FSharp.Core.FSharpFunc`2<System.IO.MemoryMappedFiles.MemoryMappedViewStream,Microsoft.FSharp.Core.Unit>)
   at FSharp.Compiler.IO.MemoryMappedFileExtensions.MemoryMappedFile.TryFromByteMemory.Static(FSharp.Compiler.IO.ReadOnlyByteMemory)
   at FSharp.Compiler.IO.ByteStorage.FromByteMemoryAndCopy(FSharp.Compiler.IO.ReadOnlyByteMemory, Boolean)
   at FSharp.Compiler.AbstractIL.ILBinaryReader.seekReadManifestResources(ILMetadataReader, Boolean, FSharp.Compiler.IO.ReadOnlyByteMemory, PEReader, FSharp.Compiler.IO.ReadOnlyByteMemory)
   at FSharp.Compiler.AbstractIL.ILBinaryReader.seekReadModule(ILMetadataReader, Boolean, PEReader, FSharp.Compiler.IO.ReadOnlyByteMemory, UInt16, System.Tuple`2<Int32,Int32>, Boolean, Boolean, Boolean, Boolean, Boolean, Microsoft.FSharp.Core.FSharpOption`1<ILPlatform>, Boolean, Int32, Int32, Int32, System.String, Int32)
   at FSharp.Compiler.AbstractIL.ILBinaryReader.openMetadataReader(System.String, BinaryFile, Int32, System.Tuple`8<UInt16,System.Tuple`2<Int32,Int32>,Boolean,Boolean,Boolean,Boolean,Boolean,System.Tuple`5<Microsoft.FSharp.Core.FSharpOption`1<ILPlatform>,Boolean,Int32,Int32,Int32>>, PEReader, FSharp.Compiler.IO.ReadOnlyByteMemory, Microsoft.FSharp.Core.FSharpOption`1<PEReader>, Boolean)
   at FSharp.Compiler.AbstractIL.ILBinaryReader.OpenILModuleReader(System.String, ILReaderOptions)
   at FSharp.Compiler.CompilerImports+TcImports.OpenILBinaryModule(Internal.Utilities.Library.CompilationThreadToken, System.String, FSharp.Compiler.Text.Range)
   at FSharp.Compiler.CompilerImports+TryRegisterAndPrepareToImportReferencedDll@2142-2.Invoke(ProjectAssemblyDataResult)
   at FSharp.Compiler.BuildGraph+Bind@61-1[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Invoke(System.__Canon)
   at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvokeNoHijackCheck[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=6.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 Microsoft.FSharp.Control.AsyncPrimitives.StartWithContinuations[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.Threading.CancellationToken, Microsoft.FSharp.Control.FSharpAsync`1<System.__Canon>, Microsoft.FSharp.Core.FSharpFunc`2<System.__Canon,Microsoft.FSharp.Core.Unit>, Microsoft.FSharp.Core.FSharpFunc`2<System.Runtime.ExceptionServices.ExceptionDispatchInfo,Microsoft.FSharp.Core.Unit>, Microsoft.FSharp.Core.FSharpFunc`2<System.OperationCanceledException,Microsoft.FSharp.Core.Unit>)
   at Microsoft.FSharp.Control.FSharpAsync.StartWithContinuationsUsingDispatchInfo[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](Microsoft.FSharp.Control.FSharpAsync`1<System.__Canon>, Microsoft.FSharp.Core.FSharpFunc`2<System.__Canon,Microsoft.FSharp.Core.Unit>, Microsoft.FSharp.Core.FSharpFunc`2<System.Runtime.ExceptionServices.ExceptionDispatchInfo,Microsoft.FSharp.Core.Unit>, Microsoft.FSharp.Core.FSharpFunc`2<System.OperationCanceledException,Microsoft.FSharp.Core.Unit>, Microsoft.FSharp.Core.FSharpOption`1<System.Threading.CancellationToken>)
   at Microsoft.FSharp.Control.FSharpAsync.StartWithContinuations[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](Microsoft.FSharp.Control.FSharpAsync`1<System.__Canon>, Microsoft.FSharp.Core.FSharpFunc`2<System.__Canon,Microsoft.FSharp.Core.Unit>, Microsoft.FSharp.Core.FSharpFunc`2<System.Exception,Microsoft.FSharp.Core.Unit>, Microsoft.FSharp.Core.FSharpFunc`2<System.OperationCanceledException,Microsoft.FSharp.Core.Unit>, Microsoft.FSharp.Core.FSharpOption`1<System.Threading.CancellationToken>)
   at FSharp.Compiler.BuildGraph+GetOrComputeValue@365-5[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Invoke(Microsoft.FSharp.Core.Unit)
   at FSharp.Compiler.BuildGraph+Bind@61-1[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Invoke(System.__Canon)
   at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvokeNoHijackCheck[[System.__Canon, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=6.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 System.Runtime.CompilerServices.RuntimeHelpers.DispatchTailCalls(IntPtr, Void (IntPtr, IntPtr, System.Runtime.CompilerServices.PortableTailCallFrame*), IntPtr)
   at <StartupCode$FsAutoComplete-Core>.$CompilerServiceInterface+ParseAndCheckFileInProject@302-5.Invoke(Microsoft.FSharp.Control.AsyncActivation`1<Microsoft.FSharp.Core.FSharpResult`2<Microsoft.FSharp.Core.Unit,System.String>>)
   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.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)

chrissimon-au avatar Jun 11 '23 13:06 chrissimon-au

We're about to push a new version of Ionide that includes the compiler fixes released in 7.0.3xx SDKs in May, so let's see if this reproduces with that set of changes/fixes.

baronfel avatar Jun 11 '23 13:06 baronfel

Thanks @baronfel - I'll re-test it and close this issue if the new version resolves the issue.

Although, not sure if this is relevant, but I did test it with the current release and pre-release versions of Ionide - v7.5.4 (current release version) and v7.6.1 (current pre-release version). Apologies, I should've noted that in the initial bug report, so have edited to include that info in there now.

chrissimon-au avatar Jun 11 '23 13:06 chrissimon-au

That's ok, neither of those would have included the fixes I mention. The fixes would have been on our nightly branch, which we don't have a public channel for so you have to build and install it yourself.

baronfel avatar Jun 11 '23 13:06 baronfel

This will need the FCS test repro, for us to be able to debug. And a Mac machine probably.

But from a stack trace, it seems like something is wrong with runtime on Mac (specifically - mmf implementation).

Regarding specific FCS version - it's unlikely anything was fixed there, we haven't touched IL reader in years.

Only thing to possibly try and see if it's fixed is new runtime - 7 or 8.

Otherwise, we'll probably need to move it runtime with the repro.

vzarytovskii avatar Jun 11 '23 14:06 vzarytovskii

Yes - this is running on a Mac M2 - in a linux VSCode devcontainer - I'd be happy to setup a session to pair with someone if that would be helpful.

But based on your comments perhaps first I should test with dotnet 7 or 8 runtimes and also on another machine.

chrissimon-au avatar Jun 11 '23 14:06 chrissimon-au

I've just encountered it today. Repro - docker build the below (running on Windows with Docker Desktop with WSL2 backend):

FROM mcr.microsoft.com/dotnet/sdk:8.0

RUN echo -n "#r \"nuget: Amazon.CDK.Lib, 2.124.0\" " > script.fsx && dotnet fsi script.fsx

Full stack trace:

Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at System.Buffer.Memmove(Byte ByRef, Byte ByRef, UIntPtr)
   at System.IO.UnmanagedMemoryStream.WriteCore(System.ReadOnlySpan`1<Byte>)
   at System.IO.UnmanagedMemoryStream.Write(Byte[], Int32, Int32)
   at FSharp.Compiler.IO.MemoryMappedFileExtensions+MemoryMappedFile-TryFromByteMemory-Static@388.Invoke(System.IO.MemoryMappedFiles.MemoryMappedViewStream)
   at FSharp.Compiler.IO.MemoryMappedFileExtensions.trymmf(Int64, Microsoft.FSharp.Core.FSharpFunc`2<System.IO.MemoryMappedFiles.MemoryMappedViewStream,Microsoft.FSharp.Core.Unit>)
   at FSharp.Compiler.IO.MemoryMappedFileExtensions.MemoryMappedFile.TryFromByteMemory.Static(FSharp.Compiler.IO.ReadOnlyByteMemory)
   at FSharp.Compiler.IO.ByteStorage.FromByteMemoryAndCopy(FSharp.Compiler.IO.ReadOnlyByteMemory, Boolean)
   at FSharp.Compiler.AbstractIL.ILBinaryReader.seekReadManifestResources(ILMetadataReader, Boolean, FSharp.Compiler.IO.ReadOnlyByteMemory, PEReader, FSharp.Compiler.IO.ReadOnlyByteMemory)
   at FSharp.Compiler.AbstractIL.ILBinaryReader.seekReadModule(ILMetadataReader, Boolean, PEReader, FSharp.Compiler.IO.ReadOnlyByteMemory, UInt16, System.Tuple`2<Int32,Int32>, Boolean, Boolean, Boolean, Boolean, Boolean, Microsoft.FSharp.Core.FSharpOption`1<ILPlatform>, Boolean, Int32, Int32, Int32, System.String, Int32)
   at FSharp.Compiler.AbstractIL.ILBinaryReader.openMetadataReader(System.String, BinaryFile, Int32, System.Tuple`8<UInt16,System.Tuple`2<Int32,Int32>,Boolean,Boolean,Boolean,Boolean,Boolean,System.Tuple`5<Microsoft.FSharp.Core.FSharpOption`1<ILPlatform>,Boolean,Int32,Int32,Int32>>, PEReader, FSharp.Compiler.IO.ReadOnlyByteMemory, Microsoft.FSharp.Core.FSharpOption`1<PEReader>, Boolean)
   at FSharp.Compiler.AbstractIL.ILBinaryReader.OpenILModuleReader(System.String, ILReaderOptions)
   at FSharp.Compiler.CompilerImports+TcImports.OpenILBinaryModule(Internal.Utilities.Library.CompilationThreadToken, System.String, FSharp.Compiler.Text.Range)
   at FSharp.Compiler.CompilerImports+TryRegisterAndPrepareToImportReferencedDll@2157-2.Invoke(ProjectAssemblyDataResult)
   at FSharp.Compiler.BuildGraph+Bind@61-1[[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]].Invoke(System.__Canon)
   at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvokeNoHijackCheck[[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 Microsoft.FSharp.Control.AsyncPrimitives.StartWithContinuations[[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.FSharpFunc`2<System.__Canon,Microsoft.FSharp.Core.Unit>, Microsoft.FSharp.Core.FSharpFunc`2<System.Runtime.ExceptionServices.ExceptionDispatchInfo,Microsoft.FSharp.Core.Unit>, Microsoft.FSharp.Core.FSharpFunc`2<System.OperationCanceledException,Microsoft.FSharp.Core.Unit>)
   at Microsoft.FSharp.Control.FSharpAsync.StartWithContinuationsUsingDispatchInfo[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](Microsoft.FSharp.Control.FSharpAsync`1<System.__Canon>, Microsoft.FSharp.Core.FSharpFunc`2<System.__Canon,Microsoft.FSharp.Core.Unit>, Microsoft.FSharp.Core.FSharpFunc`2<System.Runtime.ExceptionServices.ExceptionDispatchInfo,Microsoft.FSharp.Core.Unit>, Microsoft.FSharp.Core.FSharpFunc`2<System.OperationCanceledException,Microsoft.FSharp.Core.Unit>, Microsoft.FSharp.Core.FSharpOption`1<System.Threading.CancellationToken>)
   at Microsoft.FSharp.Control.FSharpAsync.StartWithContinuations[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](Microsoft.FSharp.Control.FSharpAsync`1<System.__Canon>, Microsoft.FSharp.Core.FSharpFunc`2<System.__Canon,Microsoft.FSharp.Core.Unit>, Microsoft.FSharp.Core.FSharpFunc`2<System.Exception,Microsoft.FSharp.Core.Unit>, Microsoft.FSharp.Core.FSharpFunc`2<System.OperationCanceledException,Microsoft.FSharp.Core.Unit>, Microsoft.FSharp.Core.FSharpOption`1<System.Threading.CancellationToken>)
   at Microsoft.FSharp.Control.FSharpAsync.StartImmediateAsTask[[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<System.Threading.CancellationToken>)
   at FSharp.Compiler.BuildGraph+NodeCode.RunImmediate[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](NodeCode`1<System.__Canon>, System.Threading.CancellationToken)
   at FSharp.Compiler.CompilerImports.RequireReferences(Internal.Utilities.Library.CompilationThreadToken, TcImports, TcEnv, System.String, Microsoft.FSharp.Collections.FSharpList`1<AssemblyResolution>)
   at FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler.ProcessDelayedReferences(Internal.Utilities.Library.CompilationThreadToken, FsiDynamicCompilerState)
   at FSharp.Compiler.Interactive.Shell+FsiDynamicCompiler.EvalSourceFiles(Internal.Utilities.Library.CompilationThreadToken, FsiDynamicCompilerState, FSharp.Compiler.Text.Range, Microsoft.FSharp.Collections.FSharpList`1<System.String>, LexResourceManager, DiagnosticsLogger)
   at FSharp.Compiler.Interactive.Shell+ProcessDelayedDependencyManagerText@2691.Invoke(FsiDynamicCompilerState, System.Collections.Generic.KeyValuePair`2<System.String,Microsoft.FSharp.Collections.FSharpList`1<PackageManagerLine>>)
   at Microsoft.FSharp.Collections.SeqModule.Fold[[System.Collections.Generic.KeyValuePair`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]], 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.Core.FSharpFunc`2<System.__Canon,Microsoft.FSharp.Core.FSharpFunc`2<System.Collections.Generic.KeyValuePair`2<System.__Canon,System.__Canon>,System.__Canon>>, System.__Canon, System.Collections.Generic.IEnumerable`1<System.Collections.Generic.KeyValuePair`2<System.__Canon,System.__Canon>>)
   at FSharp.Compiler.Interactive.Shell.loop@3853-106(FsiInteractionProcessor, DiagnosticsLogger, Internal.Utilities.Library.CompilationThreadToken, FsiDynamicCompilerState, InteractionGroup)
   at FSharp.Compiler.Interactive.Shell+FsiInteractionProcessor.InteractiveCatch[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](DiagnosticsLogger, Microsoft.FSharp.Core.FSharpFunc`2<System.__Canon,System.Tuple`2<System.__Canon,FsiInteractionStepStatus>>, System.__Canon)
   at FSharp.Compiler.Interactive.Shell+FsiInteractionProcessor.ExecuteParsedInteractionInGroups(Internal.Utilities.Library.CompilationThreadToken, FsiDynamicCompilerState, Microsoft.FSharp.Core.FSharpOption`1<FSharp.Compiler.Syntax.ParsedScriptInteraction>, DiagnosticsLogger, Microsoft.FSharp.Core.FSharpOption`1<FsiValue>, System.Threading.CancellationToken)
   at FSharp.Compiler.Interactive.Shell+FsiInteractionProcessor.ExecuteParsedInteraction(Internal.Utilities.Library.CompilationThreadToken, FsiDynamicCompilerState, Microsoft.FSharp.Core.FSharpOption`1<FSharp.Compiler.Syntax.ParsedScriptInteraction>, DiagnosticsLogger, Microsoft.FSharp.Core.FSharpOption`1<FsiValue>, System.Threading.CancellationToken)
   at System.Runtime.CompilerServices.RuntimeHelpers.DispatchTailCalls(IntPtr, Void (IntPtr, Byte ByRef, System.Runtime.CompilerServices.PortableTailCallFrame*), Byte ByRef)
   at [email protected](Internal.Utilities.Library.CompilationThreadToken, FsiDynamicCompilerState)
   at FSharp.Compiler.Interactive.Shell+clo@4023-583[[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]].Invoke()
   at FSharp.Compiler.Interactive.Shell+FsiInteractionProcessor.mainThreadProcessAction[[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, Microsoft.FSharp.Core.FSharpFunc`2<System.__Canon,Microsoft.FSharp.Core.FSharpFunc`2<System.__Canon,System.Tuple`2<System.__Canon,FsiInteractionStepStatus>>>, System.__Canon)
   at FSharp.Compiler.Interactive.Shell+ParseAndExecuteInteractionFromLexbuf@4118.Invoke(FsiDynamicCompilerState)
   at FSharp.Compiler.Interactive.Shell+FsiInteractionProcessor.InteractiveCatch[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](DiagnosticsLogger, Microsoft.FSharp.Core.FSharpFunc`2<System.__Canon,System.Tuple`2<System.__Canon,FsiInteractionStepStatus>>, System.__Canon)
   at FSharp.Compiler.Interactive.Shell.run@4160-1(FsiInteractionProcessor, DiagnosticsLogger, Internal.Utilities.Library.CompilationThreadToken, LexFilter, FsiDynamicCompilerState)
   at [email protected](Microsoft.FSharp.Core.Unit)
   at FSharp.Compiler.Interactive.Shell.WithImplicitHome[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](TcConfigBuilder, System.String, Microsoft.FSharp.Core.FSharpFunc`2<Microsoft.FSharp.Core.Unit,System.__Canon>)
   at [email protected](FsiDynamicCompilerState)
   at FSharp.Compiler.Interactive.Shell+FsiInteractionProcessor.InteractiveCatch[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](DiagnosticsLogger, Microsoft.FSharp.Core.FSharpFunc`2<System.__Canon,System.Tuple`2<System.__Canon,FsiInteractionStepStatus>>, System.__Canon)
   at FSharp.Compiler.Interactive.Shell+FsiInteractionProcessor.EvalIncludedScripts(Internal.Utilities.Library.CompilationThreadToken, FsiDynamicCompilerState, Microsoft.FSharp.Collections.FSharpList`1<System.String>, DiagnosticsLogger)
   at FSharp.Compiler.Interactive.Shell.consume@4184-1(FsiInteractionProcessor, DiagnosticsLogger, Internal.Utilities.Library.CompilationThreadToken, FsiDynamicCompilerState, Microsoft.FSharp.Collections.FSharpList`1<System.Tuple`2<System.String,Boolean>>)
   at FSharp.Compiler.Interactive.Shell+FsiInteractionProcessor.LoadInitialFiles(Internal.Utilities.Library.CompilationThreadToken, DiagnosticsLogger)
   at FSharp.Compiler.Interactive.Shell+FsiEvaluationSession.Run()
   at Sample.FSharp.Compiler.Interactive.Main.evaluateSession(System.String[])
   at Sample.FSharp.Compiler.Interactive.Main.MainMain(System.String[])

queil avatar Jan 31 '24 19:01 queil

I am wondering if it has anything to do with the fact that Amazon.CDK.Lib.dll has Amazon.CDK.Lib.aws-cdk-lib-2.1.tgz as an embedded resource in it (about 20MB compressed).

queil avatar Jan 31 '24 20:01 queil

It seems referencing the dll directly via #r "Amazon.CDK.Lib.dll" serves as a workaround.

queil avatar Jan 31 '24 21:01 queil

It seems to be an issue of MemoryMappedFile on Linux (or just in a dev container environment??) similar to this one.. BTW all the configuration changes mentioned in that thread did not solve the issue.

Martin521 avatar Jan 31 '24 21:01 Martin521

If this is WSL then for me it's yet another reason to move to real Linux 😄 If it's Linux then well...

queil avatar Jan 31 '24 21:01 queil