Skip to content

[release/11.0] Preserve ARM64 PAC masks in Linux core dumps - #137833

Merged
steveisok merged 1 commit into
dotnet:release/11.0from
max-charlamb:backport/createdump-pac-mask-11.0
Nov 20, 2026
Merged

steveisok merged 1 commit into
dotnet:release/11.0from
max-charlamb:backport/createdump-pac-mask-11.0

Conversation

@max-charlamb

Copy link
Copy Markdown
Member

Backport of #137777 to release/11.0.

Manual backport: the bot cherry-pick conflicted because createdump was reorganized into shared/ on main. Changes are ported to the release/11.0 layout (ThreadSnapshot -> ThreadInfo, createdumpcore.h -> createdump.h, CrashInfo::Threads() holds ThreadInfo*). Logic is unchanged.

Customer Impact

  • Customer reported
  • Found internally

On Linux ARM64 systems where glibc signs return addresses with PAC (e.g. Ubuntu 26.04 / glibc 2.43), dumps created by createdump omit the NT_ARM_PAC_MASK note. Without it, LLDB cannot strip PAC bits from return addresses and native stack unwinding stops after the first libc frames, so crash dumps cannot be fully analyzed.

Regression

  • Yes
  • No

Exposed by newer distros that enable PAC by default; createdump never wrote this note.

Testing

dotnet/diagnostics#6256 adds NativeUnwindTests, which asserts LLDB unwinds through multiple runtime frames in a createdump dump. A/B on the Ubuntu 26.04 ARM64 queue against main: baseline without fix (run 1687082) vs. with fix (run 1687081).

Risk

Low. ARM64 Linux only. Adds one optional per-thread ELF note when the kernel exposes the PAC mask regset; failures to read it are logged and do not prevent dump creation.

- Capture the Linux ARM64 `NT_ARM_PAC_MASK` regset for each thread and
write it as a `LINUX` ELF core note when available.
- Include emitted notes in the `PT_NOTE` size and report unexpected
regset failures without preventing dump creation.
- This allows native tooling to unwind dumps created with createdump
when the system has ARM-PAC enabled.

Related to dotnet#109457.

Validation (A/B on Ubuntu 26.04 / glibc 2.43, both using
dotnet/diagnostics#6256). The temporary queue change used for validation
(dd159c9) has been reverted from this PR; the baseline carries only
that queue change:
- [Baseline: queue change only (dotnet#137796), run
1687082](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1687082)
- expected to fail `NativeUnwindTests` on Linux ARM64.
- [This PR at dd159c9: queue change + fix, run
1687081](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1687081)
- expected to pass.

---------

Co-authored-by: Max Charlamb <maxcharlamb@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: d35a41b1-6332-4188-8ee8-793457babe03
(cherry picked from commit 2e314e7)
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
12 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: @steveisok, @tommcdon, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.

@steveisok
steveisok enabled auto-merge (squash) November 20, 2026 19:28
@steveisok

Copy link
Copy Markdown
Member

/ba-g All tracked known issues unrelated.

@steveisok
steveisok merged commit 807c07b into dotnet:release/11.0 Nov 20, 2026
121 of 125 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants