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

Exception with MMapped Files + Rename + Ionide + macOS #14061

Closed
cartermp opened this issue Oct 10, 2022 · 4 comments
Closed

Exception with MMapped Files + Rename + Ionide + macOS #14061

cartermp opened this issue Oct 10, 2022 · 4 comments
Assignees

Comments

@cartermp
Copy link
Contributor

Unclear if this is a bug, but it was thrown in FCS so I'm filing this here.

  1. Pull down the branch from here: Add F# example? ( ・ω・) honeycombio/honeycomb-opentelemetry-dotnet#296
  2. Go to Routing.fs, line 53
  3. Rename endpoints to something else, like createEndpoints

Throws an error:

[08:02:34.415 ERR] [LSP] CodeLensResolve - Child operation failed for /Users/pcarter/repos/honeycomb-opentelemetry-dotnet/examples/aspnetcore-fsharp/Routing.fs
System.AggregateException: One or more errors occurred. (The specified file name or path is too long, or a component of the specified path is too long.)
 ---> System.IO.PathTooLongException: The specified file name or path is too long, or a component of the specified path is too long.
   at System.IO.MemoryMappedFiles.MemoryMappedFile.CreateSharedBackingObjectUsingMemory(MemoryMappedProtections protections, Int64 capacity, HandleInheritability inheritability)
   at System.IO.MemoryMappedFiles.MemoryMappedFile.CreateSharedBackingObject(MemoryMappedProtections protections, Int64 capacity, HandleInheritability inheritability)
   at System.IO.MemoryMappedFiles.MemoryMappedFile.CreateCore(FileStream fileStream, String mapName, HandleInheritability inheritability, MemoryMappedFileAccess access, MemoryMappedFileOptions options, Int64 capacity)
   at System.IO.MemoryMappedFiles.MemoryMappedFile.CreateNew(String mapName, Int64 capacity, MemoryMappedFileAccess access, MemoryMappedFileOptions options, HandleInheritability inheritability)
   at FSharp.Compiler.CodeAnalysis.ItemKeyStoreBuilder.TryBuildAndReset() in D:\a\_work\1\s\src\fsharp\service\ItemKey.fs:line 451
   at <StartupCode$FSharp-Compiler-Service>.$IncrementalBuild.TypeCheck@492-7.Invoke(Tuple`2 _arg11) in D:\a\_work\1\s\src\fsharp\service\IncrementalBuild.fs:line 548
   at FSharp.Compiler.BuildGraph.Bind@53-1.Invoke(T x) in D:\a\_work\1\s\src\fsharp\BuildGraph.fs:line 53
   at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvokeNoHijackCheck[a,b](AsyncActivation`1 ctxt, b result1, FSharpFunc`2 userCode) in D:\a\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 465
   at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc`2 firstAction) in D:\a\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 104
   --- End of inner exception stack trace ---
[Error - 8:02:46 AM] Request textDocument/rename failed.
  Message: One or more errors occurred. (The specified file name or path is too long, or a component of the specified path is too long.)
  Code: -32603 

Looks like it's the creation of the MMapped file that throws the exception, but maybe there's some additional checks or some kind of fallback that could happen so that a rename operation doesn't just fail.

A little unclear why a path would be too long, since my path isn't exactly long.

@vzarytovskii
Copy link
Member

I think, that we don't use mmaped files for the source text normally (there's no need), however maybe FSAC passes the flag as true?
But regardless, it's a bug/limitation (it seems that in the mmaped files API) and we should fix/workaround it.

@T-Gro
Copy link
Member

T-Gro commented Oct 10, 2022

Related to (and solveable via?) dotnet/runtime#63240 and ionide/FsAutoComplete#939 .

According to the comments, should be fixed in dotnet7.
@cartermp : I assume you were using dotnet 6, correct?

@T-Gro T-Gro self-assigned this Oct 10, 2022
@cartermp
Copy link
Contributor Author

Oh yay, yes, this is that underlying .NET 6 issue. Closing!

@vzarytovskii
Copy link
Member

Oh yay, yes, this is that underlying .NET 6 issue. Closing!

Whew...don't have to fix anything...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants