Skip to content

testgen-hs subprocess: current_child_pid is not reset after the child exits #539

Description

@ginnun

In crates/node/src/cbor/fallback_decoder.rs (and after #537 merges, in crates/testgen/src/testgen.rs), current_child_pid is updated when a child is spawned:

current_child_pid.store(child.id(), atomic::Ordering::Relaxed);

but it is never reset after child.kill() / child.wait(). Callers of child_pid() therefore keep observing the dead PID. On Linux the kernel can reuse that PID for an unrelated process, which would make any signal/lookup done via child_pid() target the wrong process, and breaks crash-recovery assertions that expect "no live child".

Flagged by Copilot.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions