Skip to content

Commit 84d2dae

Browse files
authored
State what emulation cannot show, because it looks exactly like a defect (#29)
An aarch64 build measured on an x86_64 machine through qemu-user holds every observation except the ones that START a program of the same foreign architecture. The kernel runs a native binary directly and the emulated process stops being emulated; a foreign one has to be re-entered through binfmt_misc from inside an already-emulated process, which qemu-user does not do. ⚠️ Recorded because the shape is indistinguishable from a real failure: `execveat` answers ENOENT for a path that exists, while the same call in the same run starts /bin/sh correctly. Two things establish that it is the emulator: the release BEFORE this one fails identically, and a consumer's 108 tests --- which start helper programs rather than copies of themselves --- pass on both architectures.
1 parent 80f6740 commit 84d2dae

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,30 @@ was measuring in the first place, and the growth does not change its direction.
348348

349349
## Verification
350350

351+
### ⚠️ Measuring a foreign architecture through emulation, and the one thing it cannot show
352+
353+
An `aarch64` build of this library runs on an `x86_64` machine through
354+
`qemu-user` and `binfmt_misc`, and every observation in this repository's probes
355+
holds there **except the ones that start a program built for the same foreign
356+
architecture**. That is a property of the emulator and not of this library, and
357+
it is stated here because the failure looks exactly like a defect:
358+
359+
| what a program starts | under emulation |
360+
| --- | --- |
361+
| a native binary of the host — `sh`, `git`, anything on `PATH` | works |
362+
| **another copy of the foreign-architecture program itself** | the start fails |
363+
364+
⭐ The distinction is the second exec. The kernel runs a native binary directly,
365+
and the emulated process simply stops being emulated; a foreign one has to be
366+
re-entered through `binfmt_misc` from inside an already-emulated process, which
367+
`qemu-user` does not do. Measured: `execveat` returns `ENOENT` for a path that
368+
exists, while the same call in the same run starts `/bin/sh` correctly, and the
369+
same failure appears on the release before this one.
370+
371+
**A consumer measuring itself this way is not affected** unless its tests start
372+
copies of themselves. A suite that runs helper programs sees nothing wrong: one
373+
consumer's 108 tests pass identically on both architectures.
374+
351375
`examples/wordcount` is an ordinary POSIX program whose source mentions nothing
352376
of any of this. Its three counts are compared against the system's own `wc`,
353377
which is an oracle this package did not produce; a program that merely produced

0 commit comments

Comments
 (0)