Closed
Bug 1514363
Opened 7 years ago
Closed 7 years ago
Cannot run mochitests on my phone: "ADBError: Only one instance of an application may be running at once" (unexpected pidof output on some devices)
Categories
(Firefox for Android Graveyard :: Testing, defect)
Tracking
(firefox64 unaffected, firefox65 unaffected, firefox66 fixed)
RESOLVED
FIXED
Firefox 66
| Tracking | Status | |
|---|---|---|
| firefox64 | --- | unaffected |
| firefox65 | --- | unaffected |
| firefox66 | --- | fixed |
People
(Reporter: JanH, Assigned: gbrown)
References
Details
(Keywords: regression)
Attachments
(2 files, 1 obsolete file)
|
4.41 KB,
text/plain
|
Details | |
|
1.58 KB,
patch
|
bc
:
review+
|
Details | Diff | Splinter Review |
I'm trying to run a mochitest on my phone, but can't because of the aforementioned error.
Backing out bug 1512686 unbreaks things again.
Flags: needinfo?(gbrown)
Comment 1•7 years ago
|
||
You are running Android 6.0 – 6.0.1. What model phone and how rooted?
It would be interesting to see the output of
adb shell pidof org.mozilla.fennec_jan
and
adb shell ps | grep org.mozilla.fennec_jan
with fennec running.
| Reporter | ||
Comment 2•7 years ago
|
||
>(In reply to Bob Clary [:bc:] from comment #1)
> You are running Android 6.0 – 6.0.1.
The latter (6.0.1).
> What model phone
Moto G4 Play
> and how rooted?
Rooted yes, but I'm not quite sure what you're driving at by "how"?
> It would be interesting to see the output of
>
> adb shell pidof org.mozilla.fennec_jan
1 2 3 5 7 8 9 10 11 12 14 15 16 18 19 20 22 23 24 29 30 31 32 33 34 35 36 37 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 94 95 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 144 145 146 147 148 170 171 172 173 174 175 176 177 178 182 183 184 185 186 187 188 189 190 191 192 193 194 195 200 201 205 206 208 210 211 212 213 214 215 216 218 219 232 233 243 252 338 345 346 385 515 614 615 616 617 618 619 621 624 625 633 669 686 687 688 689 690 691 693 701 703 705 716 717 718 720 725 727 728 734 735 748 807 808 809 810 811 812 814 815 863 941 956 958 985 1005 1097 1257 1325 2141 2282 2647 2935 3076 3696 4185 4222 4268 4343 4437 4549 4637 4716 4970 5147 5340 5388 5411 5431 5715 6211 6249 6357 6472 6692 6695 6829 6845 6909 7134 7186 7227 7253 7270 7286 7320 7430 7468 7804 7824 8034 9232 10217 10241 10292 10388 10431 10834 10939 10967 11379 11684 11834 12853 12865 12999 13055 14795 17258 17859 18072 18664 18805 18868 20363 22346 22629 22694 22701 23282 23389 25537 25844 26024 26263 26578 28086 28311 28599 28612 28645 29573 29574 29575 29576 29578 29580 29826 30028 30078 30151 30187 30211 30239 30251 30262 30287 30356 30513 30558 30566 31404 31569 32398
> adb shell ps | grep org.mozilla.fennec_jan
u0_a844 6211 716 1264932 190668 SyS_epoll_ 00000000 S org.mozilla.fennec_jan
Seems like there's something fishy about my phone's "pidof" command. I also have busybox and if I run busybox's pidof, it returns the correct answer.
| Assignee | ||
Comment 3•7 years ago
|
||
Yes, that pidof output is very surprising! :)
Assignee: nobody → gbrown
Flags: needinfo?(gbrown)
Comment 4•7 years ago
|
||
by "how rooted", I meant what technique did you use to root it or is this a vanilla AOSP build? Doesn't really matter I guess.
hmm. does executing pidof from inside the shell make any difference?
adb shell
pidof org.mozilla.fennec_jan
What does pidof --help say? Something like:
walleye:/ $ pidof --help
usage: pidof [-s] [-o omitpid[,omitpid...]] [NAME]...
Print the PIDs of all processes with the given names.
-s single shot, only return one pid
-o omit PID(s)
| Reporter | ||
Comment 5•7 years ago
|
||
(In reply to Bob Clary [:bc:] from comment #4)
> by "how rooted", I meant what technique did you use to root it or is this a
> vanilla AOSP build? Doesn't really matter I guess.
By unlocking the bootloader, flashing a custom recovery and then an SU app. I.e. basically this is still the manufacturer's Android build.
> hmm. does executing pidof from inside the shell make any difference?
>
> adb shell
> pidof org.mozilla.fennec_jan
Nope, same result (even with a root shell).
> What does pidof --help say? Something like:
>
> walleye:/ $ pidof --help
> usage: pidof [-s] [-o omitpid[,omitpid...]] [NAME]...
>
> Print the PIDs of all processes with the given names.
>
> -s single shot, only return one pid
> -o omit PID(s)
The above, plus "pidof: Needs 1 argument".
| Assignee | ||
Comment 6•7 years ago
|
||
I see some statements on the internet that pidof was introduce in Android 7.0, so it is a little surprising to find it on 6.0.1. Maybe we should force _have_pidof=False when running on < 7.0?
Comment 7•7 years ago
|
||
That seems reasonable to me.
| Assignee | ||
Comment 8•7 years ago
|
||
Android version (self.version) is in ADBAndroid; _pidof/process_exist/kill are in ADBDevice ... appropriate, but inconvenient.
| Assignee | ||
Updated•7 years ago
|
Summary: Cannot run mochitests on my phone: "ADBError: Only one instance of an application may be running at once" → Cannot run mochitests on my phone: "ADBError: Only one instance of an application may be running at once" (unexpected pidof output on some devices)
| Assignee | ||
Comment 9•7 years ago
|
||
I didn't pursue the idea of restricting pidof based on android version because of comment 8. I was tempted to work around that issue by collapsing ADBDevice and ADBAndroid into one class, but that's a bit of work and perhaps :bc would not approve?
I also think there's a good argument for a wontfix resolution here, but I'd prefer to help JanH, and I'm not sure who else might be affected.
So here's another strategy: If pidof returns more than 5 pids for a request, consider that suspicious, and fall back to ps.
:JanH - Does this work for you?
Attachment #9032174 -
Flags: review?(bob)
Attachment #9032174 -
Flags: feedback?(jh+bugzilla)
Comment 10•7 years ago
|
||
gbrown, I looked at the situation after reading comment 8. I'm not sure about merging them into one class simply because there might be cases where someone is actually referencing ADBDevice instead of ADBAndroid or vice versa.
If we only care about our own needs then I would be ok with merging the classes as well. I think 'androidisms' have already crept into ADBDevice and the separation is not meaningful and only causes harm. If you want to submit a patch that does the merger and fixes all references in tree, I'll review it with the idea of approving the change. What would you call the remaining class? ADBDevice or ADBAndroid? I'm leaning towards ADBDevice fwiw.
| Assignee | ||
Comment 11•7 years ago
|
||
Comment on attachment 9032174 [details] [diff] [review]
stop using pidof if it returns more that 5 pids for a request
Let's try a different approach...
Attachment #9032174 -
Flags: review?(bob)
Attachment #9032174 -
Flags: feedback?(jh+bugzilla)
| Assignee | ||
Comment 12•7 years ago
|
||
Attachment #9032174 -
Attachment is obsolete: true
Attachment #9032301 -
Flags: review?(bob)
Comment 13•7 years ago
|
||
Comment on attachment 9032301 [details] [diff] [review]
do not try to use pidof on Android < 7.0
Review of attachment 9032301 [details] [diff] [review]:
-----------------------------------------------------------------
r+. Thanks.
Attachment #9032301 -
Flags: review?(bob) → review+
Comment 14•7 years ago
|
||
Pushed by gbrown@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/ee7929753894
Do not try to use pidof on android versions before 7.0; r=bc
Comment 15•7 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 66
Updated•7 years ago
|
status-firefox64:
--- → unaffected
status-firefox65:
--- → unaffected
Updated•5 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•