Repository navigation
fix(native): preserve numeric-looking Mach-O identifiers - #690
Closed
rudycelekli wants to merge 1 commit into
Closed
rudycelekli wants to merge 1 commit into
rudycelekli wants to merge 1 commit into
Conversation
Signed-off-by: RudyCelekli <[email protected]>
morluto
approved these changes
Oct 6, 2026
morluto
left a comment
Owner
There was a problem hiding this comment.
Approve: narrow exemption of segname/sectname from numeric coercion preserves Mach-O identifiers like 0001/0002 while numberField still parses real numerics. Golden regression covers names + fileoff/size preservation. Checks green.
Owner
|
Superseded by #705, which cherry-picks this change (plus 13 sibling fixes) onto current main with conflict resolution and regenerated catalogs. Closing to keep one reviewable merge unit. |
Owner
|
Thanks, @rudycelekli, for your work on “fix(native): preserve numeric-looking Mach-O identifiers.” I appreciate your contribution to REA. |
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.
Problem
Mach-O segment and section identifiers are text.
parseFieldscoerces every numeric-looking otool value to a number, so real names such as segment0001and section0002become1and2in native inventory. This changes their identity and breaks matching against the actual binary's names.Change
Preserve
segnameandsectnameas text. Retain existing numeric parsing for offsets, sizes and other numeric fields.Verification
An owned dylib was built with actual host clang/linker
-sectcreate,0001,0002,.... Realxcrun otool -lreports the segment0001and section0002.The public filesystem target resolver and actual
NativeMacOSProvider/xcrun inventory report the wrong names before the fix. After it they retain0001and0002while preserving the observed file offset 16384 and section size 8. The corrected native probe reads the public schema'ssegments.itemsandsections.items; the earlier probe's array assumption was a setup error and is not evidence for the fix.npm run checktasks pass using Node 24.18.0 and exact locked dependencies.AI assistance was used for investigation, implementation, tests, description and independent patch review. Actual producer proof and limitations are stated above.