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

Fix infinite loop in genCreateAddrMode #106732

Merged
merged 1 commit into from
Aug 21, 2024

Conversation

EgorBo
Copy link
Member

@EgorBo EgorBo commented Aug 20, 2024

Fixes #106607

Not sure when exactly this regression was introduced (reproduces on net8 and net7 according to the author, however, this code has not been touched for many years). I wasn't able to create the needed shape in C# (mainly, because Roslyn does constant folding + fixes overshifts even for Debug) so I did it in raw IL.

I presume the culprit in the customer's case is IL obfuscator.

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Aug 20, 2024
@EgorBo EgorBo marked this pull request as ready for review August 21, 2024 08:29
@EgorBo
Copy link
Member Author

EgorBo commented Aug 21, 2024

@AndyAyersMS @jakobbotsch PTAL, the previous shape used to cause an infinite loop (since it was a goto AGAIN without changing anything), it looks like it was introduced long time ago

There is a similiar goto AGAIN for op1 and that one is correctly moved under similar branch.

No diffs.

@EgorBo
Copy link
Member Author

EgorBo commented Aug 21, 2024

Not sure whether we should backport this to .NET 8.0 since it's likely IL Obuscation specific

Copy link
Member

@AndyAyersMS AndyAyersMS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it got introduced by #68851 (.NET 7).

I think we should go ahead and backport this.

@EgorBo
Copy link
Member Author

EgorBo commented Aug 21, 2024

Looks like it got introduced by #68851 (.NET 7).

Ah, indeed

@EgorBo EgorBo merged commit 1efd374 into dotnet:main Aug 21, 2024
114 checks passed
@EgorBo
Copy link
Member Author

EgorBo commented Aug 21, 2024

/backport to release/9.0

Copy link
Contributor

Started backporting to release/9.0: https://github.com/dotnet/runtime/actions/runs/10494333737

@EgorBo
Copy link
Member Author

EgorBo commented Aug 21, 2024

/backport to release/8.0-staging

Copy link
Contributor

Started backporting to release/8.0-staging: https://github.com/dotnet/runtime/actions/runs/10494338605

@EgorBo EgorBo deleted the fix-addr-mode-infinite-loop branch August 21, 2024 17:20
@JulieLeeMSFT JulieLeeMSFT added this to the 10.0.0 milestone Aug 22, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Sep 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Infinite loop inside CodeGen::genCreateAddrMode while JIT optimizing
4 participants