GeezerVison is showing github.com — refactor(fspy): record seccomp-intercepted accesses in the shared-memory channel by wan9chi · Pull Request #816 · voidzero-dev/vite-task
Conversation
wan9chi
commented
Oct 7, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Motivation
fspy reports a run's file accesses as one stream, in the order they were made, and order-based classification of inputs and outputs (#571) relies on that. On Linux the seccomp supervisor broke it: the accesses it intercepted from static binaries were kept in their own arenas and reported after everything the preload library recorded, so a path touched by both a static binary and a dynamically linked process lost its order. Seccomp-only (musl) builds also collected into unbounded arenas, so unlike the other backends they could never report incomplete tracking.
Stacked on #817. Recording seccomp's accesses in the channel adds one fresh page to every static launch, which cost half a millisecond of fault read-ahead until #817 turned read-ahead off.
Changes
fspy_seccomp_unotify::supervisor::supervise takes a closure that creates each handler instead of requiring Default.
- The channel
Receiver in fspy_shared gains sender(), which maps the region again for a sender in the receiver's own process.
- fspy's syscall handler sends each record through that sender before the supervisor lets the syscall continue, following the channel's publish-before-acting rule. The supervisor is still stopped before the channel closes, so the set of collected accesses is unchanged.
- The channel is no longer compiled out on musl, and the
fspy_shm_capacity e2e fixture now runs there too.
PathAccessIterable::iter documents that it yields accesses in the order they were made. On Unix, the program-resolution accesses made before the child is spawned now come first.
🤖 Generated with Claude Code
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
fspy benchmark
linux
dynamic/launch change -0.14% [ -8.72% .. +9.42%] overhead +57.36%
dynamic/access change +0.76% [ -5.99% .. +20.77%] overhead +25.82%
dynamic/access-relative change +0.00% [-11.56% .. +8.45%] overhead +66.65%
dynamic/access-contended change -2.55% [-11.49% .. +16.03%] overhead +10.42%
static/launch change +1.80% [ -3.77% .. +13.34%] overhead +186.66%
static/access change +0.73% [-13.14% .. +10.87%] overhead +1360.00%
static/access-relative change +0.03% [-10.12% .. +16.40%] overhead +1643.41%
static/access-contended change +1.65% [ -5.45% .. +9.37%] overhead +1183.37%
macos
dynamic/launch change +0.18% [ -5.98% .. +6.10%] overhead +224.19%
dynamic/access change -0.34% [ -2.78% .. +2.20%] overhead +3.28%
dynamic/access-relative change +0.10% [ -3.17% .. +3.66%] overhead +269.94%
dynamic/access-contended change +0.13% [-20.96% .. +20.36%] overhead +1.95%
windows
dynamic/launch change -0.23% [ -4.60% .. +5.21%] overhead +26.58%
dynamic/access change +0.18% [ -1.91% .. +3.28%] overhead +1.26%
dynamic/access-relative change +0.17% [ -2.05% .. +9.59%] overhead +1.59%
dynamic/access-contended change +0.68% [ -2.43% .. +5.05%] overhead +3.10%
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…ory channel
The seccomp supervisor kept intercepted accesses in per-listener arenas
that were reported after the preload library's records, so their order
relative to the accesses of dynamically linked processes was lost. The
supervisor now sends them through the same shared-memory channel, using
a sender the receiver creates in its own process.
The channel is now built on musl too, so seccomp-only builds share the
channel's capacity limit and its incomplete-tracking report. The path
access iterator documents that it yields accesses in the order they were
made, and now yields program-resolution accesses, made before the child
is spawned, first.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
wan9chi
added a commit
that referenced
this pull request
Oct 7, 2026
## Motivation
On Linux, every tracked launch pays about half a millisecond for each
page of the shared-memory channel written for the first time. #675
recorded this as a known launch regression and put it down to
journalling. The cause is fault read-ahead: a fault in a shared file
mapping reads ahead the pages around it, and in the sparse backing file
those are holes the kernel fills with zeros. Removing the file then
costs as much again, to drop those zero pages.
#816 records the accesses that seccomp intercepts in the same channel,
which adds a fresh page to every static launch, and the fspy benchmark
showed it as a +75% `static/launch` regression.
In a Linux VM writing to ext4, a first write to a fresh page took about
470 µs and removing the file about 355 µs. With the mapping advised
`MADV_RANDOM`, they took about 2.5 µs and 8 µs, and the benchmark's
`dynamic/launch` and `static/launch` rows dropped by about half against
`main`. macOS first writes already take a few microseconds, and the
advice does not change them.
## Changes
- `fspy_nostd::mm::madvise` with `Advice::Random`: a raw syscall on
Linux, so it stays usable from the preload library, and libc on macOS.
- `fspy_shm` advises every Unix mapping `MADV_RANDOM`. The advice is
best effort: a refusal leaves a working mapping.
- The `shm_io` README explains the cost in place of the journalling
explanation.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
ci: full
Run the slow CI jobs (macOS x64, musl) on this pull request
linux backend
The new Linux file tracking backend
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|