Repository navigation
Handle Mach-O thread command padding - #1524
Merged
Steve Pfister (steveisok) merged 1 commit intoNov 8, 2026
Merged
Steve Pfister (steveisok) merged 1 commit into
Steve Pfister (steveisok) merged 1 commit into
Conversation
Accept zero padding at the end of 64-bit LC_THREAD commands while continuing to reject nonzero truncated headers. Align synthetic Mach-O commands so the regression test matches the file format. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6297d10c-2f94-48bb-b897-bc0b3e1a855f
Max Charlamb (max-charlamb)
requested review from
Rachel Jarvi (rcj1) and
Steve Pfister (steveisok)
November 6, 2026 23:03
Steve Pfister (steveisok)
approved these changes
Nov 7, 2026
Max Charlamb (max-charlamb)
deleted the
max-charlamb/fix-macho-thread-command-padding
branch
November 9, 2026 15:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
LC_THREADcommandsThe Mach-O format requires 64-bit load-command sizes to be multiples of 8 and requires padding bytes to be zero. Runtime-generated macOS x64 dumps therefore contain four trailing zero bytes after the final thread state. ClrMD previously interpreted those bytes as a truncated flavor/count header.
Related: dotnet/runtime#137115
Testing
dotnet test src\Microsoft.Diagnostics.Runtime.Tests\Microsoft.Diagnostics.Runtime.Tests.csproj --filter "FullyQualifiedName~ThreadContextTests" --no-restore-- passed, 16 testsgit diff --check-- passedNote
This pull request description was generated with GitHub Copilot.