{"record":{"id":"3ccb565bb8c3bba5","repo":"podman-container-tools/podman","slug":"waitpid-m","errorCode":null,"errorMessage":"waitpid: %m","messagePattern":"waitpid: %m","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"libpod/container_top_linux.c","lineNumber":102,"sourceCode":"              exit (special_exit_code);\n            }\n          if ((status = setns (r, CLONE_NEWUSER)) < 0)\n            {\n              fprintf (stderr, \"setns NEWUSER: %m\");\n              exit (special_exit_code);\n            }\n        }\n\n      /* use execve to unset all env vars, we do not want to leak anything into the container */\n      execve (argv[0], argv, NULL);\n      fprintf (stderr, \"execve: %m\");\n      exit (special_exit_code);\n    }\n\n  r = waitpid (pid, &status, 0);\n  if (r < 0)\n    {\n      fprintf (stderr, \"waitpid: %m\");\n      exit (special_exit_code);\n    }\n  if (WIFEXITED (status))\n    exit (WEXITSTATUS (status));\n  if (WIFSIGNALED (status))\n    exit (128 + WTERMSIG (status));\n  exit (special_exit_code);\n}\n","sourceCodeStart":84,"sourceCodeEnd":111,"githubUrl":"https://github.com/podman-container-tools/podman/blob/a2409076ef2fef60ad9ac046375dedc7d9410ef4/libpod/container_top_linux.c#L84-L111","documentation":"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).","triggerScenarios":"'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.","commonSituations":"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.","solutions":["Simply retry 'podman top' — EINTR is transient","Unset the SIG_IGN disposition on SIGCHLD in the wrapper/supervisor that launches podman (e.g. signal(SIGCHLD, SIG_DFL) before exec)","Remove LD_PRELOAD watchdogs/renice wrappers from the podman process environment","If reproducible, report upstream — wrapping the waitpid in TEMP_FAILURE_RETRY is the code-level fix"],"exampleFix":"// before (libpod/container_top_linux.c)\nr = waitpid (pid, &status, 0);\n\n// after\nTEMP_FAILURE_RETRY (r = waitpid (pid, &status, 0));","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"# EINTR during the helper's waitpid is transient — one retry suffices\n#!/bin/sh\nout=$(podman top \"$ctr\" 2>&1); rc=$?\nif [ $rc -eq 255 ] && printf '%s' \"$out\" | grep -q 'waitpid:.*Interrupted'; then\n  sleep 1\n  out=$(podman top \"$ctr\" 2>&1); rc=$?\nfi\n[ $rc -eq 0 ] || { echo \"$out\" >&2; exit $rc; }\nprintf '%s\\n' \"$out\"","preventionTips":["Do not launch podman from parents that set SIGCHLD to SIG_IGN (some supervisors/LD_PRELOADs do) — it makes the child unreapable (ECHILD)","Treat a single 255-exit with 'waitpid: Interrupted system call' as noise; alert only on repetition","Upstream fix is mechanical: wrap the waitpid in TEMP_FAILURE_RETRY like pkg/rootless/rootless_linux.c already does"],"tags":["podman-top","waitpid","signals"],"backgroundTag":null,"analyzedSha":"a2409076ef2fef60ad9ac046375dedc7d9410ef4","analyzedAt":"2026-08-15T15:57:05.625Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}