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

[OpenBSD, NetBSD] zombie process has no ctime (breaks is_running()) #2287

Closed
giampaolo opened this issue Aug 2, 2023 · 0 comments
Closed

Comments

@giampaolo
Copy link
Owner

giampaolo commented Aug 2, 2023

Summary

  • OS: OpenBSD, NetBSD
  • Type: core

Description

On OpenBSD and NetBSD, zombie processes have a creation time of 0.0. The example below shows how a process starts normally (so it has a ctime), then it turns into a zombie. This breaks is_running() and also has repercussions on __eq__ and __hash__, which is used to allow creating a set() of uniue Process() objects.

(Pdb) parent, zombie = self.spawn_zombie()
(Pdb) zombie
psutil.Process(pid=35360, name='python3.8', status='zombie', started='00:04:16')
(Pdb) psutil.Process(zombie.pid)
psutil.Process(pid=33393, name='python3.8', status='zombie', started='1970-01-01 00:00:00')
(Pdb) psutil.Process(zombie.pid).create_time()
0.0 
(Pdb) zombie.is_running()  # should be True
False 
@giampaolo giampaolo added the bug label Aug 2, 2023
@giampaolo giampaolo changed the title [OpenBSD] zombie process has no ctime (breaks is_running(), __eq__ and __hash__) [OpenBSD, NetBSD] zombie process has no ctime (breaks is_running()) Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant