Skip to content

test(artifacts): read /bin/ls slice layout from its FAT table - #1223

Merged
morluto merged 1 commit into
mainfrom
test/macho-slice-host-fat-table
Oct 9, 2026
Merged

morluto merged 1 commit into
mainfrom
test/macho-slice-host-fat-table

Conversation

@kaoru0822-kitauji

Copy link
Copy Markdown
Collaborator

Problem

src/artifacts/MachOSliceArtifactReader.test.ts runs the slice reader against the host's real /bin/ls with system lipo, then compares each slice's byteOffset/declaredSize with hard-coded numbers from one macOS release. /bin/ls changes between releases, so on any other host the test fails on a clean main:

macOS 26.7.1 (25G241), lipo -detailed_info /bin/ls
  x86_64  offset 16384  size 48128   (test expects 48112)
  arm64e  offset 65536  size 88672   (test expects 89088)

The test fails even though the reader reports exactly what the FAT table holds. It also shows up as an unrelated failure in npm run check:changed for any change that imports the artifact readers. It will break CI too once the macOS runner image updates /bin/ls.

Change

The test now reads the expected [offset, size] pairs directly from /bin/ls's 32-bit FAT header, independently of the reader. The slice names (x86_64, arm64e), the real lipo cross-check and the comparison itself are unchanged.

Verification

  • npx vitest run src/artifacts/MachOSliceArtifactReader.test.ts: passes on macOS 26.7.1. On main it fails with the size mismatch above.
  • oxfmt and oxlint are clean.

Test-only change, so no Hopper or Ghidra verification was needed.

🤖 Generated with Claude Code

The real-lipo slice test pinned the byte offsets and sizes of one macOS
release's /bin/ls, so it failed on any host whose /bin/ls differs
(macOS 26.7.1: x86_64 48128 bytes, arm64e 88672, versus the pinned 48112
and 89088). Read the expected layout from the binary's FAT header
instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T08:03:36.746537Z 09e8a77 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@morluto
morluto merged commit c89b3a0 into main Oct 9, 2026
22 checks passed
@morluto
morluto deleted the test/macho-slice-host-fat-table branch October 9, 2026 08:12
darsrc pushed a commit to darsrc/rea that referenced this pull request Oct 10, 2026
…o#1223)

The real-lipo slice test pinned the byte offsets and sizes of one macOS
release's /bin/ls, so it failed on any host whose /bin/ls differs
(macOS 26.7.1: x86_64 48128 bytes, arm64e 88672, versus the pinned 48112
and 89088). Read the expected layout from the binary's FAT header
instead.
@morluto morluto added area: tests Test suite and verification area: evidence Evidence, artifacts, and reconstruction labels Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: evidence Evidence, artifacts, and reconstruction area: tests Test suite and verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants