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

Refactor C psutil_pid_exists(), fixes #783 and #855 #908

Merged
merged 9 commits into from
Oct 5, 2016

Conversation

giampaolo
Copy link
Owner

@giampaolo giampaolo commented Oct 5, 2016

This function wasn't properly checking the errno. As such it could erroneously raise NoSuchProcess or AccessDenied or mask the real OSError or RuntimeError for the following methods:

All BSDs: open_files()
FreeBSD: exe(), cwd(), connections()
NetBSD: exe(), num_fds()
OpenBSD: num_fds(), connections()
OSX: exe(), memory_full_info(), memory_maps(), threads(), connections()

Furthermore, this is supposed to fix #783 where Process.status() erroneously return running for zombie processes.

This also refactor psutil_pid_exists() which was unnecessarily replicated for different platforms and move it in a single place for all POSIX systems.

This also super-seeds #855.

@giampaolo giampaolo changed the title Refactor C psutil_pid_exists() Refactor C psutil_pid_exists(), fixes #783 and #855 Oct 5, 2016
@giampaolo giampaolo merged commit ae0143b into master Oct 5, 2016
@giampaolo giampaolo deleted the refactor-c-pid-exists branch October 5, 2016 09:46
@giampaolo giampaolo added the bug label Nov 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Process.status() returns 'running' for a ZombieProcess
1 participant