Skip to content

createdump: fix macOS arm64 thread IDs in LLDB - #131962

Merged
max-charlamb merged 2 commits into
dotnet:mainfrom
max-charlamb:max-charlamb/macos-arm64-special-thread-info
Aug 7, 2026
Merged

createdump: fix macOS arm64 thread IDs in LLDB#131962
max-charlamb merged 2 commits into
dotnet:mainfrom
max-charlamb:max-charlamb/macos-arm64-special-thread-info

Conversation

@max-charlamb

@max-charlamb max-charlamb commented Aug 6, 2026

Copy link
Copy Markdown
Member

Summary

  • write the macOS arm64 createdump thread-info region at a 47-bit-valid address
  • emit OS thread IDs using LLDB's process metadata LC_NOTE format
    • this is for future support so we can eventually remove the SpecialThreadInfo
  • retain the existing special thread-info segment while consumers migrate to the LLDB format

Motivation

Apple Silicon LLDB rejects the legacy 0x7fffffff00000000 synthetic segment and falls back to sequential thread IDs beginning at zero. SOS then cannot correlate LLDB threads with runtime OS thread IDs or retrieve the selected thread context.

Coordinated SOS reader change: dotnet/diagnostics#5953

Related precedent

This follows @steveisok's coordinated Apple Silicon fix for SpecialDiagInfoAddress:

Testing

Draft pending coordinated diagnostics validation on macOS arm64.

max-charlamb and others added 2 commits August 6, 2026 14:39
Apple Silicon rejects Mach-O core segments above its 47-bit user-space
address limit. Write the createdump thread ID mapping at a valid address
so LLDB can expose real OS thread IDs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7805386d-16fd-4306-bcc9-54d4ea7b65cf
Write OS thread IDs in LLDB's process metadata LC_NOTE format while
retaining the special thread-info segment for compatibility. Align the
Apple Silicon compatibility region with the established special metadata
address scheme.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7805386d-16fd-4306-bcc9-54d4ea7b65cf
@azure-pipelines

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

@steveisok
steveisok self-requested a review August 6, 2026 19:38
@max-charlamb
max-charlamb marked this pull request as ready for review August 6, 2026 19:42
@azure-pipelines

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Note

This error may be related to your runner configuration. You can now configure runners for Copilot code review separately from Copilot cloud agent by creating a copilot-code-review.yml file with your setup steps. Read the docs for details.

@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.

@max-charlamb
max-charlamb merged commit f659b2c into dotnet:main Aug 7, 2026
110 of 111 checks passed
@max-charlamb
max-charlamb deleted the max-charlamb/macos-arm64-special-thread-info branch August 7, 2026 16:52
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-rc1 milestone Aug 7, 2026
max-charlamb added a commit to dotnet/diagnostics that referenced this pull request Aug 10, 2026
## Summary

- read macOS arm64 createdump thread metadata from the new 47-bit-valid
address
- fall back to the legacy address for compatibility with existing
createdump output
- use the selected address for all subsequent thread-info entries

## Motivation

Apple Silicon LLDB rejects the legacy `0x7fffffff00000000` synthetic
segment and assigns sequential thread IDs beginning at zero. SOS cannot
then correlate LLDB threads with runtime OS thread IDs or retrieve the
selected thread context.

Coordinated writer change: dotnet/runtime#131962

## Related precedent

This follows @steveisok's coordinated Apple Silicon fix for
`SpecialDiagInfoAddress`:

- runtime writer: dotnet/runtime#130443
- diagnostics readers: #5823

## Testing

Draft pending coordinated macOS arm64 validation with the runtime writer
change.

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7805386d-16fd-4306-bcc9-54d4ea7b65cf
jtschuster pushed a commit to jtschuster/runtime that referenced this pull request Aug 11, 2026
## Summary

- write the macOS arm64 createdump thread-info region at a 47-bit-valid
address
- emit OS thread IDs using LLDB's `process metadata` `LC_NOTE` format
- this is for future support so we can eventually remove the
`SpecialThreadInfo`
- retain the existing special thread-info segment while consumers
migrate to the LLDB format

## Motivation

Apple Silicon LLDB rejects the legacy `0x7fffffff00000000` synthetic
segment and falls back to sequential thread IDs beginning at zero. SOS
then cannot correlate LLDB threads with runtime OS thread IDs or
retrieve the selected thread context.

Coordinated SOS reader change:
dotnet/diagnostics#5953

## Related precedent

This follows @steveisok's coordinated Apple Silicon fix for
`SpecialDiagInfoAddress`:

- runtime writer: dotnet#130443
- diagnostics readers: dotnet/diagnostics#5823

## Testing

Draft pending coordinated diagnostics validation on macOS arm64.

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7805386d-16fd-4306-bcc9-54d4ea7b65cf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants