Daily Usage Issues

NCrunch 3.7 causes VS 2017 to crash if you edit a .NET Core csproj file

Started by b33rdy on 8,243 views

If NCrunch is enabled and you edit a .csproj file for a .NET Core project and save it, VS crashes.

If NCrunch is disabled, this doesn't happen.

Verions affected:
> NCrunch
> v3.7.0.7
> Visual Studio 2017
> v15.1
> v15.2

Those are the only versions I've tested.

Exception details:

Application: devenv.exe
Framework Version: v4.0.30319
Description: The application requested process termination through System.Environment.FailFast(string message).
Message: System.InvalidOperationException: Write lock out-lived by a nested read lock, which is not allowed.
at Microsoft.VisualStudio.Threading.AsyncReaderWriterLock.<DowngradeLockAsync>d__96.MoveNext()
Stack:
at System.Environment.FailFast(System.String, System.Exception)
at Microsoft.VisualStudio.Threading.AsyncReaderWriterLock.OnCriticalFailure(System.Exception)
at Microsoft.VisualStudio.Threading.AsyncReaderWriterLock+<DowngradeLockAsync>d__96.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[Microsoft.VisualStudio.Threading.AsyncReaderWriterLock+<DowngradeLockAsync>d__96, Microsoft.VisualStudio.Threading, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]](<DowngradeLockAsync>d__96 ByRef)
at Microsoft.VisualStudio.Threading.AsyncReaderWriterLock.DowngradeLockAsync(Awaiter, Boolean, Boolean, System.Threading.Tasks.Task)
at Microsoft.VisualStudio.Threading.AsyncReaderWriterLock.ReleaseAsync(Awaiter, Boolean)
at Microsoft.VisualStudio.Threading.AsyncReaderWriterLock+Awaiter.ReleaseAsync(Boolean)
at Microsoft.VisualStudio.Threading.AsyncReaderWriterLock+Releaser.Dispose()
at Microsoft.VisualStudio.ProjectSystem.ProjectLockService.Microsoft.VisualStudio.ProjectSystem.IProjectLockReleaser.OnDispose(Microsoft.VisualStudio.ProjectSystem.ProjectWriteLockReleaser)
at Microsoft.VisualStudio.ProjectSystem.ProjectWriteLockReleaser.Dispose()
at Microsoft.VisualStudio.ProjectSystem.VS.ReloadableProject+<ReloadProjectAsync>d__14.MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.InvokeMoveNext(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run()
at System.Threading.Tasks.AwaitTaskContinuation.InvokeAction(System.Object)
at System.Threading.Tasks.AwaitTaskContinuation.RunCallback(System.Threading.ContextCallback, System.Object, System.Threading.Tasks.Task ByRef)
at System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation.Run(System.Threading.Tasks.Task, Boolean)
at System.Threading.Tasks.Task.FinishContinuations()
at System.Threading.Tasks.Task.FinishStageThree()
at System.Threading.Tasks.Task`1[[System.Threading.Tasks.VoidTaskResult, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].TrySetResult(System.Threading.Tasks.VoidTaskResult)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Threading.Tasks.VoidTaskResult, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].SetResult(System.Threading.Tasks.VoidTaskResult)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Threading.Tasks.VoidTaskResult, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].SetResult(System.Threading.Tasks.Task`1<System.Threading.Tasks.VoidTaskResult>)
at Microsoft.VisualStudio.ProjectSystem.ProjectLockService+<CheckoutFromSourceControlAsync>d__71.MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.InvokeMoveNext(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run()
at System.Threading.Tasks.AwaitTaskContinuation.InvokeAction(System.Object)
at System.Threading.Tasks.AwaitTaskContinuation.RunCallback(System.Threading.ContextCallback, System.Object, System.Threading.Tasks.Task ByRef)
at System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation.Run(System.Threading.Tasks.Task, Boolean)
at System.Threading.Tasks.Task.FinishContinuations()
at System.Threading.Tasks.Task.FinishStageThree()
at System.Threading.Tasks.Task`1[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].TrySetResult(Boolean)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].SetResult(Boolean)
at Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.Components.SourceControlIntegration+<CanChangeProjectFilesAsync>d__18.MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.InvokeMoveNext(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run()
at System.Threading.Tasks.AwaitTaskContinuation.InvokeAction(System.Object)
at System.Threading.Tasks.AwaitTaskContinuation.RunCallback(System.Threading.ContextCallback, System.Object, System.Threading.Tasks.Task ByRef)
at System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation.Run(System.Threading.Tasks.Task, Boolean)
at System.Threading.Tasks.Task.FinishContinuations()
at System.Threading.Tasks.Task.FinishStageThree()
at System.Threading.Tasks.Task`1[[System.Threading.Tasks.VoidTaskResult, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].TrySetResult(System.Threading.Tasks.VoidTaskResult)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Threading.Tasks.VoidTaskResult, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].SetResult(System.Threading.Tasks.VoidTaskResult)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Threading.Tasks.VoidTaskResult, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].SetResult(System.Threading.Tasks.Task`1<System.Threading.Tasks.VoidTaskResult>)
at Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.Components.SourceControlIntegration+<VerifyThrowCheckoutForEditAsync>d__20.MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.InvokeMoveNext(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run()
at System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation+<>c.<.cctor>b__8_0(System.Object)
at Microsoft.VisualStudio.Threading.AsyncReaderWriterLock+NonConcurrentSynchronizationContext+<PostHelper>d__9.MoveNext()
at System.Runtime.CompilerServices.AsyncVoidMethodBuilder.Start[[Microsoft.VisualStudio.Threading.AsyncReaderWriterLock+NonConcurrentSynchronizationContext+<PostHelper>d__9, Microsoft.VisualStudio.Threading, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]](<PostHelper>d__9 ByRef)
at Microsoft.VisualStudio.Threading.AsyncReaderWriterLock+NonConcurrentSynchronizationContext.PostHelper(System.Threading.SendOrPostCallback, System.Object)
at Microsoft.VisualStudio.Threading.AsyncReaderWriterLock+NonConcurrentSynchronizationContext+<>c.<Post>b__5_0(System.Object)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
Hi,

Thanks for sharing this issue. I've managed to reproduce it in the way you've described, it's very consistent.

I hope to have a fix available sometime soon.
Excellent, thanks Remco.
Is there any news on this?
I hope to have a fix out for this in the coming week. Sorry for the time it's taken here, this is a very complex area of the product.
No worries, thanks for the info. I can let my team know too.
Ok, here is a build with the fix!

This build introduces a change to the grid protocol, so if you're running any grid nodes, you'll need to update them.

http://downloads.ncrunch.net/NCrunch_Console_3.8.0.2.msi
http://downloads.ncrunch.net/NCrunch_Console_3.8.0.2.zip
http://downloads.ncrunch.net/NCrunch_GridNodeServer_3.8.0.2.msi
http://downloads.ncrunch.net/NCrunch_GridNodeServer_3.8.0.2.zip
http://downloads.ncrunch.net/NCrunch_LicenseServer_3.8.0.2.zip
http://downloads.ncrunch.net/NCrunch_VS2008_3.8.0.2.msi
http://downloads.ncrunch.net/NCrunch_VS2010_3.8.0.2.msi
http://downloads.ncrunch.net/NCrunch_VS2010_3.8.0.2.zip
http://downloads.ncrunch.net/NCrunch_VS2012_3.8.0.2.msi
http://downloads.ncrunch.net/NCrunch_VS2012_3.8.0.2.zip
http://downloads.ncrunch.net/NCrunch_VS2013_3.8.0.2.msi
http://downloads.ncrunch.net/NCrunch_VS2013_3.8.0.2.zip
http://downloads.ncrunch.net/NCrunch_VS2015_3.8.0.2.msi
http://downloads.ncrunch.net/NCrunch_VS2015_3.8.0.2.zip
http://downloads.ncrunch.net/NCrunch_VS2017_3.8.0.2.msi
http://downloads.ncrunch.net/NCrunch_VS2017_3.8.0.2.zip

Edited

Excellent, thanks Remco!

I can confirm this build fixes the issue.

Remco wrote:Ok, here is a build with the fix!

This build introduces a change to the grid protocol, so if you're running any grid nodes, you'll need to update them.

http://downloads.ncrunch.net/NCrunch_Console_3.8.0.2.msi
http://downloads.ncrunch.net/NCrunch_Console_3.8.0.2.zip
http://downloads.ncrunch.net/NCrunch_GridNodeServer_3.8.0.2.msi
http://downloads.ncrunch.net/NCrunch_GridNodeServer_3.8.0.2.zip
http://downloads.ncrunch.net/NCrunch_LicenseServer_3.8.0.2.zip
http://downloads.ncrunch.net/NCrunch_VS2008_3.8.0.2.msi
http://downloads.ncrunch.net/NCrunch_VS2010_3.8.0.2.msi
http://downloads.ncrunch.net/NCrunch_VS2010_3.8.0.2.zip
http://downloads.ncrunch.net/NCrunch_VS2012_3.8.0.2.msi
http://downloads.ncrunch.net/NCrunch_VS2012_3.8.0.2.zip
http://downloads.ncrunch.net/NCrunch_VS2013_3.8.0.2.msi
http://downloads.ncrunch.net/NCrunch_VS2013_3.8.0.2.zip
http://downloads.ncrunch.net/NCrunch_VS2015_3.8.0.2.msi
http://downloads.ncrunch.net/NCrunch_VS2015_3.8.0.2.zip
http://downloads.ncrunch.net/NCrunch_VS2017_3.8.0.2.msi
http://downloads.ncrunch.net/NCrunch_VS2017_3.8.0.2.zip

Post a reply

Log in to reply.