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

LanguageSettingsPersister.TryFetch assertion is being hit #43393

Closed
davkean opened this issue Apr 16, 2020 · 1 comment · Fixed by #62684
Closed

LanguageSettingsPersister.TryFetch assertion is being hit #43393

davkean opened this issue Apr 16, 2020 · 1 comment · Fixed by #62684
Assignees
Labels
Area-IDE Bug Concept-OOP Related to out-of-proc help wanted The issue is "up for grabs" - add a comment if you are interested in working on it
Milestone

Comments

@davkean
Copy link
Member

davkean commented Apr 16, 2020

Version Used:
16.6.0 Preview 2

Steps to Reproduce:

No repro. This is being hit in our fault telemetry and is new for 16.6.

["Roslyn.Utilities.Contract.Fail(String) Unexpected true
>>>Roslyn.Utilities.Contract.ThrowIfTrue(Boolean)
>>>Microsoft.VisualStudio.LanguageServices.Implementation.Options.LanguageSettingsPersister.TryFetch(OptionKey,Object&)
>>>Microsoft.CodeAnalysis.Options.GlobalOptionService.LoadOptionFromSerializerOrGetDefault(OptionKey)
>>>Microsoft.CodeAnalysis.Options.GlobalOptionService.GetOption_NoLock(OptionKey)
>>>Microsoft.CodeAnalysis.Options.GlobalOptionService.GetSerializableOptionValues(ImmutableHashSet`1,ImmutableHashSet`1)
>>>Microsoft.CodeAnalysis.Options.GlobalOptionService.GetSerializableOptionsSnapshot(ImmutableHashSet`1,IOptionService)
>>>Microsoft.CodeAnalysis.Options.OptionServiceFactory.OptionService.GetSerializableOptionsSnapshot(ImmutableHashSet`1)
>>>Microsoft.CodeAnalysis.Options.SerializableOptionSet.WithLanguages(ImmutableHashSet`1)
>>>Microsoft.CodeAnalysis.SolutionState.Branch(SolutionAttributes,IReadOnlyList`1,SerializableOptionSet,ImmutableDictionary`2,ImmutableDictionary`2,ImmutableDictionary`2,ProjectDependencyGraph)
>>>Microsoft.CodeAnalysis.SolutionState.AddProject(ProjectId,ProjectState)
>>>Microsoft.CodeAnalysis.SolutionState.AddProject(ProjectInfo)
>>>Microsoft.CodeAnalysis.Solution.AddProject(ProjectInfo)
>>>Microsoft.CodeAnalysis.Workspace.OnProjectAdded_NoLock(ProjectInfo,Boolean)
>>>Microsoft.CodeAnalysis.Workspace.OnProjectAdded(ProjectInfo,Boolean)
>>>Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioProjectFactory.<>c__DisplayClass5_0.<CreateAndAddToWorkspace>b__0(Workspace)
>>>Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioWorkspaceImpl.ApplyChangeToWorkspace(Action`1)
>>>Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioProjectFactory.CreateAndAddToWorkspace(String,String,VisualStudioProjectCreationInfo)
>>>Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.CPS.CPSProjectFactory.CreateVisualStudioProject(String,String,String,IVsHierarchy,Guid)
>>>Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.CPS.CPSProjectFactory.Microsoft.VisualStudio.LanguageServices.ProjectSystem.IWorkspaceProjectContextFactory.CreateProjectContext(String,String,String,Guid,Object,String)
>>>Microsoft.VisualStudio.ProjectSystem.LanguageServices.WorkspaceProjectContextProvider.<CreateProjectContextHandlingFaultAsync>d__8.MoveNext()
>>>System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
>>>Microsoft.VisualStudio.ProjectSystem.CommonProjectSystemTools.Rethrow(Exception)
>>>Microsoft.VisualStudio.ProjectSystem.ProjectErrorReporting.<>c__DisplayClass6_0.<SubmitErrorReport>b__0()
>>>Microsoft.VisualStudio.ProjectSystem.ExceptionFilter.<>c__DisplayClass2_0.<Guard>g__action|0()
>>>GuardMethodClass.GuardMethod(Func`1,Func`2,Func`2)"]
@jinujoseph jinujoseph added Area-IDE Bug Concept-OOP Related to out-of-proc labels Apr 22, 2020
@jinujoseph jinujoseph modified the milestones: 16.6, 16.7 Apr 22, 2020
@mavasani mavasani assigned mavasani and unassigned tmat Apr 22, 2020
@jinujoseph jinujoseph modified the milestones: 16.7, 16.8.P2 Jul 26, 2020
@jinujoseph jinujoseph modified the milestones: 16.8.P2, 16.8 Sep 3, 2020
@mavasani mavasani added the help wanted The issue is "up for grabs" - add a comment if you are interested in working on it label Sep 25, 2020
@mavasani mavasani modified the milestones: 16.8, Backlog Sep 25, 2020
@tmat
Copy link
Member

tmat commented Jul 15, 2021

This is not just debug assertion, it's causing gold bar:

image

=====================
7/15/2021 11:50:41 AM
LimitedFunctionality
System.InvalidOperationException: Unexpected true - line 232
   at Roslyn.Utilities.Contract.Fail(String message, Int32 lineNumber)
   at Roslyn.Utilities.Contract.ThrowIfTrue(Boolean condition, Int32 lineNumber)
   at Microsoft.VisualStudio.LanguageServices.Implementation.Options.LanguageSettingsPersister.TryFetch(OptionKey optionKey, Object& value)
   at Microsoft.CodeAnalysis.Options.GlobalOptionService.LoadOptionFromSerializerOrGetDefault(OptionKey optionKey)
   at Microsoft.CodeAnalysis.Options.GlobalOptionService.GetOption_NoLock(OptionKey optionKey)
   at Microsoft.CodeAnalysis.Options.GlobalOptionService.GetSerializableOptionValues(ImmutableHashSet`1 optionKeys, ImmutableHashSet`1 languages)
   at Microsoft.CodeAnalysis.Options.GlobalOptionService.GetSerializableOptionsSnapshot(ImmutableHashSet`1 languages, IOptionService optionService)
   at Microsoft.CodeAnalysis.Workspace.CreateSolution(SolutionInfo solutionInfo)
   at Microsoft.CodeAnalysis.Workspace.OnSolutionAdded(SolutionInfo solutionInfo)
   at Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioProjectFactory.<>c__DisplayClass9_0.<CreateAndAddToWorkspaceAsync>b__0(Workspace w)
   at Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioWorkspaceImpl.ApplyChangeToWorkspace(Action`1 action)
   at Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.VisualStudioProjectFactory.<CreateAndAddToWorkspaceAsync>d__9.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.VisualStudio.LanguageServices.Implementation.ProjectSystem.CPS.CPSProjectFactory.<CreateProjectContextAsync>d__8.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.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread()
   at Microsoft.VisualStudio.Threading.JoinableTask`1.CompleteOnCurrentThread()
   at Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.CPS.CPSProjectFactory.Microsoft.VisualStudio.LanguageServices.ProjectSystem.IWorkspaceProjectContextFactory.CreateProjectContext(String languageName, String projectUniqueName, String projectFilePath, Guid projectGuid, Object hierarchy, String binOutputPath, String assemblyName)
   at Microsoft.VisualStudio.ProjectSystem.LanguageServices.WorkspaceProjectContextProvider.<CreateProjectContextHandlingFaultAsync>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.VisualStudio.ProjectSystem.CommonProjectSystemTools.Rethrow(Exception ex)
   at Microsoft.VisualStudio.ProjectSystem.ExceptionFilter.<>c__DisplayClass2_0.<Guard>g__Action|0()
   at GuardMethodClass.GuardMethod(Func`1 , Func`2 , Func`2 )
===================

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Bug Concept-OOP Related to out-of-proc help wanted The issue is "up for grabs" - add a comment if you are interested in working on it
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants