Skip to content

JIT: REX.W prefix jmp [abs32] form used for tailcalls - #136845

Open
jakobbotsch wants to merge 2 commits into
dotnet:mainfrom
jakobbotsch:fix-129071
Open

jakobbotsch wants to merge 2 commits into
dotnet:mainfrom
jakobbotsch:fix-129071

Conversation

@jakobbotsch

@jakobbotsch jakobbotsch commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Like other instructions emitted in the epilog this one must be rex.w prefixed for the unwinder to recognize it as being part of an epilog.

Fix #129071

I did have Copilot validate based on the instructions in #129071 (comment), and it did see corruptions with the baseline JIT but not with the fixed JIT. No test added since it is very difficult to force the JIT to emit this form of epilog jump.

Like other instructions emitted in the epilog this one must be rex.w
prefixed for the unwinder to recognize it as being part of an epilog.

Also avoid using APX registers for the target register; encoding those
will require prefixes that also are not recognized by the unwinder.

Fix dotnet#129071
@github-actions github-actions Bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Nov 2, 2026
@azure-pipelines

azure-pipelines Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 5 pipeline(s).
10 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

@jkotas

jkotas commented Nov 2, 2026

Copy link
Copy Markdown
Member

APX registers

APX will require UnwindInfo v3. UnwindInfo v3 does not disassemble the epilogs, and thus it does not have restrictions around instructions encodings.

@jakobbotsch

Copy link
Copy Markdown
Member Author

APX registers

APX will require UnwindInfo v3. UnwindInfo v3 does not disassemble the epilogs, and thus it does not have restrictions around instructions encodings.

Good point! Undid that.

@jakobbotsch

Copy link
Copy Markdown
Member Author

cc @dotnet/jit-contrib PTAL @adamperlin

No diffs

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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.

ExecutionEngineException fail-fast in GC thread-suspension / return-address hijack (invalid tailcall epilog)

2 participants