One important clarification after reviewing our original design and implementation: my previous reply omitted why the separate query process was introduced.
This is a controlled validation harness for a fixed native host, not a general-purpose process-identity service. The intended sequence is:
Observer creates the target using POSIX_SPAWN_START_SUSPENDED.
Before resuming it, Query checks dynamic code validity, the expected build identity, and the required runtime/library-validation status bits.
Observer resumes the target only after validating the complete result, observing stdout/stderr EOF, and confirming that Query exited successfully and was reaped.
Observer then checks the target’s fixed synthetic output and termination.
The goal is to observe these properties without modifying the host being validated. This is a limited diagnostic observation, not a claim of continuous protection or production authentication.
The separate Query process was introduced because the Security calls are synchronous: if a call blocks, Observer must remain able to handle cancellation, terminate Query and the still-suspended target, and perform bounded cleanup. Observer owns both children. An outer watchdog addresses Observer stalls, but does not guarantee descendant cleanup after a forced termination.
Therefore, moving the synchronous check directly into Observer’s supervision loop would lose an intended failure-isolation property unless another supported mechanism replaces it.
The existing 1000 ms query deadline is an application/test budget, not an OS guarantee. We have not established that this particular value is appropriate.
Given this more specific goal, is a disposable helper a reasonable isolation boundary, or would you recommend another supported design that preserves cancellation and bounded cleanup without relying on fast per-check process startup?
Topic:
App & System Services
SubTopic:
Processes & Concurrency
Tags: