podman-container-tools/podman · error

waitpid: %m

Error message

waitpid: %m

What it means

The parent side of fork_exec_ps() got a failing waitpid() while reaping the ps child for 'podman top'. %m is strerror(errno): EINTR if a signal arrived during the (non-restarting) waitpid call — note this call site lacks the TEMP_FAILURE_RETRY wrapper that other waits in the tree use — or ECHILD if SIGCHLD was set to SIG_IGN (children auto-reaped) so there is nothing to wait for. The helper then exits 255 (special_exit_code).

Source

Thrown at libpod/container_top_linux.c:102

              exit (special_exit_code);
            }
          if ((status = setns (r, CLONE_NEWUSER)) < 0)
            {
              fprintf (stderr, "setns NEWUSER: %m");
              exit (special_exit_code);
            }
        }

      /* use execve to unset all env vars, we do not want to leak anything into the container */
      execve (argv[0], argv, NULL);
      fprintf (stderr, "execve: %m");
      exit (special_exit_code);
    }

  r = waitpid (pid, &status, 0);
  if (r < 0)
    {
      fprintf (stderr, "waitpid: %m");
      exit (special_exit_code);
    }
  if (WIFEXITED (status))
    exit (WEXITSTATUS (status));
  if (WIFSIGNALED (status))
    exit (128 + WTERMSIG (status));
  exit (special_exit_code);
}

View on GitHub (pinned to a2409076ef)

Solutions

  1. Simply retry 'podman top' — EINTR is transient
  2. Unset the SIG_IGN disposition on SIGCHLD in the wrapper/supervisor that launches podman (e.g. signal(SIGCHLD, SIG_DFL) before exec)
  3. Remove LD_PRELOAD watchdogs/renice wrappers from the podman process environment
  4. If reproducible, report upstream — wrapping the waitpid in TEMP_FAILURE_RETRY is the code-level fix

Example fix

// before (libpod/container_top_linux.c)
r = waitpid (pid, &status, 0);

// after
TEMP_FAILURE_RETRY (r = waitpid (pid, &status, 0));
Defensive patterns

Strategy: retry

Try / catch

# EINTR during the helper's waitpid is transient — one retry suffices
#!/bin/sh
out=$(podman top "$ctr" 2>&1); rc=$?
if [ $rc -eq 255 ] && printf '%s' "$out" | grep -q 'waitpid:.*Interrupted'; then
  sleep 1
  out=$(podman top "$ctr" 2>&1); rc=$?
fi
[ $rc -eq 0 ] || { echo "$out" >&2; exit $rc; }
printf '%s\n' "$out"

Prevention

When it happens

Trigger: 'podman top' invoked from a parent/process environment that ignores SIGCHLD (inherited SIG_IGN disposition, some LD_PRELOAD supervisors) → ECHILD; a signal (e.g. from a profiler, tty resize, or wrapper timeout) interrupting the wait → EINTR; races where the child was already reaped.

Common situations: Running podman top under process supervisors, language runtimes, or preload libraries that set SIGCHLD to SIG_IGN; monitoring stacks that signal the podman process; occasionally flaky CI where a signal lands mid-wait.

Related errors


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