Handle DWARF string sections larger than 2 GB - #1216
Open
Martin Řezník (martin-reznik) wants to merge 7 commits into
Open
Handle DWARF string sections larger than 2 GB#1216Martin Řezník (martin-reznik) wants to merge 7 commits into
Martin Řezník (martin-reznik) wants to merge 7 commits into
Conversation
…g-str Handle DWARF string sections larger than 2 GB
Pratik Lade (plade)
approved these changes
Aug 26, 2026
Pratik Lade (plade)
enabled auto-merge
August 26, 2026 05:01
Member
|
looks like this is failing on some dotnet format errors? |
|
Alexander Köplinger (@akoeplinger) Martin Řezník (@martin-reznik) I fixed the CRLF formatting issue in #1218. dotnet format src --verify-no-changes passes with the update. |
…t-format Fix BinaryTargetManager line endings
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.
Promotes the DWARF >2 GB string-section handling into
main. Staged onfix/large-debug-strvia #1207 (approved) and now being promoted.What this does
IDwarfStringReaderabstraction for DWARF string sections, with a file-backed implementation (DwarfFileStringReader) that reads individual null-terminated strings directly from the binary instead of materializing the whole.debug_strsection into abyte[].--dwarf-string-read-thresholdCLI option. File-backed reads are used only when this option is supplied and the.debug_strsection reaches the configured size.Root cause
ELFSharp materializes section contents into a
byte[]; a.debug_strsection larger thanint.MaxValueoverflows the 32-bit size conversion, preventing BinSkim from analyzing otherwise-valid ELF binaries (hit by Minecraft's Nintendo Switch symbol files).Behavior / compatibility
--dwarf-string-read-threshold, the value isnulland every existing user keeps the exact in-memory code path (asserted by a unit test).ElfBinarybuilds/disposes its own reader perLazy, so the stateful file-backed reader is never shared across BinSkim's file-level parallelism.ElfBinaryonly.Known limitations (non-blocking, tracked for later)
.debug_str)..debug_stris still unsupported.Refs