-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
reproc::run fails with 'Invalid Argument' in Docker container #105
Comments
Looks like the issue is limited to Arch hosts (or possibly only Kernels 6.3.7 and up). I tested on two machines (both Arch) and the above mentioned procedure resulted in "Invalid argument". I got to test it on a Ubuntu 22.04 machine (Kernel 5.15.0) the error does not occur. |
I finally go around to actually debugging the issue. The error occurs in the child process (setup GDB with For whatever reason in reproc/reproc/src/process.posix.c Lines 105 to 121 in 1c07bdb
getrlimit() returns limit.rlim_cur = 1073741815 = 0x3FFFFFF8 . This of course is much larger than the set limit of MAX_FD_LIMIT = 1024 * 1024 = 1048576 = 0x100000 .
The check reproc/reproc/src/process.posix.c Lines 231 to 237 in 1c07bdb
sigaction(SIGKILL, &action, NULL) -> errno=EINVAL which is ok and gets ignored, but errno is still set to EINVAL ).
|
Well, I guess I found the issue. Inside my Docker container (and only in the container) the file descriptor limit is set to an insanely high number, but not $ ulimit -a
-t: cpu time (seconds) unlimited
-f: file size (blocks) unlimited
-d: data seg size (kbytes) unlimited
-s: stack size (kbytes) 8192
-c: core file size (blocks) unlimited
-m: resident set size (kbytes) unlimited
-u: processes unlimited
-n: file descriptors 1073741816
-l: locked-in-memory size (kbytes) 8192
-v: address space (kbytes) unlimited
-x: file locks unlimited
-i: pending signals 253585
-q: bytes in POSIX msg queues 819200
-e: max nice 0
-r: max rt priority 0
-N 15: rt cpu time (microseconds) unlimited |
I was able to resolve the issue by running my Docker container with a more sane file descriptor limit: docker run --ulimit nofile=1024:1024 ... In VSCode {
//...
"runArgs": [
"--ulimit", "nofile=1024:1024"
],
// ...
} For Docker compose file follow https://stackoverflow.com/a/58093008/4069539 |
Duplicate of #82 |
I come here from debugging an issue with mamba-org/micromamba. Libmamba uses reproc++ to invoke shell scripts.
On my native Arch install this works fine. However, I'm trying to set up a devcontainer using Docker containers.
I tried compling reproc++ with examples just to be sure and lo and behold, running reproc examples in Docker:
This applies to all examples in reproc++/examples.
I tested using Debian- and Fedora-based images. Here is a minimal
Dockerfile
to quickly showcase my problem:Build the Docker image like so:
Invoke the Docker container, clone the repository, build the tests and execute them:
Again, I tested the same with an Fedora-based image, same result.
The text was updated successfully, but these errors were encountered: