Repository navigation
[release/11.0] Prevent infinite recursion in ILLink generic dataflow - #134807
Merged
agocke merged 3 commits intoSep 30, 2026
Merged
Conversation
Guard reflection-visible member signature analysis against synchronous reentry and add method and field regression coverage. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 6a56a306-481c-4342-ab61-b10611edd9dc
Follow review feedback by tracking active reflection-visible member signature analysis with a stack and asserting LIFO unwinding. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 6a56a306-481c-4342-ab61-b10611edd9dc
Add a method-to-field-to-method cycle that requires tracking the complete active member chain rather than only direct self-recursion. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 6a56a306-481c-4342-ab61-b10611edd9dc
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @agocke, @dotnet/illink |
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No unresolved blocking issues were identified.
Review effort: Lite
Findings: None
What changed in this PR
Prevents infinite recursion in ILLink generic dataflow for reflection-visible method and field signatures.
Changes:
- Adds recursion guards for active signature analysis.
- Preserves normal marking and annotation processing.
- Adds regression tests for self-referential and mixed cycles.
| File | Description |
|---|---|
src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/GenericParameterDataFlowMarking.cs |
Adds recursion regression coverage. |
src/tools/illink/src/linker/Linker.Steps/MarkStep.cs |
Guards recursive signature dataflow. |
jtschuster
marked this pull request as ready for review
September 28, 2026 17:30
jtschuster
commented
Sep 28, 2026
Member
|
/ba-g Build Analysis hung |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Generic argument dataflow for reflection-visible method and field signatures runs synchronously during marking. A signature such as RequiresPublicMethods can cause dataflow to mark the public members of Self, re-enter the same reflection-visible member, and analyze its signature again indefinitely.
Track reflection-visible members whose signature dataflow is currently in progress a la "visited" set in a DFS. Recursive entry for the same member skips only the duplicate signature analysis; normal marking, dependency recording, and annotation processing still occur.
Customer Impact
Found by ILLink stack overflow for self-referential generic DAM on reflection-visible method #134189
Regression
Testing
Tests that reproduced the issue were added and pass after the fix.
Risk
Low. The fix is small, conceptually simple, and tested. This is unlikely to