radlink: fix MSF/PDB header page count and final-page extent - #935
Closed
honkstar1 wants to merge 1 commit into
Closed
radlink: fix MSF/PDB header page count and final-page extent#935honkstar1 wants to merge 1 commit into
honkstar1 wants to merge 1 commit into
Conversation
Collaborator
|
Manually merged the pull request c690fd1 |
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
Fix the MSF superblock's
page_countso thatpage_count * page_sizematches the serialized PDB length. This is a standalone correctness fix againstdev; it does not depend on the optimization/compressed-OBJ PRs (#842, #892, #932) or the library lookup fix (#934).A small Clang-built object linked with
/debug:fullexposed a PDB with 17 actual 4096-byte pages but a header declaring 31. Consumers which validate the superblock against file length reject that file with an unexpected-stream-length error.Cause and fix
msf->page_counttracks allocator accounting, including preallocated free-page-map (FPM) pages beyond EOF. It is not the serialized file extent.msf_build_header()now obtains its page count frommsf_get_save_size()after the stream table and root have been finalized. Allocation accounting is unchanged.Boundary regressions also exposed two issues in that extent calculation:
Both are corrected so that agreement between the header and file size cannot merely conceal truncated stream data. See the MSF format documentation for the superblock and FPM layout.
Regression coverage
Tests are added to the existing
src/linker/tests/linker_tests.c:Validation
devat the header/file-size assertion.Local builds used LLVM/Clang/LLD 20.1.8, not MSVC compiler/linker tools. Full application builds, UBA and symbol-upload infrastructure were not rerun for this fix. Existing affected PDBs need to be regenerated by relinking; this change does not patch them in place.