Closed mavasani closed 7 years ago
This was hit by another MVP when just attempting to open a net core app. Dump shared at <%MLANG_INTERNAL_SHARE%>\public\mavasani\MVP_SteveSmith\devenv.dmp
Both cases seems like property page was open for the project when the solution was earlier closed, and VS is hanging when attempting to activate the property page on re-opening.
Tagging @srivatsn @lifengl as 2 MVPs have hit this already. Does this look like a CPS issue?
Tagging @ardalis who provided the second dump.
I see the following on a background thread in Steve's dump:
[Managed to Native Transition]
Microsoft.VisualStudio.Shell.15.0.dll!Microsoft.VisualStudio.Shell.ServiceProvider.QueryService(System.Guid guid, System.Type serviceType, bool setShellErrorInfo, out object service) Unknown
Microsoft.VisualStudio.Shell.15.0.dll!Microsoft.VisualStudio.Shell.ServiceProvider.GetService(System.Type serviceType, bool setShellErrorInfo) Unknown
Microsoft.VisualStudio.Shell.15.0.dll!Microsoft.VisualStudio.Shell.ServiceProvider.GetService(System.Type serviceType) Unknown
Microsoft.VisualStudio.Shell.15.0.dll!Microsoft.VisualStudio.Shell.VsServiceProviderWrapper.GetService(System.Type serviceType) Unknown
> Microsoft.VisualStudio.LanguageServices.dll!Microsoft.VisualStudio.LanguageServices.Implementation.SaveEventsService.SaveEventsService(Microsoft.VisualStudio.Editor.IVsEditorAdaptersFactoryService editorAdaptersFactoryService, Microsoft.CodeAnalysis.Editor.ICommandHandlerServiceFactory commandHandlerServiceFactory, Microsoft.VisualStudio.Shell.SVsServiceProvider serviceProvider) Unknown
[Native to Managed Transition]
[Managed to Native Transition]
Microsoft.VisualStudio.Composition.dll!Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.CreateValue() Line 499 C#
Microsoft.VisualStudio.Composition.dll!Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.Create() Line 1158 C#
Microsoft.VisualStudio.Composition.dll!Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleState nextState) Line 1253 C#
Microsoft.VisualStudio.Composition.dll!Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose() Line 1056 C#
Microsoft.VisualStudio.Composition.dll!Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetExportedValueHelper.AnonymousMethod__0() Line 317 C#
Microsoft.VisualStudio.Composition.dll!Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportElement(Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker importingPartTracker, Microsoft.VisualStudio.Composition.RuntimeComposition.RuntimeImport import, Microsoft.VisualStudio.Composition.RuntimeComposition.RuntimeExport export, System.Func<System.Func<object>, object, object> lazyFactory) Line 229 C#
Microsoft.VisualStudio.Composition.dll!Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportSite(Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker importingPartTracker, Microsoft.VisualStudio.Composition.RuntimeComposition.RuntimeImport import) Line 198 C#
Microsoft.VisualStudio.Composition.dll!Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.CreateValue.AnonymousMethod__10_0(Microsoft.VisualStudio.Composition.RuntimeComposition.RuntimeImport import) Line 497 C#
System.Core.dll!System.Linq.Enumerable.WhereSelectArrayIterator<System.__Canon, System.__Canon>.MoveNext() Unknown
System.Core.dll!System.Linq.Buffer<object>.Buffer(System.Collections.Generic.IEnumerable<object> source) Unknown
System.Core.dll!System.Linq.Enumerable.ToArray<object>(System.Collections.Generic.IEnumerable<object> source) Unknown
Microsoft.VisualStudio.Composition.dll!Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.CreateValue() Line 496 C#
Microsoft.VisualStudio.Composition.dll!Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.Create() Line 1158 C#
Microsoft.VisualStudio.Composition.dll!Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleState nextState) Line 1253 C#
Microsoft.VisualStudio.Composition.dll!Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose() Line 1056 C#
Microsoft.VisualStudio.Composition.dll!Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetExportedValueHelper.AnonymousMethod__0() Line 317 C#
Microsoft.VisualStudio.Composition.dll!Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportElement(Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker importingPartTracker, Microsoft.VisualStudio.Composition.RuntimeComposition.RuntimeImport import, Microsoft.VisualStudio.Composition.RuntimeComposition.RuntimeExport export, System.Func<System.Func<object>, object, object> lazyFactory) Line 229 C#
Microsoft.VisualStudio.Composition.dll!Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetValueForImportSite(Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker importingPartTracker, Microsoft.VisualStudio.Composition.RuntimeComposition.RuntimeImport import) Line 198 C#
Microsoft.VisualStudio.Composition.dll!Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.CreateValue.AnonymousMethod__10_0(Microsoft.VisualStudio.Composition.RuntimeComposition.RuntimeImport import) Line 497 C#
System.Core.dll!System.Linq.Enumerable.WhereSelectArrayIterator<System.__Canon, System.__Canon>.MoveNext() Unknown
System.Core.dll!System.Linq.Buffer<object>.Buffer(System.Collections.Generic.IEnumerable<object> source) Unknown
System.Core.dll!System.Linq.Enumerable.ToArray<object>(System.Collections.Generic.IEnumerable<object> source) Unknown
Microsoft.VisualStudio.Composition.dll!Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.RuntimePartLifecycleTracker.CreateValue() Line 496 C#
Microsoft.VisualStudio.Composition.dll!Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.Create() Line 1158 C#
Microsoft.VisualStudio.Composition.dll!Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.MoveNext(Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleState nextState) Line 1253 C#
Microsoft.VisualStudio.Composition.dll!Microsoft.VisualStudio.Composition.ExportProvider.PartLifecycleTracker.GetValueReadyToExpose() Line 1056 C#
Microsoft.VisualStudio.Composition.dll!Microsoft.VisualStudio.Composition.RuntimeExportProviderFactory.RuntimeExportProvider.GetExportedValueHelper.AnonymousMethod__0() Line 317 C#
Microsoft.VisualStudio.Composition.dll!Microsoft.VisualStudio.Composition.DelegateServices.As.AnonymousMethod__0() Line 62 C#
mscorlib.dll!System.Lazy<Microsoft.VisualStudio.ProjectSystem.Properties.IProjectPropertiesProvider>.CreateValue() Unknown
mscorlib.dll!System.Lazy<Microsoft.VisualStudio.ProjectSystem.Properties.IProjectPropertiesProvider>.LazyInitValue() Unknown
mscorlib.dll!System.Lazy<Microsoft.VisualStudio.ProjectSystem.Properties.IProjectPropertiesProvider>.Value.get() Unknown
Microsoft.VisualStudio.ProjectSystem.Implementation.dll!Microsoft.VisualStudio.ProjectSystem.PropertyPages.PageRule.GetProjectPropertiesProvider(Microsoft.Build.Framework.XamlTypes.DataSource dataSource, bool noThrow) Unknown
Microsoft.VisualStudio.ProjectSystem.Implementation.dll!Microsoft.VisualStudio.ProjectSystem.PropertyPages.PageRule.GetDataSourceConnector(Microsoft.Build.Framework.XamlTypes.DataSource dataSource, out bool pretranslatedPersistedName, out string defaultProjectPath) Unknown
Microsoft.VisualStudio.ProjectSystem.Implementation.dll!Microsoft.VisualStudio.ProjectSystem.PropertyPages.PageProperty.ResolveDataSourceConnector() Unknown
mscorlib.dll!System.Lazy<Microsoft.VisualStudio.ProjectSystem.Properties.IProjectProperties>.CreateValue() Unknown
mscorlib.dll!System.Lazy<Microsoft.VisualStudio.ProjectSystem.Properties.IProjectProperties>.LazyInitValue() Unknown
mscorlib.dll!System.Lazy<Microsoft.VisualStudio.ProjectSystem.Properties.IProjectProperties>.Value.get() Unknown
Microsoft.VisualStudio.ProjectSystem.Implementation.dll!Microsoft.VisualStudio.ProjectSystem.PropertyPages.PageProperty.GetEvaluatedValueFromDataSourceAsync() Unknown
mscorlib.dll!System.Runtime.CompilerServices.AsyncTaskMethodBuilder<System.__Canon>.Start<Microsoft.VisualStudio.ProjectSystem.PropertyPages.PageProperty.<GetEvaluatedValueFromDataSourceAsync>d__35>(ref Microsoft.VisualStudio.ProjectSystem.PropertyPages.PageProperty.<GetEvaluatedValueFromDataSourceAsync>d__35 stateMachine) Unknown
Microsoft.VisualStudio.ProjectSystem.Implementation.dll!Microsoft.VisualStudio.ProjectSystem.PropertyPages.PageProperty.GetEvaluatedValueFromDataSourceAsync() Unknown
Microsoft.VisualStudio.ProjectSystem.Implementation.dll!Microsoft.VisualStudio.ProjectSystem.PropertyPages.PageProperty.GetEvaluatedValueAsync() Unknown
Microsoft.VisualStudio.ProjectSystem.VS.Implementation.dll!Microsoft.VisualStudio.ProjectSystem.VS.Implementation.PropertyPages.DynamicType.CreateDynamicPropertyAsync(Microsoft.VisualStudio.ProjectSystem.Properties.IPropertyPageUIWindow hostWindow, System.IServiceProvider pageServiceProvider, Microsoft.VisualStudio.ProjectSystem.Properties.IRule rule, string categoryName, bool useUnevaluatedValue, Microsoft.VisualStudio.ProjectSystem.Properties.IPropertyPageUIFactoryService propertyPagesFactoryService, bool allPropertiesAreReadOnly, Microsoft.VisualStudio.ProjectSystem.Properties.IPropertyGroup group, Microsoft.VisualStudio.ProjectSystem.Properties.IProperty ruleProperty) Line 388 C#
Microsoft.VisualStudio.ProjectSystem.VS.Implementation.dll!Microsoft.VisualStudio.ProjectSystem.VS.Implementation.PropertyPages.DynamicType.CreateDynamicTypeFromRuleAsync(Microsoft.VisualStudio.ProjectSystem.Properties.IVsBrowseObjectContext context, Microsoft.VisualStudio.ProjectSystem.Properties.IPropertyPageUIWindow hostWindow, System.IServiceProvider pageServiceProvider, Microsoft.VisualStudio.ProjectSystem.Properties.IRule rule, string categoryName, bool useUnevaluatedValue) Line 352 C#
[Resuming Async Method]
mscorlib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.InvokeMoveNext(object stateMachine) Unknown
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Unknown
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Unknown
mscorlib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run() Unknown
Microsoft.VisualStudio.ProjectSystem.Implementation.dll!Microsoft.VisualStudio.ProjectSystem.ProjectLockService.Microsoft.VisualStudio.ProjectSystem.IProjectLockReleaser.OnCompleted.AnonymousMethod__1() Unknown
Microsoft.VisualStudio.Threading.dll!Microsoft.VisualStudio.Threading.AsyncReaderWriterLock.Awaiter.TryScheduleContinuationExecution.AnonymousMethod__40_0(object state) Unknown
Microsoft.VisualStudio.Threading.dll!Microsoft.VisualStudio.Threading.AsyncReaderWriterLock.NonConcurrentSynchronizationContext.PostHelper(System.Threading.SendOrPostCallback d, object state) Unknown
mscorlib.dll!System.Runtime.CompilerServices.AsyncVoidMethodBuilder.Start<Microsoft.VisualStudio.Threading.AsyncReaderWriterLock.NonConcurrentSynchronizationContext.<PostHelper>d__9>(ref Microsoft.VisualStudio.Threading.AsyncReaderWriterLock.NonConcurrentSynchronizationContext.<PostHelper>d__9 stateMachine) Unknown
Microsoft.VisualStudio.Threading.dll!Microsoft.VisualStudio.Threading.AsyncReaderWriterLock.NonConcurrentSynchronizationContext.PostHelper(System.Threading.SendOrPostCallback d, object state) Unknown
Microsoft.VisualStudio.Threading.dll!Microsoft.VisualStudio.Threading.AsyncReaderWriterLock.NonConcurrentSynchronizationContext.Post.AnonymousMethod__5_0(object s) Unknown
mscorlib.dll!System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(object state) Unknown
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Unknown
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Unknown
mscorlib.dll!System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() Unknown
mscorlib.dll!System.Threading.ThreadPoolWorkQueue.Dispatch() Unknown
mscorlib.dll!System.Threading._ThreadPoolWaitCallback.PerformWaitCallback() Unknown
[Native to Managed Transition]
[Async Call]
Microsoft.VisualStudio.ProjectSystem.VS.Implementation.dll!Microsoft.VisualStudio.ProjectSystem.VS.Implementation.PropertyPages.DynamicTypeBrowseObjectBase..ctor.AnonymousMethod__1() Line 109 C#
[Async Call]
Microsoft.VisualStudio.Threading.dll!Microsoft.VisualStudio.Threading.AsyncLazy<Microsoft.VisualStudio.ProjectSystem.VS.Implementation.PropertyPages.DynamicType>.GetValueAsync.AnonymousMethod__0() Unknown
[Async Call]
Microsoft.VisualStudio.Threading.dll!Microsoft.VisualStudio.Threading.JoinableTask.JoinAsync(System.Threading.CancellationToken cancellationToken) Unknown
Microsoft.VisualStudio.ProjectSystem.VS.Implementation.dll!Microsoft.VisualStudio.ProjectSystem.VS.Implementation.PropertyPages.DynamicTypeBrowseObjectBase.get_InnerDynamicType.AnonymousMethod__23_0() Line 223 C#
[Async Call]
Microsoft.VisualStudio.Threading.dll!Microsoft.VisualStudio.Threading.JoinableTask<Microsoft.VisualStudio.ProjectSystem.VS.Implementation.PropertyPages.DynamicType>.JoinAsync(System.Threading.CancellationToken cancellationToken) Unknown
Seems like SaveEventsService in Roslyn is trying to invoke GetService from a background thread. Microsoft.VisualStudio.Threading.dll!Microsoft.VisualStudio.Threading.AsyncLazy<Microsoft.VisualStudio.ProjectSystem.VS.Implementation.PropertyPages
Also tagging @MarkMichaelis, who provided the first dump and its the same SaveEventsService issues. Even @basoundr hit the same deadlock locally.
This looks like is a Roslyn bug. What dependency do we have that pulls in SaveEventsService?
Ah it's the VisualStudioWorkspace, in particular here: http://index/?leftProject=Microsoft.VisualStudio.ProjectSystem.Managed.VS&leftSymbol=igxdhktgeobn&file=ProjectSystem%5CVS%5CProperties%5CProjectFileOrAssemblyInfoPropertiesProvider.cs&rightSymbol=v2cu93fzlqn5.
What's the expectation here, VisualStudioWorkspace is a MEF component therefore it's supposed to have free-threaded construction.
@jasonmalinowski @Pilchie Are you already tracking this (I could have sworn we've run into this before)?
It appears tackled some of it here: https://github.com/dotnet/roslyn/pull/14354, but looking in current builds there's still some GetService calls on a background thread, I'm moving this over to Roslyn.
This issue was moved to dotnet/roslyn#16642
@davkean: the PR isn't merged yet. :-)
Dump shared at:
<%MLANG_INTERNAL_SHARE%>\public\mavasani\MVP_Dump\devenvProjectSystemHang.dmp
Call stack: