Skip to main content

refuse_unenforceable_anchors

Function refuse_unenforceable_anchors 

Source
pub fn refuse_unenforceable_anchors(
    program: &HappensBeforeProgram,
    path: &Path,
    launch: HbLaunch<'_>,
) -> Result<()>
Expand description

Refuse, before anything is launched or any input is read, a program the run cannot enforce as written:

  • a syscall anchor for the polling phase (syscall anchors fire at the prehook of the thread’s nth matching call, or when it completes);
  • a count or syscall-occurrence anchor when the run bypasses interception (--namespace-only) or runs the guest under a runtime other than ptrace (in-guest Detcore never receives the program, https://github.com/rrnewton/hermit/issues/3943);
  • a syscall-occurrence anchor with --passthru-opt (some syscalls are left unintercepted; a count anchor still counts the intercepted ones);
  • a syscall anchor on a syscall that never reaches Detcore (syscall_never_reaches_tracer);
  • a posthook anchor with --replay-schedule-from: its gate adds a scheduler turn after the syscall’s posthook schedule event, and this version does not claim the composition replays exactly (https://github.com/rrnewton/hermit/issues/3929);
  • a version-2 spec with --max-timeslice disabled (refuse_hold_without_preemption).

Ignoring any of these would let a run pass, or blame the guest, with the ordering unexercised. Applied on the run path only, so --hb-list-events can still preview such a spec.