Skip to content

JIT: Ensure proper alignment of async resumption data section#121790

Merged
jakobbotsch merged 1 commit intodotnet:mainfrom
jakobbotsch:fix-resume-info-alignment
Nov 24, 2025
Merged

JIT: Ensure proper alignment of async resumption data section#121790
jakobbotsch merged 1 commit intodotnet:mainfrom
jakobbotsch:fix-resume-info-alignment

Conversation

@jakobbotsch
Copy link
Member

@jakobbotsch jakobbotsch commented Nov 19, 2025

We did not properly ensure the alignment of the async resumption data blob, only the overall alignment of the entire data section.

Unify the code that inserts padding and use it for the async resumption data too.

The alignment was also missing for basic block address sections, but we did not have a problem here because we do not use absolute basic block addresses for 64-bit targets. Still, add the code to ensure this would get aligned correctly.

Fix #121779

We did not properly ensure the alignment of the async resumption data
section, only the overall alignment of the data section.

Unify the code that inserts padding and use it for the async resumption
data too.

The alignment was also missing for basic block address sections, but we
did not have a problem here because we do not use absolute basic block
addresses for 64-bit targets.
@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 19, 2025
@jakobbotsch jakobbotsch marked this pull request as ready for review November 20, 2025 11:22
Copilot AI review requested due to automatic review settings November 20, 2025 11:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an alignment issue in the JIT emitter by ensuring the async resumption data section is properly aligned. The fix refactors the alignment logic into a new dedicated function that can be reused across different data section types.

Key changes:

  • Extracted alignment logic into a new emitEnsureDataSectionAlignment function
  • Applied proper alignment to async resumption data sections
  • Added alignment logic to basic block table data sections

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/coreclr/jit/emitpub.h Adds declaration for new emitEnsureDataSectionAlignment function
src/coreclr/jit/emit.cpp Refactors alignment logic into new function, applies it to async resumption and BB table data, fixes array pointer usage

@jakobbotsch
Copy link
Member Author

cc @dotnet/jit-contrib PTAL @kg

@jakobbotsch jakobbotsch requested a review from kg November 20, 2025 11:28
@jakobbotsch
Copy link
Member Author

Ping @kg / @dotnet/jit-contrib

@kg
Copy link
Member

kg commented Nov 24, 2025

LGTM

@jakobbotsch jakobbotsch merged commit 371d227 into dotnet:main Nov 24, 2025
119 of 121 checks passed
@jakobbotsch jakobbotsch deleted the fix-resume-info-alignment branch November 24, 2025 16:11
@github-actions github-actions bot locked and limited conversation to collaborators Dec 25, 2025
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.

Async resume info has unaligned pointers

3 participants