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

CodeLens references unhandled exception #51633

Closed
kiminuo opened this issue Mar 3, 2021 · 5 comments · Fixed by #51686
Closed

CodeLens references unhandled exception #51633

kiminuo opened this issue Mar 3, 2021 · 5 comments · Fixed by #51686
Assignees
Labels
4 - In Review A fix for the issue is submitted for review. Area-IDE Bug
Milestone

Comments

@kiminuo
Copy link

kiminuo commented Mar 3, 2021

Version Used: Version 16.10.0 Preview 1.0 (but I believe it is the same in 16.9 which was released yesterday).

Steps to Reproduce:

  1. Clone pakrym/jab@3b5eaef
  2. Open the project solution
  3. Open jab\src\samples\ConsoleSample\Program.cs file
  4. You should see an exception:

image

Expected Behavior:

No exception.

Actual Behavior:

Exception.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Mar 3, 2021
@chyyran
Copy link

chyyran commented Mar 4, 2021

+1, also reproduceable on 16.9 with chyyran/Snowflake@baae6b, occurs when you open the file Snowflake.Framework.Tests.Configuration/ExampleConfigurationCollection.cs.

It seems generated source code is somewhat involved. ExampleConfigurationCollection invokes a source generator, but if you comment out AddSource, the problem magically disappears. I have ruled out any bugs in my diagnostic analyzers and the source generation code itself. The generated source code is well formed as well. It also happens regardless of EmitCompilerGeneratedFiles.

@numanicloud
Copy link

I have same problem, with Visual Studio 16.9.

@Youssef1313
Copy link
Member

Thanks for reporting and for the clear repro steps. Working on this in #51686.

@Youssef1313
Copy link
Member

Youssef1313 commented Mar 5, 2021

Hmm. Looks like find usages is broken as well:

StreamJsonRpc.RemoteInvocationException: Specified argument was out of the range of valid values.
Parameter name: start
   at StreamJsonRpc.JsonRpc.<InvokeCoreAsync>d__139`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Microsoft.CodeAnalysis.Remote.BrokeredServiceConnection`1.<TryInvokeAsync>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
RPC server exception:
StreamJsonRpc.RemoteInvocationException: Specified argument was out of the range of valid values.
Parameter name: start
      at StreamJsonRpc.JsonRpc.<InvokeCoreAsync>d__139`1.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.CodeAnalysis.Remote.RemoteCallback`1.<InvokeAsync>d__2.MoveNext()
   --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
   --- 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.CodeAnalysis.Editor.FindUsages.AbstractFindUsagesService.FindReferencesProgressAdapter.<OnReferenceFoundAsync>d__14.MoveNext()
   --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.<ProcessDocumentAsync>d__14.MoveNext()
   --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.<ProcessDocumentAsync>d__14.MoveNext()
   --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.<ProcessDocumentQueueAsync>d__12.MoveNext()
   --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.<ProcessDocumentQueueAsync>d__12.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.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.<ProcessProjectAsync>d__24.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.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.<ProcessAsync>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.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.<FindReferencesAsync>d__8.MoveNext()
   --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.<FindReferencesAsync>d__8.MoveNext()
   --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at Microsoft.CodeAnalysis.FindSymbols.FindReferencesSearchEngine.<FindReferencesAsync>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.CodeAnalysis.FindSymbols.SymbolFinder.<FindReferencesAsync>d__34.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.CodeAnalysis.Editor.FindUsages.AbstractFindUsagesService.<FindReferencesAsync>d__15.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.CodeAnalysis.Remote.RemoteFindUsagesService.<>c__DisplayClass3_0.<<FindReferencesAsync>b__0>d.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.CodeAnalysis.Remote.BrokeredServiceBase.<RunServiceImplAsync>d__14.MoveNext()

I wasn't able to reproduce this again, will give FAR failure a look separately.

@jinujoseph jinujoseph added 4 - In Review A fix for the issue is submitted for review. Bug and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Mar 5, 2021
@jinujoseph jinujoseph added this to the 16.10 milestone Mar 5, 2021
@lskyum
Copy link

lskyum commented Apr 22, 2021

I'm having this exact issue where a Source Generator is also involved. (Visual Studio version 16.9.4)
Have just disabled Code lens for now, but hoping it will be fixed soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 - In Review A fix for the issue is submitted for review. Area-IDE Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants