{"record":{"id":"fb3e8235e5ef3dd0","repo":"podman-container-tools/podman","slug":"unable-to-print-to-string","errorCode":null,"errorMessage":"unable to print to string\n","messagePattern":"unable to print to string\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/rootless/rootless_linux.c","lineNumber":1036,"sourceCode":"      int r, fd;\n\n      close (p[0]);\n\n      setsid ();\n      pid = syscall_clone (SIGCHLD, NULL);\n      if (pid < 0)\n        _exit (EXIT_FAILURE);\n\n      if (pid)\n        {\n          char pid_str[12];\n          char *tmp_file_path = NULL;\n\n          sprintf (pid_str, \"%d\", pid);\n\n          if (asprintf (&tmp_file_path, \"%s/pause.pid.XXXXXX\", state_dir) < 0)\n            {\n              fprintf (stderr, \"unable to print to string\\n\");\n              kill (pid, SIGKILL);\n              _exit (EXIT_FAILURE);\n            }\n\n          if (tmp_file_path == NULL)\n            {\n              fprintf (stderr, \"temporary file path is NULL\\n\");\n              kill (pid, SIGKILL);\n              _exit (EXIT_FAILURE);\n            }\n\n          fd = mkstemp (tmp_file_path);\n          if (fd < 0)\n            {\n              fprintf (stderr, \"error creating temporary file: %m\\n\");\n              kill (pid, SIGKILL);\n              _exit (EXIT_FAILURE);\n            }","sourceCodeStart":1018,"sourceCodeEnd":1054,"githubUrl":"https://github.com/podman-container-tools/podman/blob/a2409076ef2fef60ad9ac046375dedc7d9410ef4/pkg/rootless/rootless_linux.c#L1018-L1054","documentation":"While creating the rootless pause process, the intermediate parent formats '<state_dir>/pause.pid.XXXXXX' with asprintf for an atomic (mkstemp + rename_noreplace) write of the pause PID (pkg/rootless/rootless_linux.c:1034-1039). This message means asprintf failed - i.e. ENOMEM - so the freshly forked pause child is SIGKILLed and the process _exits with failure, aborting the whole podman invocation before Go starts.","triggerScenarios":"Memory exhaustion (RLIMIT_AS/cgroup cap/OOM) at the exact moment podman sets up the pause process for the user namespace - the only realistic cause of asprintf failing for this short string.","commonSituations":"Tight 'ulimit -v' or MemoryMax on user sessions; hosts under heavy memory pressure when starting rootless containers; first podman command in a session (when the pause process is created).","solutions":["Raise memory limits: 'ulimit -v unlimited' and check 'systemctl show user-$(id -u) -p MemoryMax'","Check 'dmesg' for OOM activity and free memory, then retry the command","Retry after the system load drops - the condition is transient","If it recurs with sane limits, report upstream with memory-limit details"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# Guard memory limits before the first rootless podman command of a session\nulimit -v unlimited 2>/dev/null || true\nfree -m | awk 'NR==2 { if ($7 < 256) { print \"low memory: \" $7 \" MiB free\" > \"/dev/stderr\"; exit 1 } }'\npodman \"$@\"\n","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep RLIMIT_AS/cgroup memory limits generous in rootless sessions","Treat first-command OOM-style failures as a signal to check session limits","Retry once after memory pressure clears"],"tags":["memory","pause-process","rootless","c","oom"],"backgroundTag":null,"analyzedSha":"a2409076ef2fef60ad9ac046375dedc7d9410ef4","analyzedAt":"2026-08-15T15:57:05.625Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}