mozregression doesn't work on Kindle Fire HD8

RESOLVED FIXED

Status

defect
RESOLVED FIXED
2 months ago
2 months ago

People

(Reporter: kats, Assigned: kats)

Tracking

65 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [leave-open])

Attachments

(1 attachment)

I was trying to use mozregression with the GVE app (-n gve) on a Kindle Fire HD8 device, but it doesn't work. The reason seems to be that mozdevice successfully creates a profile at /storage/sdcard0/tests/whatever.mozrunner but then the app can't actually read that profile.

mozdevice code that picks this path: https://searchfox.org/mozilla-central/rev/b2d35912da5b2acecb0274eb113777d344ffb75e/testing/mozbase/mozdevice/mozdevice/adb.py#992

GVE code that fails at reading the path: https://searchfox.org/mozilla-central/rev/b2d35912da5b2acecb0274eb113777d344ffb75e/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoProfile.java#195 (I see the warning printed there in the logcat)

and then the GVE code that crashes shortly after: https://searchfox.org/mozilla-central/rev/b2d35912da5b2acecb0274eb113777d344ffb75e/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoProfile.java#353

Other devices I've tried don't have this problem, for two reasons. One is that the app can actually read from the dir. And second, even if I run via am start manually and give it a profile dir in /storage/sdcard0/tests that doesn't actually exist, the app can create the dir and proceed with initializing a fresh profile. This also fails on the HD8.

I'm not sure if this is fixable but it would be nice if mozdevice somehow detected that the /storage/sdcard0/tests path is not readable by the app on this device and tried a different one that might work better. On the HD8, for example using /sdcard/tests works fine.

Looks like the ordering of paths here comes from FxOS requirements way back in bug 999506 comment 8 so it might not be trivial to change.

:bc do you have any ideas? mozregression is currently pinned to mozdevice 2.0 but it doesn't appear that anything has landed since that release that would change the behaviour here.

Flags: needinfo?(bob)

Comment 3

2 months ago

mid-aired...

What is the warning printed in logcat? kats: Can you go ahead and attach the logcat or point to a log / logcat somewhere?

Flags: needinfo?(bob)

The logcat isn't very interesting. Here's the relevant section of logcat from the HD8:

03-07 14:55:03.963 E/GeckoLibLoad(17074): Loaded libs in 33.429385ms total, 20ms(40ms) user, 0ms(10ms) system, 0(0) faults
03-07 14:55:03.963 D/GeckoThread(17074): State changed to LIBS_READY             
03-07 14:55:03.963 W/GeckoThread(17074): zerdatime 881630491 - runGecko          
03-07 14:55:03.970 W/GeckoProfile(17074): requested profile directory missing: /storage/sdcard0/tests/tmpDZ4A6x.mozrunner
--------- beginning of crash                                                     
03-07 14:55:03.972 E/AndroidRuntime(17074): FATAL EXCEPTION: Gecko               
03-07 14:55:03.972 E/AndroidRuntime(17074): Process: org.mozilla.geckoview_example, PID: 17074
03-07 14:55:03.972 E/AndroidRuntime(17074): java.lang.IllegalArgumentException: Profile directory must exist if specified: /storage/sdcard0/tests/tmpDZ4A6x.mozrunner
03-07 14:55:03.972 E/AndroidRuntime(17074):     at org.mozilla.gecko.GeckoProfile.<init>(GeckoProfile.java:354)
03-07 14:55:03.972 E/AndroidRuntime(17074):     at org.mozilla.gecko.GeckoProfile.get(GeckoProfile.java:245)
03-07 14:55:03.972 E/AndroidRuntime(17074):     at org.mozilla.gecko.GeckoProfile.get(GeckoProfile.java:199)
03-07 14:55:03.972 E/AndroidRuntime(17074):     at org.mozilla.gecko.GeckoProfile.initFromArgs(GeckoProfile.java:163)
03-07 14:55:03.972 E/AndroidRuntime(17074):     at org.mozilla.gecko.GeckoThread.getProfile(GeckoThread.java:349)
03-07 14:55:03.972 E/AndroidRuntime(17074):     at org.mozilla.gecko.GeckoThread.getMainProcessArgs(GeckoThread.java:301)
03-07 14:55:03.972 E/AndroidRuntime(17074):     at org.mozilla.gecko.GeckoThread.run(GeckoThread.java:449)

And the equivalent section of logcat from a Nexus 4 (where things work):

03-07 14:53:13.488 W/GeckoThread( 6884): zerdatime 579606 - runGecko             
03-07 14:53:13.501 W/GeckoProfile( 6884): requested profile directory missing: /storage/sdcard0/tests/tmpDZ4A6x.mozrunner
03-07 14:53:13.508 I/GeckoProfile( 6884): Enqueuing profile init.                
03-07 14:53:13.541 I/ActivityManager(  560): Start proc 6912:org.mozilla.geckoview_example:tab/u0a91 for service org.mozilla.geckoview_example/org.mozilla.gecko.process.GeckoServiceChildProcess$tab

Reading through bug 999506 (in particular dhylands' comment here) it sounds like /storage/sdcard0 and /storage/sdcard1 are specific to FxOS devices that are not really used anymore. So maybe it's ok to rearrange this list ordering now.

I tried using vdc volume list on the HD8 but there's no vdc command. So I'm not sure how easy this would be to determine dynamically.

Another option is to add a command-line argument to mozregression that forces mozdevice to use a particular root. Which is probably good to do anyway since there's no guarantee that one particular list of hard-coded paths will work for all devices.

Comment 6

2 months ago

Why is it trying to use a non-existent directory for the profile. Did we just rely on Gecko creating it for us in the past? Could we just make sure to create it first before attempting to use it?

The directory exists. I verified by adb shell-ing into the device and checking for it. GVE just can't read it for whatever reason. See comment 0.

Comment 8

2 months ago

Can you tell me what ls -la says for the directory?

karnak:/storage/sdcard0/tests $ ls -al
total 32
drwxrwx--x  4 root sdcard_rw 4096 2019-03-08 06:28 .
drwxrwx--x 17 root sdcard_rw 4096 2019-03-07 15:11 ..
drwxrwx--x  2 root sdcard_rw 4096 2019-03-08 06:28 dummy
drwxrwx--x  2 root sdcard_rw 4096 2019-03-08 06:28 tmpItsvAu.mozrunner
karnak:/storage/sdcard0/tests/tmpItsvAu.mozrunner $ ls -al
total 24
drwxrwx--x 2 root sdcard_rw 4096 2019-03-08 06:28 .
drwxrwx--x 4 root sdcard_rw 4096 2019-03-08 06:28 ..
-rw-rw---- 1 root sdcard_rw    0 2019-03-08 06:28 prefs.js
-rw-rw---- 1 root sdcard_rw  819 2019-03-08 06:28 user.js

I put a patch at https://github.com/mozilla/mozregression/pull/515 that works around the issue for me, I can specify --adb-profile-path=/sdcard/tests and that works (at least GVE doesn't crash on startup).

Blocks: 1533704

Comment 11

2 months ago

gbrown: Do you think we could try to just remove '/storage/sdcard0/tests', '/storage/sdcard1/tests' from the list of possible test roots?

Flags: needinfo?(gbrown)

(In reply to Bob Clary [:bc:] from comment #11)

gbrown: Do you think we could try to just remove '/storage/sdcard0/tests', '/storage/sdcard1/tests' from the list of possible test roots?

I think that might be fine. Those directories do not exist in the emulator images we use.

Flags: needinfo?(gbrown)
Attachment #9049942 - Attachment description: Bug 1533517 - Remove paths that don't work so well for reading/writing. r?bc → Bug 1533517 - [mozdevice] Remove FirefoxOS candidate test root paths. r?bc

Comment 14

2 months ago

Comment on attachment 9049942 [details]
Bug 1533517 - [mozdevice] Remove FirefoxOS candidate test root paths. r?bc

r+. Already marked in phabricator. Once this lands and merges we can deploy to pypi.

Attachment #9049942 - Attachment description: Bug 1533517 - [mozdevice] Remove FirefoxOS candidate test root paths. r?bc → Bug 1533517 - Remove paths that don't work so well for reading/writing. r?bc
Attachment #9049942 - Flags: review+

Comment 15

2 months ago

leave open for the pypi update and the associated changes to mozregression.

Whiteboard: [leave-open]
Attachment #9049942 - Attachment description: Bug 1533517 - Remove paths that don't work so well for reading/writing. r?bc → Bug 1533517 - [mozdevice] Remove FirefoxOS candidate test root paths. r?bc

Bob, do you have permissions to push the updated version to pypi?

Flags: needinfo?(bob)

Comment 19

2 months ago

kats: yes, I'll get to it later today.

Comment 20

2 months ago

mozdevice 3.0.1 is now available on pypi.

Flags: needinfo?(bob)

Bumped internal dependency in mozregression: https://github.com/mozilla/mozregression/commit/45b0de32e21f6d4b5d1ee70d6ac2c1dcc5a69987

I will do a new release next week

Thanks!

Assignee: nobody → kats
Status: NEW → RESOLVED
Last Resolved: 2 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.