[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
- Run
youki specto generate the defaultconfig.json. - Edit
config.jsonso that it runs a long-lived process and setspids.limitto0:all other fields left at the{ "process": { "args": [ "sleep", "1000" ] }, "linux": { "cgroupsPath": "/runtime-test/update_common_limits", "resources": { "pids": { "limit": 0 } } } }youki specdefault. - Run
youki create runtime-test. - Observe that container creation fails.
For comparison, runc succeeds under the same config and ends up with pids.max=1:
$ runc create runtime-test
$ cat /sys/fs/cgroup/runtime-test/update_common_limits/pids.max
1youki fails with:
$ 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 processExpectation
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
Source: youki-dev/youki