[GH-ISSUE #760] Thin Mach-O architecture inventory misreads filenames containing line breaks #336

Closed
opened 2026-10-15 18:24:03 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @rudycelekli on GitHub (Oct 6, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/760

The public macOS inspect-macho result reports an incorrect thin architecture when the ordinary local Mach-O filename contains a line break. A real Clang-produced target named line\nbreak is arm64 according to native lipo -archs; lipo -detailed_info echoes that filename verbatim across lines. REA parses the first Non-fat file: line as an architecture name, so its exhaustive architecture inventory contains a pathname fragment instead of arm64. An ordinary filename control reports arm64 correctly.

The affected parser is also used by list_architectures. Matching the complete thin record before splitting lines preserves the actual final architecture field. This concerns native format inspection only, with no Hopper/Ghidra/IDA, GUI, Windows, or target-runtime claim.

AI-assisted investigation; actual Clang/lipo and compiled CLI reproduction, independent source review, and separate real stdio MCP verification.

Originally created by @rudycelekli on GitHub (Oct 6, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/760 The public macOS `inspect-macho` result reports an incorrect thin architecture when the ordinary local Mach-O filename contains a line break. A real Clang-produced target named `line\nbreak` is arm64 according to native `lipo -archs`; `lipo -detailed_info` echoes that filename verbatim across lines. REA parses the first `Non-fat file:` line as an architecture name, so its exhaustive architecture inventory contains a pathname fragment instead of arm64. An ordinary filename control reports arm64 correctly. The affected parser is also used by `list_architectures`. Matching the complete thin record before splitting lines preserves the actual final architecture field. This concerns native format inspection only, with no Hopper/Ghidra/IDA, GUI, Windows, or target-runtime claim. AI-assisted investigation; actual Clang/lipo and compiled CLI reproduction, independent source review, and separate real stdio MCP verification.
bsakaguchi 2026-10-15 18:24:03 +00:00
Author
Owner

@kaoru0822-kitauji commented on GitHub (Oct 7, 2026):

Fixed on main by #815, after 4.1.0. The lipo parser now reads a thin file's final is architecture: field before splitting lipo -detailed_info output into lines, so a pathname echoed across lines no longer becomes the architecture name.

Checked on current main (macOS arm64): a Clang-built Mach-O named line\nbreak reports architectures.items: [{ name: "arm64" }] from inspect-macho, matching lipo -archs and an ordinary-named control.

This ships in the next release (release PR #771).

<!-- gh-comment-id:6041891684 --> @kaoru0822-kitauji commented on GitHub (Oct 7, 2026): Fixed on `main` by #815, after 4.1.0. The lipo parser now reads a thin file's final `is architecture:` field before splitting `lipo -detailed_info` output into lines, so a pathname echoed across lines no longer becomes the architecture name. Checked on current `main` (macOS arm64): a Clang-built Mach-O named `line\nbreak` reports `architectures.items: [{ name: "arm64" }]` from `inspect-macho`, matching `lipo -archs` and an ordinary-named control. This ships in the next release (release PR #771).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#336
No description provided.