Skip to content

Thin Mach-O architecture inventory misreads filenames containing line breaks #760

Closed

Description

@rudycelekli

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.

Activity

  1. kaoru0822-kitauji commented on Oct 7, 2026

    @kaoru0822-kitauji
    Collaborator

    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).

  2. added
    enhancement
    area: native
    on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: nativeenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions