Skip to content

pidfd for a thread or CLONE_VM child never reports exit #441

Open

Description

@xalestar

A pidfd that clone or clone3 makes with CLONE_PIDFD for a thread or a CLONE_VM child never becomes readable. No monitor runs for a task with no host pid, and neither the thread exit path nor the site that publishes a VM child's vm_exit_status (src/runtime/forkipc.c) calls proc_pidfd_notify_exit. A guest that polls the pidfd for the child's exit waits forever, where Linux reports POLLIN.

A fix would notify at both exit sites, and record an exit that lands before pidfd_set_target, since the child can finish before the parent binds the pidfd to it.

Raised in review of #421, where clone(CLONE_VM|CLONE_PIDFD) became able to make such a pidfd; before it only clone3 could.

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