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

Handle possible null symbols in getAttributeTarget #62137

Merged
merged 2 commits into from
Jun 30, 2022

Conversation

jcouv
Copy link
Member

@jcouv jcouv commented Jun 24, 2022

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1556927

I've only been able to repro/crash two of the branches, but added defensive checks for all the branches.

@jcouv jcouv marked this pull request as ready for review June 26, 2022 21:18
@jcouv jcouv requested a review from a team as a code owner June 26, 2022 21:18
@jcouv
Copy link
Member Author

jcouv commented Jun 27, 2022

@dotnet/roslyn-compiler for review. Thanks

@jcouv
Copy link
Member Author

jcouv commented Jun 28, 2022

@dotnet/roslyn-compiler for second review. Thanks

@RikkiGibson RikkiGibson self-assigned this Jun 29, 2022
@jcouv
Copy link
Member Author

jcouv commented Jun 30, 2022

/azp run

@jcouv jcouv enabled auto-merge (squash) June 30, 2022 00:46
@azure-pipelines
Copy link

Azure Pipelines successfully started running 4 pipeline(s).

@jcouv jcouv merged commit 58d8ea0 into dotnet:main Jun 30, 2022
@ghost ghost added this to the Next milestone Jun 30, 2022
333fred added a commit that referenced this pull request Jul 5, 2022
…ures/semi-auto-props

* upstream/main: (887 commits)
  Ensure elastic trivia for reusable syntax in field generator (#62346)
  Fix typos in the incremental generators doc (#62343)
  Theme The "Generate Overrides" Dialog (#62244)
  Walk green-nodes in incremental-generator attribute-finding path (#62295)
  Cache the hash in compilation options (#62289)
  Respect dotnet_style_namespace_match_folder (#62310)
  Remove unreachable condition
  Specify builder capacities in incremental generation to avoid wasted scratch arrays. (#62285)
  Skip the test (#62287)
  Revert "Revert "Add Move Static Member To Existing Type (#61519)"" (#62284)
  Highlight the search term in the options page (#61301)
  Synch handlers with fix (#62209)
  Disable integration tests
  Fix
  Set capacity of builder to avoid expensive garbage.
  Add public APIs for opened and closed event handling for non-source documents
  Handle possible null symbols in `getAttributeTarget` (#62137)
  Perform a lookahead rather than a parsing attempt in order to determine if current token starts a conversion operator declaration. (#62240)
  Fix a race in CachingDictionary. (#62248)
  Simplify
  ...
@allisonchou allisonchou modified the milestones: Next, 17.4 P1 Jul 26, 2022
@NXTwoThou
Copy link

Looks like this has reverted for v17.6.1. Just got this error(following over from #63567)

StreamJsonRpc.RemoteInvocationException: SyntaxTree is not part of the compilation (Parameter 'syntaxTree')
at StreamJsonRpc.JsonRpc.d__1511.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 System.Threading.Tasks.ValueTask1.get_Result()
at Microsoft.CodeAnalysis.Remote.BrokeredServiceConnection1.<TryInvokeAsync>d__201.MoveNext()
RPC server exception:
System.ArgumentException: SyntaxTree is not part of the compilation (Parameter 'syntaxTree')
at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.GetSemanticModel(SyntaxTree syntaxTree, Boolean ignoreAccessibility)
at Microsoft.CodeAnalysis.Document.GetSemanticModelAsync(CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Shared.Extensions.DocumentExtensions.GetRequiredSemanticModelAsync(Document document, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Classification.AbstractEmbeddedLanguageClassificationService.AddEmbeddedLanguageClassificationsAsync(Document document, TextSpan textSpan, ClassificationOptions options, ArrayBuilder1 result, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Classification.AbstractClassificationService.AddClassificationsInCurrentProcessAsync(Document document, TextSpan textSpan, ClassificationType type, ClassificationOptions options, ArrayBuilder1 result, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Remote.RemoteSemanticClassificationService.<>c__DisplayClass20_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.<>c__DisplayClass9_01.<<RunWithSolutionAsync>g__ProcessSolutionAsync|1>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.RunWithSolutionAsync[T](AssetProvider assetProvider, Checksum solutionChecksum, Int32 workspaceVersion, Boolean updatePrimaryBranch, Func2 implementation, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.RunWithSolutionAsync[T](AssetProvider assetProvider, Checksum solutionChecksum, Int32 workspaceVersion, Boolean updatePrimaryBranch, Func2 implementation, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Remote.BrokeredServiceBase.RunWithSolutionAsync[T](Checksum solutionChecksum, Func2 implementation, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Remote.BrokeredServiceBase.RunServiceImplAsync[T](Func`2 implementation, CancellationToken cancellationToken)

@Youssef1313
Copy link
Member

I don't think yours is the same as #63567.

@AlekseyTs
Copy link
Contributor

@NXTwoThou The exception looks different: "System.ArgumentException: SyntaxTree is not part of the compilation (Parameter 'syntaxTree')". This PR was fixing: "System.NullReferenceException: Object reference not set to an instance of an object."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants