Skip to content

Fix infinite loop in genCreateAddrMode#106732

Merged
EgorBo merged 1 commit intodotnet:mainfrom
EgorBo:fix-addr-mode-infinite-loop
Aug 21, 2024
Merged

Fix infinite loop in genCreateAddrMode#106732
EgorBo merged 1 commit intodotnet:mainfrom
EgorBo:fix-addr-mode-infinite-loop

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.

@ghost ghost 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
@EgorBo
Copy link
Member Author

EgorBo commented Aug 21, 2024

/backport to release/9.0

@github-actions
Copy link
Contributor

@EgorBo
Copy link
Member Author

EgorBo commented Aug 21, 2024

/backport to release/8.0-staging

@github-actions
Copy link
Contributor

@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