podman-container-tools/podman · error

waitpid: %m

Error message

waitpid: %m

What it means

After exec_binary() forks a child to run a preexec hook, the parent reaps it with TEMP_FAILURE_RETRY(waitpid(...)) (pkg/rootless/rootless_linux.c:400). EINTR is already retried, so this message means waitpid failed for another reason - typically ECHILD because someone else (a SIGCHLD handler with SA_NOCLDWAIT, or an auto-reaping supervisor) already reaped the child. The podman process exits with EXIT_FAILURE before Go code runs.

Source

Thrown at pkg/rootless/rootless_linux.c:403

          exit (EXIT_FAILURE);
        }
      newargv[0] = (char*) path;
      for (i = 0; i < argc; i++)
        newargv[i+1] = argv[i];

      newargv[i+1] = NULL;
      errno = 0;
      execv (path, newargv);
      /* If the file was deleted in the meanwhile, return success.  */
      if (errno == ENOENT)
        exit (EXIT_SUCCESS);
      exit (EXIT_FAILURE);
    }

  r = TEMP_FAILURE_RETRY (waitpid (pid, &status, 0));
  if (r < 0)
    {
      fprintf (stderr, "waitpid: %m\n");
      exit (EXIT_FAILURE);
    }
  if (WIFEXITED(status) && WEXITSTATUS (status))
    exit (WEXITSTATUS(status));
  if (WIFSIGNALED (status))
    exit (127+WTERMSIG (status));
  if (WIFSTOPPED (status))
      exit (EXIT_FAILURE);
}

static void
do_preexec_hooks_dir (const char *dir, char **argv, int argc)
{
  cleanup_free char *buffer = NULL;
  cleanup_dir DIR *d = NULL;
  size_t i, nfiles = 0;
  struct dirent *de;

View on GitHub (pinned to a2409076ef)

Solutions

  1. Run the same command from a plain shell to confirm the environment (not podman) is reaping the child
  2. Inspect/disable the preexec hooks: remove /etc/containers/podman_preexec_hooks.txt or empty the hook directories
  3. Identify the wrapper installing SIGCHLD handlers/SA_NOCLDWAIT around podman and disable that behavior
  4. Capture 'strace -f -e trace=clone,wait4 podman <cmd>' and report upstream with the trace
Defensive patterns

Strategy: validation

Validate before calling

# Ensure no auto-reaping environment is in play and hooks are sane
ls -la /etc/containers/pre-exec-hooks 2>/dev/null
ls -la "${PODMAN_PREEXEC_HOOKS_DIR:-}" 2>/dev/null
# reproduce from a plain shell first to rule out wrapper interference

Prevention

When it happens

Trigger: Running podman with preexec hooks enabled while embedded in a process that installs a SIGCHLD handler with SA_NOCLDWAIT or reaps arbitrary children (some supervision frameworks, REPLs, language runtimes); an LSM/seccomp policy denying wait4 to the podman process.

Common situations: Podman launched from inside process managers that auto-reap children; a preexec hook wrapper that manipulates child-process state; sandboxed environments intercepting wait syscalls.

Related errors


AI-assisted analysis of podman-container-tools/podman@a2409076ef (2026-08-15). Data as JSON: /api/errors/3c065b1ebb0efbdd. Report an issue: GitHub.