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

FileNotFoundException in MemoryMappedFile.OpenCore causes OOP operations to fail #49005

Closed
sharwell opened this issue Oct 29, 2020 · 4 comments · Fixed by #49974
Closed

FileNotFoundException in MemoryMappedFile.OpenCore causes OOP operations to fail #49005

sharwell opened this issue Oct 29, 2020 · 4 comments · Fixed by #49974
Labels
Area-Analyzers Bug Concept-OOP Related to out-of-proc Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented
Milestone

Comments

@sharwell
Copy link
Member

Version Used: 1a8a572

Hit this today. I see one reference to something similar a long time ago.

StreamJsonRpc.RemoteInvocationException: Unable to find the specified file.
   at StreamJsonRpc.JsonRpc.<InvokeCoreAsync>d__137`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.CodeAnalysis.Remote.BrokeredServiceConnection`1.<TryInvokeAsync>d__10`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
RPC server exception:
System.IO.FileNotFoundException: Unable to find the specified file.
      at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
      at System.IO.MemoryMappedFiles.MemoryMappedFile.OpenCore(String mapName, HandleInheritability inheritability, Int32 desiredAccessRights, Boolean createOrOpen)
      at System.IO.MemoryMappedFiles.MemoryMappedFile.OpenExisting(String mapName, MemoryMappedFileRights desiredAccessRights, HandleInheritability inheritability)
      at Microsoft.CodeAnalysis.Host.TemporaryStorageServiceFactory.TemporaryStorageService.AttachTemporaryStreamStorage(String storageName, Int64 offset, Int64 size, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.Serialization.SerializerService.GetTemporaryStorage(ObjectReader reader, SerializationKinds kind, ITemporaryStreamStorage& storage, Int64& length, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.Serialization.SerializerService.ReadModuleMetadataFrom(ObjectReader reader, SerializationKinds kind, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.Serialization.SerializerService.TryReadMetadataFrom(ObjectReader reader, SerializationKinds kind, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.Serialization.SerializerService.ReadPortableExecutableReferenceFrom(ObjectReader reader, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.Serialization.SerializerService.ReadMetadataReferenceFrom(ObjectReader reader, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.Serialization.SerializerService.Deserialize[T](WellKnownSynchronizationKind kind, ObjectReader reader, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.Remote.RemoteHostAssetSerialization.ReadData(Stream stream, Int32 scopeId, ISet`1 checksums, ISerializerService serializerService, CancellationToken cancellationToken)
      at Microsoft.CodeAnalysis.Remote.RemoteHostAssetSerialization.<ReadDataAsync>d__3.MoveNext()
   --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at Microsoft.CodeAnalysis.Remote.RemoteHostAssetSerialization.<ReadDataAsync>d__3.MoveNext()
   --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at System.Threading.Tasks.ValueTask`1.get_Result()
      at Microsoft.CodeAnalysis.Remote.BrokeredServiceConnection`1.<>c__DisplayClass12_0`1.<<InvokeStreamingServiceAsync>b__1>d.MoveNext()
   --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at Microsoft.CodeAnalysis.Remote.BrokeredServiceConnection`1.<>c__DisplayClass12_0`1.<<InvokeStreamingServiceAsync>b__1>d.MoveNext()
   --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at Microsoft.CodeAnalysis.Remote.BrokeredServiceConnection`1.<InvokeStreamingServiceAsync>d__12`1.MoveNext()
   --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at System.Threading.Tasks.ValueTask`1.get_Result()
      at Microsoft.CodeAnalysis.Remote.RemoteCallback`1.<InvokeAsync>d__4`1.MoveNext()
   --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at Microsoft.CodeAnalysis.Remote.SolutionAssetSource.<GetAssetsAsync>d__2.MoveNext()
   --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at Microsoft.CodeAnalysis.Remote.AssetProvider.<RequestAssetsAsync>d__12.MoveNext()
   --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at Microsoft.CodeAnalysis.Remote.AssetProvider.<SynchronizeAssetsAsync>d__10.MoveNext()
   --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at Microsoft.CodeAnalysis.Remote.ChecksumSynchronizer.<SynchronizeProjectsAsync>d__7.MoveNext()
   --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at Microsoft.CodeAnalysis.Remote.ChecksumSynchronizer.<SynchronizeProjectAssets_NoLockAsync>d__6.MoveNext()
   --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at Microsoft.CodeAnalysis.Remote.ChecksumSynchronizer.<SynchronizeSolutionAssetsAsync>d__4.MoveNext()
   --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at Microsoft.CodeAnalysis.Remote.AssetProvider.<SynchronizeSolutionAssetsAsync>d__7.MoveNext()
   --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.<CreateSolution_NoLockAsync>d__10.MoveNext()
   --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
   --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.<GetSolutionAsync>d__12.MoveNext()
   --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at Microsoft.CodeAnalysis.Remote.RemoteCodeLensReferencesService.<>c__DisplayClass3_0.<<GetReferenceCountAsync>b__0>d.MoveNext()
   --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at Microsoft.CodeAnalysis.Remote.BrokeredServiceBase.<RunServiceAsync>d__11`1.MoveNext()
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added Area-Analyzers untriaged Issues and PRs which have not yet been triaged by a lead labels Oct 29, 2020
@sharwell sharwell added Bug Concept-OOP Related to out-of-proc and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Oct 29, 2020
@sharwell sharwell changed the title FileNotFoundException causes OOP operations to fail FileNotFoundException in MemoryMappedFile.OpenCorecauses OOP operations to fail Oct 29, 2020
@sharwell sharwell changed the title FileNotFoundException in MemoryMappedFile.OpenCorecauses OOP operations to fail FileNotFoundException in MemoryMappedFile.OpenCore causes OOP operations to fail Oct 29, 2020
@jinujoseph jinujoseph added this to the 16.9 milestone Nov 4, 2020
@sharwell
Copy link
Member Author

sharwell commented Dec 1, 2020

@tmat this is the keep alive failure which we were originally trying to fix with #45953

@tmat
Copy link
Member

tmat commented Dec 1, 2020

I'll follow up on that later this week.

@jasonmalinowski
Copy link
Member

For whatever reason I'm seeing a spike in this failure in the last few days while dogfooding...

@sharwell
Copy link
Member Author

sharwell commented Dec 2, 2020

The easiest (but ugly) fix is modifying the GetSolution code to simply re-request the assets if this error occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Analyzers Bug Concept-OOP Related to out-of-proc Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants