devicemanagerADB getProcessList / processExists sometimes returns wrong pid

RESOLVED WONTFIX

Status

Testing
Mozbase
RESOLVED WONTFIX
5 years ago
a year ago

People

(Reporter: gbrown, Assigned: gbrown)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Assignee)

Description

5 years ago
devicemanager.processExists uses getProcessList to retrieve a list of pids and process names, then returns the pid associated with a specified process name. 

devicemanagerADB.getProcessList retrieves process info returned by ps, but the ps format is different on different devices. getProcessList tries to detect the format and adjust the returned process list accordingly, but the check is too simplistic:

            # we need to figure out if this is "user pid name" or "pid user vsz stat command"
            if els[1].isdigit():
                ret.append(list([int(els[1]), els[len(els) - 1], els[0]]))
            else:
                ret.append(list([int(els[0]), els[len(els) - 1], els[1]]))

On the Galaxy Nexus with Android 4.0.1, ps produces:

PID   USER     TIME   COMMAND
    1 root       0:04 /init
    2 root       0:00 [kthreadd]
    3 root       0:00 [ksoftirqd/0]
...
 9916 root       0:00 [kworker/1:0]
10030 10038      0:03 {a.fennec_mozdev} org.mozilla.fennec_mozdev
10113 root       0:00 /system/bin/sh -c ps
10115 root       0:00 ps

as a result, processExist may return 10038 as Fennec's pid.
(Assignee)

Comment 1

a year ago
Not such a problem with modern Android.
Assignee: nobody → gbrown
Status: NEW → RESOLVED
Last Resolved: a year ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.