Skip to content

explorer: forked workers have no timeout, no kill-on-drop, and waitpid(-1) reaps unrelated children #262

Closed

Description

@PierreZ

Found during the pre-release source audit of 8d9e779 (read-only, nothing compiled or run). Severity: medium. Status: confirmed.

Where

  • crates/moonpool-explorer/src/worker.rs:160 (wait_any: waitpid(-1, &status, 0), no WNOHANG, no deadline)
  • crates/moonpool-explorer/src/controller.rs:313 (final drain loop)
  • crates/moonpool-explorer/src/controller.rs:417 (reap_one_and_process)
  • Explorer has no Drop impl (only SharedMemory does, shared_mem.rs:77)

Failure scenario

A child stuck outside the simulation (a tight loop in user process code, a blocking syscall) is not covered by the in-simulation RunStallGuard; the controller blocks in waitpid until the CI job timeout kills everything with no diagnostic. A controller panic or SIGKILL orphans live children that keep running full simulations while holding the MAP_SHARED assertion and sancov regions. waitpid(-1, ..) also reaps any unrelated child of the host process when moonpool is embedded in a larger harness.

Proposed fix

Add a Drop for Explorer that SIGKILLs every pid in active, poll with WNOHANG against a per-worker wall-clock ceiling, and wait on the specific pids the explorer spawned.

Activity

  1. added
    bug
    on Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions