#3644·youki

[Bug]: Container creation fails when pids.limit is set to 1

Author: moz-secCreated Jul 6, 2026Updated Sep 21, 2026
Labelskind/bug

Bug Description

When linux.resources.pids.limit is set to 0 in config.json at container creation time, youki create fails with a fork error in the intermediate process. runc handles this case by writing pids.max=1 and successfully creating the container, but youki fails outright.

This was discovered in #3634.

Steps to Reproduce

  1. Run youki spec to generate the default config.json.
  2. Edit config.json so that it runs a long-lived process and sets pids.limit to 0:
    json
    {
      "process": {
        "args": [
          "sleep",
          "1000"
        ]
      },
      "linux": {
        "cgroupsPath": "/runtime-test/update_common_limits",
        "resources": {
          "pids": {
            "limit": 0
          }
        }
      }
    }
    all other fields left at the youki spec default.
  3. Run youki create runtime-test.
  4. Observe that container creation fails.

For comparison, runc succeeds under the same config and ends up with pids.max=1:

bash
$ runc create runtime-test
$ cat /sys/fs/cgroup/runtime-test/update_common_limits/pids.max
1

youki fails with:

bash
$ youki create runtime-test
ERROR libcontainer::process::container_intermediate_process: failed to fork init process: failed to clone process
ERROR libcontainer::process::container_main_process: failed to run intermediate process failed to launch init process
ERROR libcontainer::container::builder_impl: failed to run container process intermediate process error failed to launch init process
ERROR youki: error in executing command: failed to create container: intermediate process error failed to launch init process
Error: failed to create container: intermediate process error failed to launch init process

Expectation

youki should succeed when pids.limit is 0, matching runc's behavior of setting pids.max=1

System and Setup Info

No response

Additional Context

  • Related PR: youki-dev/youki#3634
  • Related issue: youki-dev/youki#3594