W06.A.3: wire LD_PRELOAD shim notifications into journal events#47
Merged
Conversation
This was referenced May 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Daemon's
shim_listener::handle_onepreviously ackedAllowanddiscarded the
ShimNotification. W06.A.3 wires it through:pid → CommandIdviaActiveCommands::resolve_by_descendant.TreeOp::Unlink(unlink/unlinkat) orTreeOp::Rename(rename/renameat).Index::put_event.Allow(resolution happens BEFORE ack to avoid theps -prace against fast-dying emitter pids — see comment).Headline result
make-install-undo-fbsd.shtransitions from documenting-the-gap(applied=0, files remain) to Outcome A: full undo:
/usr/bin/install's tworename(temp→final)calls fire the shiminterposer (W06.A.2's versioned exports), notifications reach the
daemon (W06.A.2's
.symverplumbing), the daemon resolves eachpid back to the smoke's command, journals two
TreeOp::Renameevents, and
shit undo --yesemits the inverse renames + cleansthe install-target.
Race fix
Initial impl resolved
pid → CommandIdAFTER acking the shim;the emitter (e.g.
install) terminates within ~10ms of the ack,and our
ps -p <pid>resolution returns empty. Notificationsarrive in the daemon but the journal stays empty.
Fix: resolve synchronously BEFORE ack. Costs ~10ms per
notification (one
ps -pper ancestor level) but fits insidethe shim's 50ms allow-on-timeout budget. Followup
W06.A.4-or-latercarries ancestry inline in the wire toeliminate the shell-out entirely.
Out of scope (W06.A.4)
open/truncate/pwrite/mmap—these modify content, need pre-mutation bytes via SCM_RIGHTS.
Currently dropped with a debug log.
ps -pcost).mvitself. Documented in.docs/sprints/W/W06.A/followups.md.Test plan
cargo test -p shitd— 127 tests pass (inclshim_listener::one_shot_notify_round_trip).cargo fmt --check,cargo clippy -p shitd --all-targets -- -D warningsclean.make-install-undo-fbsdnow at Outcome A.