If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

possible false positives in isPidAlive

NEW
Unassigned

Status

Testing
Mochitest
4 years ago
a month ago

People

(Reporter: ted, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(URL)

We have a function in automation.py called "isPidAlive" that we use to check if child processes are still hanging around after the parent process exits. Reviewing jhammel's refactoring patch in bug 746243 (which moves the definitions around) I realized that this function is ripe for false positives. It simply checks whether a process with that PID is alive, but if the original process exits and a new process is spawned that re-uses that PID it will give a false positive.

We should probably be checking a second piece of information, like that the parent PID matches the parent we expect if the process is alive, or that the process filename matches the one we expect.
See Also: → bug 603147
Depends on: 523208

Comment 1

4 years ago
> It simply checks whether a process with that PID is alive, but...

(on non-windows, that is)

Comment 2

4 years ago
(In reply to Ted Mielczarek [:ted.mielczarek] from comment #0)
> We have a function in automation.py called "isPidAlive" that we use to check
> if child processes are still hanging around after the parent process exits.
> Reviewing jhammel's refactoring patch in bug 746243 (which moves the
> definitions around) I realized that this function is ripe for false
> positives. It simply checks whether a process with that PID is alive, but if
> the original process exits and a new process is spawned that re-uses that
> PID it will give a false positive.
> 
> We should probably be checking a second piece of information, like that the
> parent PID matches the parent we expect if the process is alive, or that the
> process filename matches the one we expect.

... or we could output the launch time and see if that is accurate
(In reply to Jeff Hammel [:jhammel] from comment #1)
> > It simply checks whether a process with that PID is alive, but...
> 
> (on non-windows, that is)

No, it does the same thing on Windows.
You need to log in before you can comment on or make changes to this bug.