Skip to content

Conversation

@jnovy
Copy link
Collaborator

@jnovy jnovy commented Oct 29, 2025

Change sync_pipe_fd checks from > 0 to >= 0 to properly handle the case where file descriptor 0 is used for the sync pipe.

Fixes: containers/podman#27335

This commit addresses multiple issues related to sync_pipe_fd handling:

1. Change sync_pipe_fd checks from > 0 to >= 0 to properly handle
   the case where file descriptor 0 is used for the sync pipe.

2. Add missing error reporting in terminal_accept_cb() when receiving
   the console file descriptor fails. Previously, conmon would call
   pexit() directly, exiting without writing to sync_pipe_fd. This
   caused podman to receive empty data and show JSON parse errors.

3. Add missing error reporting when pidfile read fails. Previously,
   if g_file_get_contents() failed to read the container pidfile,
   conmon would exit(1) without writing to sync_pipe_fd, causing
   podman to receive empty data and show JSON parse errors.

This fix ensures that when the runtime fails (e.g., due to missing
cgroup controllers), conmon properly reports the error to podman
instead of silently closing the pipe.

Fixes: containers/podman#27335

Signed-off-by: Jindrich Novy <jnovy@redhat.com>
Copy link

@samifruit514 samifruit514 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rootless podman with runc gives inconsistent error messages when using options that depend on missing cgroup v2 controllers

2 participants