HomePhabricator

When matching process titles, don't attempt a match if we're out of "argv" parts

Authored by epriestley on Jun 25 2019, 10:18 PM.

Description

When matching process titles, don't attempt a match if we're out of "argv" parts

Summary:
Ref T13321. In general, if we try to match against "array('x', 'y')" and there's an "array('x')" process, we may run out of arguments before matching the whole pattern.

On Ubuntu, there are a bunch of system processes which look like [khugepaged] in ps. These have no /proc/123/cmdline, so we end up with an empty "argv", which is causing us to hit the bug. Just let this be for now, we don't currently care about these processes.

Test Plan: Ran bin/phd status on Ubuntu.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13321

Differential Revision: https://secure.phabricator.com/D20620