dotnet / project-system

The .NET Project System for Visual Studio
MIT License
969 stars 387 forks source link

Project system hang in property pages #1214

Closed mavasani closed 7 years ago

mavasani commented 7 years ago

Dump shared at: <%MLANG_INTERNAL_SHARE%>\public\mavasani\MVP_Dump\devenvProjectSystemHang.dmp

Call stack:

>   ntdll.dll!_ZwWaitForMultipleObjects@20() Line 821   Unknown
    KERNELBASE.dll!76f01ba0()   Unknown
    [Frames below may be incorrect and/or missing, no symbols loaded for KERNELBASE.dll]    
    ntdll.dll!_ZwRaiseException@12() Line 2805  Unknown
    ntdll.dll!_RtlRaiseException@4() Line 167   Unknown
    ntdll.dll!_ZwRaiseException@12() Line 2805  Unknown
    ntdll.dll!_RtlRaiseException@4() Line 167   Unknown
    [Managed to Native Transition]  
    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]  
    mscorlib.ni.dll!71b1a507()  Unknown
    [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<Microsoft.VisualStudio.ProjectSystem.VS.Implementation.PropertyPages.DynamicType>.CompleteOnCurrentThread()  Unknown
    Microsoft.VisualStudio.Threading.dll!Microsoft.VisualStudio.Threading.JoinableTaskFactory.Run<Microsoft.VisualStudio.ProjectSystem.VS.Implementation.PropertyPages.DynamicType>(System.Func<System.Threading.Tasks.Task<Microsoft.VisualStudio.ProjectSystem.VS.Implementation.PropertyPages.DynamicType>> asyncMethod, Microsoft.VisualStudio.Threading.JoinableTaskCreationOptions creationOptions)   Unknown
    Microsoft.VisualStudio.Threading.dll!Microsoft.VisualStudio.Threading.JoinableTaskFactory.Run<Microsoft.VisualStudio.ProjectSystem.VS.Implementation.PropertyPages.DynamicType>(System.Func<System.Threading.Tasks.Task<Microsoft.VisualStudio.ProjectSystem.VS.Implementation.PropertyPages.DynamicType>> asyncMethod) Unknown
    Microsoft.VisualStudio.ProjectSystem.Implementation.dll!Microsoft.VisualStudio.ProjectSystem.ProjectMultiThreadedService.ExecuteSynchronously<Microsoft.VisualStudio.ProjectSystem.VS.Implementation.PropertyPages.DynamicType>(System.Func<System.Threading.Tasks.Task<Microsoft.VisualStudio.ProjectSystem.VS.Implementation.PropertyPages.DynamicType>> asyncAction) Unknown
    Microsoft.VisualStudio.ProjectSystem.VS.Implementation.dll!Microsoft.VisualStudio.ProjectSystem.VS.Implementation.PropertyPages.DynamicTypeBrowseObjectBase.InnerDynamicType.get()  Unknown
    Microsoft.VisualStudio.ProjectSystem.VS.Implementation.dll!Microsoft.VisualStudio.ProjectSystem.VS.Implementation.PropertyPages.DynamicTypeBrowseObjectBase.System.ComponentModel.ICustomTypeDescriptor.GetProperties(System.Attribute[] attributes)    Unknown
    Microsoft.VisualStudio.AppDesigner.dll!Microsoft.VisualStudio.Editors.PropertyPages.PropPageUserControlBase.SetObjects(object[] objects)    Unknown
    Microsoft.VisualStudio.AppDesigner.dll!Microsoft.VisualStudio.Editors.PropertyPages.PropPageUserControlBase.IPropertyPageInternal_SetObjects(object[] objects)  Unknown
    Microsoft.VisualStudio.AppDesigner.dll!Microsoft.VisualStudio.Editors.PropertyPages.PropPageBase.Create(System.IntPtr hWndParent)   Unknown
    Microsoft.VisualStudio.AppDesigner.dll!Microsoft.VisualStudio.Editors.PropertyPages.PropPageBase.IPropertyPage2_Activate(System.IntPtr hWndParent, Microsoft.VisualStudio.OLE.Interop.RECT[] pRect, int bModal) Unknown
    Microsoft.VisualStudio.AppDesigner.dll!Microsoft.VisualStudio.Editors.PropPageDesigner.PropPageDesignerView.ActivatePage(Microsoft.VisualStudio.OLE.Interop.IPropertyPage PropPage) Unknown
    Microsoft.VisualStudio.AppDesigner.dll!Microsoft.VisualStudio.Editors.PropPageDesigner.PropPageDesignerView.Init(EnvDTE.Project DTEProject, Microsoft.VisualStudio.OLE.Interop.IPropertyPage PropPage, Microsoft.VisualStudio.Editors.ApplicationDesigner.PropertyPageSite PropPageSite, Microsoft.VisualStudio.Shell.Interop.IVsHierarchy Hierarchy, bool IsConfigPage)    Unknown
    Microsoft.VisualStudio.AppDesigner.dll!Microsoft.VisualStudio.Editors.ApplicationDesigner.ApplicationDesignerView.ShowTab(int Index, bool ForceShow)    Unknown
    Microsoft.VisualStudio.AppDesigner.dll!Microsoft.VisualStudio.Editors.ApplicationDesigner.ApplicationDesignerView.OnInitializationComplete()    Unknown
    Microsoft.VisualStudio.AppDesigner.dll!Microsoft.VisualStudio.Editors.ApplicationDesigner.ApplicationDesignerWindowPane.PopulateView(System.Guid guidLogicalView)   Unknown
    Microsoft.VisualStudio.AppDesigner.dll!Microsoft.VisualStudio.Editors.ApplicationDesigner.ApplicationDesignerWindowPane.ActivateLogicalView(ref System.Guid rguidLogicalView)   Unknown
    [Native to Managed Transition]  
    msenv.dll!636c490e()    Unknown
    msenv.dll!63482d19()    Unknown
    mscorlib.ni.dll!71aa9ec2()  Unknown
    mscorlib.ni.dll!71a9eab9()  Unknown
    mscorlib.ni.dll!71aa9ec2()  Unknown
    System.Core.ni.dll!6ecc24a0()   Unknown
    mscorlib.ni.dll!71a9de29()  Unknown
    mscorlib.ni.dll!71aa9ec2()  Unknown
    mscorlib.ni.dll!71a9dbeb()  Unknown
    mscorlib.ni.dll!71b65e7a()  Unknown
    msenv.dll!6360570c()    Unknown
    [Managed to Native Transition]  
    Microsoft.VisualStudio.Platform.WindowManagement.dll!Microsoft.VisualStudio.Platform.WindowManagement.SolutionOptions.ReopenDocumentFrame(Microsoft.VisualStudio.Platform.WindowManagement.WindowManagerService windowManager, Microsoft.VisualStudio.Platform.WindowManagement.StubWindowInfo stubInfo, Microsoft.VisualStudio.Platform.WindowManagement.ReopenDocumentOptions options, Microsoft.VisualStudio.PlatformUI.Shell.DocumentGroup docGroup, out int hr)    Unknown
    Microsoft.VisualStudio.Platform.WindowManagement.dll!Microsoft.VisualStudio.Platform.WindowManagement.SolutionOptions.ReopenDocumentFrame(Microsoft.VisualStudio.Platform.WindowManagement.IWindowManagerPrivate windowManager, Microsoft.VisualStudio.Platform.WindowManagement.StubWindowInfo stubInfo, Microsoft.VisualStudio.Platform.WindowManagement.ReopenDocumentOptions options, Microsoft.VisualStudio.PlatformUI.Shell.DocumentGroup docGroup, out int hr)   Unknown
    Microsoft.VisualStudio.Platform.WindowManagement.dll!Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.EnsureStubFrameInitialized(bool show, Microsoft.VisualStudio.Platform.WindowManagement.StubWindowInitializationReason reason) Unknown
    Microsoft.VisualStudio.Platform.WindowManagement.dll!Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.OnContentShowing(Microsoft.VisualStudio.PlatformUI.Shell.View view)   Unknown
    Microsoft.VisualStudio.Platform.WindowManagement.dll!Microsoft.VisualStudio.Platform.WindowManagement.WindowManagerService.OnViewContentShowing(object sender, Microsoft.VisualStudio.PlatformUI.Shell.Controls.ViewEventArgs args) Unknown
    [Native to Managed Transition]  
    mscorlib.ni.dll!71abc591()  Unknown
    [Managed to Native Transition]  
    mscorlib.dll!System.Delegate.DynamicInvokeImpl(object[] args)   Unknown
    PresentationCore.dll!System.Windows.RoutedEventArgs.InvokeEventHandler(System.Delegate genericHandler, object genericTarget)    Unknown
    PresentationCore.dll!System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate handler, object target)   Unknown
    PresentationCore.dll!System.Windows.RoutedEventHandlerInfo.InvokeHandler(object target, System.Windows.RoutedEventArgs routedEventArgs) Unknown
    PresentationCore.dll!System.Windows.EventRoute.InvokeHandlersImpl(object source, System.Windows.RoutedEventArgs args, bool reRaised)    Unknown
    PresentationCore.dll!System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject sender, System.Windows.RoutedEventArgs args)   Unknown
    PresentationCore.dll!System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs e)  Unknown
    Microsoft.VisualStudio.Shell.ViewManager.dll!Microsoft.VisualStudio.PlatformUI.Shell.Controls.ViewPresenter.AsyncRaiseEvent.AnonymousMethod__12_0(object arg)   Unknown
    WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, int numArgs)  Unknown
    WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.TryCatchWhen(object source, System.Delegate callback, object args, int numArgs, System.Delegate catchHandler) Unknown
    WindowsBase.dll!System.Windows.Threading.DispatcherOperation.InvokeImpl()   Unknown
    WindowsBase.dll!System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(object state)  Unknown
    WindowsBase.dll!MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(object obj)   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.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) Unknown
    WindowsBase.dll!MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext executionContext, System.Threading.ContextCallback callback, object state)  Unknown
    WindowsBase.dll!System.Windows.Threading.DispatcherOperation.Invoke()   Unknown
    WindowsBase.dll!System.Windows.Threading.Dispatcher.ProcessQueue()  Unknown
    WindowsBase.dll!System.Windows.Threading.Dispatcher.WndProcHook(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled)  Unknown
    WindowsBase.dll!MS.Win32.HwndWrapper.WndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) Unknown
    WindowsBase.dll!MS.Win32.HwndSubclass.DispatcherCallbackOperation(object o) Unknown
    WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, int numArgs)  Unknown
    WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.TryCatchWhen(object source, System.Delegate callback, object args, int numArgs, System.Delegate catchHandler) Unknown
    WindowsBase.dll!System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority priority, System.TimeSpan timeout, System.Delegate method, object args, int numArgs)   Unknown
    WindowsBase.dll!MS.Win32.HwndSubclass.SubclassWndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam)  Unknown
    [Native to Managed Transition]  
    user32.dll!76b8d2b3()   Unknown
    user32.dll!76b6e88a()   Unknown
    ntdll.dll!_ZwCallbackReturn@12() Line 133   Unknown
    user32.dll!76b7805e()   Unknown
    user32.dll!76b6e1e4()   Unknown
    msenv.dll!634244a7()    Unknown
    msenv.dll!63424162()    Unknown
    msenv.dll!634cc402()    Unknown
    msenv.dll!634cc358()    Unknown
    msenv.dll!634cc29c()    Unknown
    msenv.dll!634cc263()    Unknown
    msenv.dll!634cc1d4()    Unknown
    msenv.dll!63561234()    Unknown
    devenv.exe!util_CallVsMain(MAINPARAM * pMainParam, int * piRes) Line 1088   C++
    devenv.exe!CDevEnvAppId::Run(wchar_t * wszCmdLine, int nCmdShow) Line 848   C++
    devenv.exe!WinMain(HINSTANCE__ * hInstance, HINSTANCE__ * __formal, char * lpCmdLine, int nCmdShow) Line 71 C++
    [Inline Frame] devenv.exe!invoke_main() Line 94 C++
    devenv.exe!__scrt_common_main_seh() Line 259    C++
    kernel32.dll!BaseThreadInitThunk(unsigned long RunProcessInit, long(__stdcall*)(void *) StartAddress, void * Argument) Line 64  C
    ntdll.dll!__RtlUserThreadStart(long(__stdcall*)(void *) StartAddress, void * Argument) Line 997 C
    ntdll.dll!_RtlUserThreadStart(long(__stdcall*)(void *) StartAddress, void * Argument) Line 914  C
mavasani commented 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

mavasani commented 7 years ago

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.

mavasani commented 7 years ago

Tagging @srivatsn @lifengl as 2 MVPs have hit this already. Does this look like a CPS issue?

mavasani commented 7 years ago

Tagging @ardalis who provided the second dump.

mavasani commented 7 years ago

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

mavasani commented 7 years ago

Also tagging @MarkMichaelis, who provided the first dump and its the same SaveEventsService issues. Even @basoundr hit the same deadlock locally.

davkean commented 7 years ago

This looks like is a Roslyn bug. What dependency do we have that pulls in SaveEventsService?

davkean commented 7 years ago

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)?

davkean commented 7 years ago

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.

davkean commented 7 years ago

This issue was moved to dotnet/roslyn#16642

jasonmalinowski commented 7 years ago

@davkean: the PR isn't merged yet. :-)