-
Notifications
You must be signed in to change notification settings - Fork 110
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
[BUG] lsof stuck in docker container for minutes #281
Comments
I cannot reproduce the bug running in Ubuntu 22.04 docker. Can you provide full strace log? |
The EBADF error is expected: Lines 115 to 132 in 6292bfc
|
@jiegec I never waited until it finishes. Probably because I have bigger
I'm running Arch Linux. |
@x-yuri Nice! Actually I dunno why either.. The code was written decades ago. Anyways, this should be fixed. |
Let's just drop it, while nobody's looking then? :) Joking aside, I guess it tries to avoid affecting the output, although I'm not sure I can say anything more specific on the matter (some specific cases). The other mystery is what |
I tried building locally in alpine docker, here is the strace output:
Which uses the UPDATE: There is another Lines 314 to 330 in 6292bfc
This is the culprit. |
Now, how did you do that?
Here's how they supposedly build |
@x-yuri I pushed a fix in master, however it seemed that musl does not provide closefrom() call, so an additional check to |
But that means the issue shouldn't be closed yet? On a side note, can you possibly explain what I'm missing when building from a cloned repository?
UPD Created a separate issue (#283). |
Done in commit 124ab0f |
The fix above does not help for platforms which do not have closefrom or close_range (eg: SuSE SLES 15). |
Describe the bug
I am unable to use lsof from within docker container (tried with ubuntu and fedora) on Archlinux host with latest stable kernel (tested with 6.2.6 and 6.2.5). If I run it within the container from root user, it gets stuck for at least a few minutes. After a few minutes it provides output as expected.
Not sure if this is because of Arch host, latest kernel or latest docker version but on Arch with latest kernel and docker I managed to reproduce it on different machines. Tested with ancient debian host and it worked fine there.
My guess it has something to do with kernel version and cgroups but that is just a guess. 🙂
On the host itself lsof works fine.
To Reproduce
Steps to reproduce the behavior:
docker run -it ubuntu
ordocker run -it fedora
lsof
withapt-get update && apt-get install lsof
or in case of fedorayum install lsof
lsof
from container as root without any parameters and see it get stuck and provide no output.Expected behavior
It should not get stuck for minutes.
Program output
After a few minutes you get correct output.
Environment (please complete the following information):
Additional context
Possibly related to #147
Running it with strace it seems to go into an endless loop of trying to close some handler and getting
EBADF (Bad file descriptor)
The text was updated successfully, but these errors were encountered: