VS crash on build restore #4298

Closed
jainaashish opened this Issue Jan 16, 2017 · 1 comment

Comments

Projects
None yet
4 participants
@jainaashish
Contributor

jainaashish commented Jan 16, 2017

VS hang and crash in below code path while doing build restore for a migrated project (xproj to packageRef) NuGet.SolutionRestoreManager.dll!NuGet.SolutionRestoreManager.SolutionRestoreWorker.Restore(NuGet.PackageManagement.VisualStudio.SolutionRestoreRequest request) Unknown

Call Stack:
Microsoft.VisualStudio.Threading.dll!Microsoft.VisualStudio.Threading.NoMessagePumpSyncContext.Wait(System.IntPtr[] waitHandles, bool waitAll, int millisecondsTimeout) Unknown
mscorlib.dll!System.Threading.SynchronizationContext.InvokeWaitMethodHelper(System.Threading.SynchronizationContext syncContext, System.IntPtr[] waitHandles, bool waitAll, int millisecondsTimeout) Unknown
[Native to Managed Transition]
[External Code]
[Frames below may be incorrect and/or missing, native debugger attempting to walk managed call stack]
[Managed to Native Transition]
mscorlib.dll!System.Threading.Monitor.Wait(object obj, int millisecondsTimeout, bool exitContext) Unknown
mscorlib.dll!System.Threading.Monitor.Wait(object obj, int millisecondsTimeout) Unknown
mscorlib.dll!System.Threading.ManualResetEventSlim.Wait(int millisecondsTimeout, System.Threading.CancellationToken cancellationToken) Unknown
mscorlib.dll!System.Threading.Tasks.Task.SpinThenBlockingWait(int millisecondsTimeout, System.Threading.CancellationToken cancellationToken) Unknown
mscorlib.dll!System.Threading.Tasks.Task.InternalWait(int millisecondsTimeout, System.Threading.CancellationToken cancellationToken) Unknown
mscorlib.dll!System.Threading.Tasks.Task.Wait(int millisecondsTimeout, System.Threading.CancellationToken cancellationToken) Unknown
mscorlib.dll!System.Threading.Tasks.Task.Wait(System.TimeSpan timeout) Unknown
Microsoft.VisualStudio.Threading.dll!Microsoft.VisualStudio.Threading.JoinableTaskFactory.WaitSynchronouslyCore(System.Threading.Tasks.Task task) Unknown
Microsoft.VisualStudio.Threading.dll!Microsoft.VisualStudio.Threading.JoinableTaskFactory.WaitSynchronously(System.Threading.Tasks.Task task) Unknown
Microsoft.VisualStudio.Threading.dll!Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread() Unknown
Microsoft.VisualStudio.Threading.dll!Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread() Unknown
Microsoft.VisualStudio.Threading.dll!Microsoft.VisualStudio.Threading.JoinableTaskFactory.Run(System.Func<System.Threading.Tasks.Task> asyncMethod, Microsoft.VisualStudio.Threading.JoinableTaskCreationOptions creationOptions) Unknown

NuGet.SolutionRestoreManager.dll!NuGet.SolutionRestoreManager.SolutionRestoreWorker.Restore(NuGet.PackageManagement.VisualStudio.SolutionRestoreRequest request) Unknown
NuGet.SolutionRestoreManager.dll!NuGet.SolutionRestoreManager.RestoreManagerPackage.BuildEvents_OnBuildBegin(EnvDTE.vsBuildScope scope, EnvDTE.vsBuildAction Action) Unknown
EnvDTE.dll!EnvDTE._dispBuildEvents_SinkHelper.OnBuildBegin(EnvDTE.vsBuildScope A_1, EnvDTE.vsBuildAction A_2) Unknown

I've the dump file, please ask me.

@emgarten

This comment has been minimized.

Show comment
Hide comment
@emgarten

emgarten Jan 17, 2017

Contributor

Here is what it looks like is happening from the dump file:

  • A manual restore before build event is started. SolutionRestoreWorker is holding the UI thread , this is using a JTF with a context for CPS not the standard JTF
  • At the same time the project is changed and a nomination occurs from a background thread. VSSolutionManager.IsSolutionFullyLoaded is called which needs the UI thread.

It is unclear if the manual restore is actually waiting for the background thread, or if the project system is waiting for the nomination to complete and the manual build event is waiting for the project system.

Contributor

emgarten commented Jan 17, 2017

Here is what it looks like is happening from the dump file:

  • A manual restore before build event is started. SolutionRestoreWorker is holding the UI thread , this is using a JTF with a context for CPS not the standard JTF
  • At the same time the project is changed and a nomination occurs from a background thread. VSSolutionManager.IsSolutionFullyLoaded is called which needs the UI thread.

It is unclear if the manual restore is actually waiting for the background thread, or if the project system is waiting for the nomination to complete and the manual build event is waiting for the project system.

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