Skip to content
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

Ensure no zombie processes are left over by run.sh #47

Merged
merged 10 commits into from
Oct 23, 2023

Conversation

rodja
Copy link
Member

@rodja rodja commented Oct 20, 2023

This PR applies some additional checks to ensure we do not create zombie processes. In one of our projects we saw many of these:

message+  725270  0.0  0.0      0     0 ?        Zs   Okt19   0:00 [exim4] <defunct>
message+  725271  0.0  0.0      0     0 ?        Zs   Okt19   0:00 [exim4] <defunct>
root      725282  0.0  0.0      0     0 ?        Zs   Okt19   0:00 [sudo] <defunct>
root      725285  0.0  0.0      0     0 ?        Zs   Okt19   0:00 [sudo] <defunct>
message+  725288  0.0  0.0      0     0 ?        Zs   Okt19   0:00 [exim4] <defunct>
message+  725289  0.0  0.0      0     0 ?        Zs   Okt19   0:00 [exim4] <defunct>
root      725297  0.0  0.0      0     0 ?        Zs   Okt19   0:00 [sudo] <defunct>
root      725300  0.0  0.0      0     0 ?        Zs   Okt19   0:00 [sudo] <defunct>
message+  725303  0.0  0.0      0     0 ?        Zs   Okt19   0:00 [exim4] <defunct>
message+  725304  0.0  0.0      0     0 ?        Zs   Okt19   0:00 [exim4] <defunct>
root      725309  0.0  0.0      0     0 ?        Z    Okt19   0:00 [sudo] <defunct>
root      725311  0.0  0.0      0     0 ?        Zs   Okt19   0:00 [sudo] <defunct>
root      725314  0.0  0.0      0     0 ?        Zs   Okt19   0:00 [sudo] <defunct>
root      725316  0.0  0.0      0     0 ?        Z    Okt19   0:00 [arp-scan] <defunct>
message+  725317  0.0  0.0      0     0 ?        Zs   Okt19   0:00 [exim4] <defunct>
message+  725318  0.0  0.0      0     0 ?        Zs   Okt19   0:00 [exim4] <defunct>
root      725326  0.0  0.0      0     0 ?        Z    Okt19   0:00 [sudo] <defunct>
root      725328  0.0  0.0      0     0 ?        Zs   Okt19   0:00 [sudo] <defunct>
root      725331  0.0  0.0      0     0 ?        Zs   Okt19   0:00 [sudo] <defunct>
root      725333  0.0  0.0      0     0 ?        Z    Okt19   0:00 [arp-scan] <defunct>

Which leads to BlockingIOError: [Errno 11] Resource temporarily unavailable down the road (when Linux can't create any more processes).

@rodja rodja added the bug Something isn't working label Oct 20, 2023
@rodja rodja added this to the 0.9.3 milestone Oct 20, 2023
@rodja
Copy link
Member Author

rodja commented Oct 20, 2023

It's still happening. So I need to investigate it further tomorrow.

@rodja rodja changed the title Ensure not zombie processes are created by run.sh Ensure no zombie processes are created by run.sh Oct 21, 2023
@rodja rodja changed the title Ensure no zombie processes are created by run.sh Ensure no zombie processes are left over by run.sh Oct 21, 2023
@rodja rodja marked this pull request as ready for review October 21, 2023 09:28
@rodja
Copy link
Member Author

rodja commented Oct 21, 2023

After many general improvements to run.sh I still got a lot of zombie processes. Then I discovered that calling a command with sudo in a docker container creates a zombie process. This is fixed with cc72d89 in this PR. But still I got a slow increasing count of zombie processes. After some digging I saw that it was caused by SIGKILL as abort signal for the timeout (fixed in 3024e48).

@falkoschindler falkoschindler merged commit 6c70eda into main Oct 23, 2023
2 checks passed
@falkoschindler falkoschindler deleted the run-sh-zombies branch October 23, 2023 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants