Skip to content

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

Merged
giampaolo merged 9 commits intomasterfrom
refactor-c-pid-exists
Oct 5, 2016
Merged

Refactor C psutil_pid_exists(), fixes #783 and #855#908
giampaolo merged 9 commits intomasterfrom
refactor-c-pid-exists

Conversation

@giampaolo
Copy link
Copy Markdown
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