Skip to content

release/20.x: Fix crash lowering stack guard on OpenBSD/aarch64. (#125416) #136458

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

Merged
merged 1 commit into from
May 9, 2025

Conversation

llvmbot
Copy link
Member

@llvmbot llvmbot commented Apr 19, 2025

Backport c180e24

Requested by: @brad0

@llvmbot
Copy link
Member Author

llvmbot commented Apr 19, 2025

@Sterling-Augustine What do you think about merging this PR to the release branch?

@tstellar tstellar moved this from Needs Triage to Needs Review in LLVM Release Status Apr 25, 2025
@tstellar
Copy link
Collaborator

ping @Sterling-Augustine

@brad0
Copy link
Contributor

brad0 commented May 7, 2025

@tstellar He doesn't seem to be around. I'd like to get this in as I can't build compiler-rt or openmp on aarch64 without it.

@github-project-automation github-project-automation bot moved this from Needs Review to Needs Merge in LLVM Release Status May 7, 2025
@Sterling-Augustine
Copy link
Contributor

I have no idea why this won't merge.

@brad0
Copy link
Contributor

brad0 commented May 7, 2025

I have no idea why this won't merge.

There are certain steps of the cherry pick that are automated but the merge AFAIK is done manually by the release manager. He was waiting for your Ok.

@Sterling-Augustine
Copy link
Contributor

It's approved.

TargetLoweringBase::getIRStackGuard refers to a platform-specific guard
variable. Before this change, TargetLoweringBase::getSDagStackGuard only
referred to a different variable.

This means that SelectionDAGBuilder's getLoadStackGuard does not get
memory operands. However, AArch64InstrInfo::expandPostRAPseudo assumes
that the passed MachineInstr has nonzero memoperands, causing a
segfault.

We have two possible options here: either disabling the LOAD_STACK_GUARD
node entirely in AArch64TargetLowering::useLoadStackGuardNode or just
making the platform-specific values match across TargetLoweringBase.
Here, we try the latter.

(cherry picked from commit c180e24)
@tstellar tstellar merged commit be4097b into llvm:release/20.x May 9, 2025
6 of 8 checks passed
@github-project-automation github-project-automation bot moved this from Needs Merge to Done in LLVM Release Status May 9, 2025
Copy link

github-actions bot commented May 9, 2025

@brad0 (or anyone else). If you would like to add a note about this fix in the release notes (completely optional). Please reply to this comment with a one or two sentence description of the fix. When you are done, please add the release:note label to this PR.

@3405691582
Copy link
Contributor

@brad0 (or anyone else). If you would like to add a note about this fix in the release notes (completely optional). Please reply to this comment with a one or two sentence description of the fix. When you are done, please add the release:note label to this PR.

Fixed compiler crash on OpenBSD/aarch64 when using stack protection by ensuring platform-specific guard variables are consistently referenced.

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

Successfully merging this pull request may close these issues.

5 participants