4.3 ARM version of emulator doesn't work

RESOLVED FIXED in Firefox 55

Status

()

Firefox for Android
Testing
P1
normal
RESOLVED FIXED
11 months ago
8 months ago

People

(Reporter: glasserc, Assigned: gbrown)

Tracking

unspecified
Firefox 55
Points:
---

Firefox Tracking Flags

(firefox55 fixed)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Reporter)

Description

11 months ago
./mach android-emulator, by default, runs the ARM emulator+AVD. On my computer, however, this doesn't work. I mentioned this in #mobile and :gbrown mentioned that the ARM version is broken currently, presumably due to recent changes in the Android SDK.

The emulator.log ends with messages like:

<**>> yaffs chunk 109532 was not erased>
<**>> yaffs write required 222 attempts>
<yaffs_read_super: isCheckpointed 0>
<kernel BUG at fs/yaffs2/yaffs_mtdif2.c:62!>
<Unable to handle kernel NULL pointer dereference at virtual address 00000000>
<pgd = f3b80000>
<[00000000] *pgd=33b6d031, *pte=00000000, *ppte=00000000>
<Internal error: Oops: 817 [#1]>
<CPU: 0    Not tainted  (2.6.29-gea477bb #1)>
<PC is at __bug+0x24/0x30>
<LR is at release_console_sem+0x180/0x194>
<pc : [<c002ba68>]    lr : [<c003e4c0>]    psr: 60000013>
<sp : f3821d28  ip : f3821c50  fp : f3821d34>
<r10: f3ab8c08  r9 : 00000000  r8 : 00000800>
<r7 : 0001aace  r6 : f3821db0  r5 : 00000000  r4 : f381c000>
<r3 : 00000000  r2 : c0300cf4  r1 : c0300d00  r0 : 0000002e>
<Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user>
<Control: 10c5387d  Table: 33b80019  DAC: 00000015>
<>
<PC: 0xc002b9e8:>

... followed by four or five pages of hex.
(Assignee)

Updated

11 months ago
Assignee: nobody → gbrown
Priority: -- → P1
(Assignee)

Comment 1

11 months ago
fwiw, 'mach android-emulator --version 6.0' still works for me.
Summary: ARM version of emulator doesn't work → 4.3 ARM version of emulator doesn't work
(Assignee)

Comment 2

11 months ago
https://developer.android.com/studio/run/emulator.html now says:

The version of Android Emulator described in this page requires the following:
    ...
    Newly created AVDs to replace any AVDs for emulator 24.0.x or lower
(Assignee)

Comment 3

10 months ago
Sorry for the slow progress here. 

As far as I can tell, comment 2 is valid: The new emulator will not run Android 4.3 AVDs created by earlier versions of the AVD manager, where "new" is approximately Android Tools 25.x.

Running the same AVD in automation and via 'mach android-emulator' is desirable: Potentially helpful for anyone trying to reproduce test failures from automation on their local workstation. So I need to create a new 4.3 AVD, check that it works locally with the new emulator, then try it out in our aws automation environment. Lots of testing...might take a while.
(Assignee)

Comment 4

9 months ago
Created attachment 8844545 [details] [diff] [review]
split out emulator tooltool manifest

My efforts to build a new avd started to bog down, so I looked at an alternative: Instead of upgrading the avd to work with newer emulators, use the old emulator: Download the emulator package in tooltool, used for automated tests. It broke nothing in automation and showed promise but did require yet another (partial) android sdk install on the desktop and ultimately failed because the tooltool downloads are not public. (:dustin reviewed sdk access policy with Marshall Erwin and Geoff Piper in 2015; we cannot distribute the emulator to developer computers.)

https://treeherder.mozilla.org/#/jobs?repo=try&revision=609baca056470eb37171ec868ebf212b04829e91
(Assignee)

Comment 5

9 months ago
Created attachment 8844546 [details] [diff] [review]
use emulator from tooltool in mach
(Assignee)

Comment 6

9 months ago
Comment on attachment 8844545 [details] [diff] [review]
split out emulator tooltool manifest

...so this won't work. I'll go back to my original strategy of updating the avd.
Attachment #8844545 - Attachment is obsolete: true
(Assignee)

Updated

9 months ago
Attachment #8844546 - Attachment is obsolete: true
(Assignee)

Comment 7

9 months ago
I have a new 4.3 avd now and it works great for me locally. I have these components installed:

Android SDK Tools          25.2.5
Android SDK Platform-tools 25.0.3
Android SDK Build-tools    23.0.3, 23.0.1

If I try to run it on aws, I can't run firefox: https://treeherder.mozilla.org/#/jobs?repo=try&revision=48c0b7fd88c96ac3c0d3633fd49d1e50159298d3

[task 2017-03-10T04:37:53.413777Z] 04:37:53     INFO -  Operating system: Android
[task 2017-03-10T04:37:53.414052Z] 04:37:53     INFO -                    0.0.0 Linux 3.4.67-01422-gd3ffcc7-dirty #1 PREEMPT Tue Sep 16 19:34:06 CEST 2014 armv7l
[task 2017-03-10T04:37:53.414259Z] 04:37:53     INFO -  CPU: arm
[task 2017-03-10T04:37:53.418111Z] 04:37:53     INFO -       ARMv7 ARM Cortex-A8 features: swp,half,thumb,fastmult,vfpv2,edsp,neon,vfpv3,tls
[task 2017-03-10T04:37:53.419381Z] 04:37:53     INFO -       1 CPU
[task 2017-03-10T04:37:53.419457Z] 04:37:53     INFO -  GPU: UNKNOWN
[task 2017-03-10T04:37:53.419509Z] 04:37:53     INFO -  Crash reason:  SIGSEGV
[task 2017-03-10T04:37:53.419557Z] 04:37:53     INFO -  Crash address: 0x0
[task 2017-03-10T04:37:53.419610Z] 04:37:53     INFO -  Process uptime: not available
[task 2017-03-10T04:37:53.419651Z] 04:37:53     INFO -  Thread 35 (crashed)
[task 2017-03-10T04:37:53.420316Z] 04:37:53     INFO -   0  libxul.so!mozilla::gl::GLContextEGLFactory::Create [GLContextProviderEGL.cpp:48c0b7fd88c9 : 182 + 0x0]
[task 2017-03-10T04:37:53.420385Z] 04:37:53     INFO -       r0 = 0x00000000    r1 = 0x00000000    r2 = 0xa06944db    r3 = 0xa45fc130
[task 2017-03-10T04:37:53.420456Z] 04:37:53     INFO -       r4 = 0xa0d2ee9c    r5 = 0x9d07e78c    r6 = 0x9d07e780    r7 = 0x00000000
[task 2017-03-10T04:37:53.421106Z] 04:37:53     INFO -       r8 = 0x00000000    r9 = 0x9d07e800   r10 = 0x9d07ec1c   r12 = 0x00000001
[task 2017-03-10T04:37:53.421496Z] 04:37:53     INFO -       fp = 0xa0aeeca0    sp = 0x9d07e770    lr = 0xb6e687a9    pc = 0x9efea71e
[task 2017-03-10T04:37:53.421563Z] 04:37:53     INFO -      Found by: given as instruction pointer in context
[task 2017-03-10T04:37:53.421647Z] 04:37:53     INFO -   1  libxul.so!mozilla::gl::GLContextProviderEGL::CreateForCompositorWidget [GLContextProviderEGL.cpp:48c0b7fd88c9 : 722 + 0x5]
[task 2017-03-10T04:37:53.421713Z] 04:37:53     INFO -       r4 = 0xa2a1a2a0    r5 = 0x9d07e800    r6 = 0x00000000    r7 = 0x9d07e910
[task 2017-03-10T04:37:53.421794Z] 04:37:53     INFO -       r8 = 0x9df96140    r9 = 0x9d07ead8   r10 = 0x9d07ec1c    fp = 0xa0aeeca0
[task 2017-03-10T04:37:53.422581Z] 04:37:53     INFO -       sp = 0x9d07e7d0    pc = 0x9efea7d5
[task 2017-03-10T04:37:53.422637Z] 04:37:53     INFO -      Found by: call frame info
[task 2017-03-10T04:37:53.423230Z] 04:37:53     INFO -   2  libxul.so!mozilla::layers::CompositorOGL::CreateContext [CompositorOGL.cpp:48c0b7fd88c9 : 143 + 0x9]
[task 2017-03-10T04:37:53.423304Z] 04:37:53     INFO -       r3 = 0x9dff0340    r4 = 0x9d07e7ec    r5 = 0x9d07e910    r6 = 0x00000000
[task 2017-03-10T04:37:53.423654Z] 04:37:53     INFO -       r7 = 0x9d07e910    r8 = 0x9df96140    r9 = 0x9d07ead8   r10 = 0x9d07ec1c
[task 2017-03-10T04:37:53.424708Z] 04:37:53     INFO -       fp = 0xa0aeeca0    sp = 0x9d07e7e0    pc = 0x9f057719
[task 2017-03-10T04:37:53.424767Z] 04:37:53     INFO -      Found by: call frame info
[task 2017-03-10T04:37:53.424840Z] 04:37:53     INFO -   3  libxul.so!mozilla::layers::CompositorOGL::Initialize [CompositorOGL.cpp:48c0b7fd88c9 : 233 + 0x7]
[task 2017-03-10T04:37:53.425465Z] 04:37:53     INFO -       r4 = 0x9df96140    r5 = 0x00000000    r6 = 0x00000000    r7 = 0x9d07e910
[task 2017-03-10T04:37:53.425539Z] 04:37:53     INFO -       r8 = 0x9d07ec1c    r9 = 0x9d07ead8   r10 = 0x9d07ec1c    fp = 0xa0aeeca0
[task 2017-03-10T04:37:53.426163Z] 04:37:53     INFO -       sp = 0x9d07e830    pc = 0x9f05fe95
[task 2017-03-10T04:37:53.426518Z] 04:37:53     INFO -      Found by: call frame info
[task 2017-03-10T04:37:53.426608Z] 04:37:53     INFO -   4  libxul.so!mozilla::layers::CompositorBridgeParent::NewCompositor [CompositorBridgeParent.cpp:48c0b7fd88c9 : 1408 + 0x5]
[task 2017-03-10T04:37:53.426672Z] 04:37:53     INFO -       r4 = 0x9e192400    r5 = 0x00000000    r6 = 0x9d07ead4    r7 = 0x9d07ead8
[task 2017-03-10T04:37:53.427021Z] 04:37:53     INFO -       r8 = 0x9d07ec1c    r9 = 0x9d07ebac   r10 = 0x9d07ec1c    fp = 0xa0aeeca0
[task 2017-03-10T04:37:53.427077Z] 04:37:53     INFO -       sp = 0x9d07eac0    pc = 0x9f044c11
[task 2017-03-10T04:37:53.427120Z] 04:37:53     INFO -      Found by: call frame info
[task 2017-03-10T04:37:53.427991Z] 04:37:53     INFO -   5  libxul.so!mozilla::layers::CompositorBridgeParent::InitializeLayerManager [CompositorBridgeParent.cpp:48c0b7fd88c9 : 1371 + 0x7]
[task 2017-03-10T04:37:53.428340Z] 04:37:53     INFO -       r4 = 0x9e192400    r5 = 0x9d07ec40    r6 = 0x9d07ebac    r7 = 0x9d07ec40
[task 2017-03-10T04:37:53.428410Z] 04:37:53     INFO -       r8 = 0x9d07ec13    r9 = 0x9d07ec14   r10 = 0x9d07ec1c    fp = 0xa292d99c
[task 2017-03-10T04:37:53.428459Z] 04:37:53     INFO -       sp = 0x9d07eba8    pc = 0x9f044cd5
[task 2017-03-10T04:37:53.428504Z] 04:37:53     INFO -      Found by: call frame info

[task 2017-03-10T04:40:03.193464Z] 04:40:03     INFO -  03-09 20:37:35.022 I/nsScreenManagerAndroid(  906): nsWindow[0xa1bde2a0]::Create 0x0 [0 0 100 100]
[task 2017-03-10T04:40:03.193696Z] 04:40:03     INFO -  03-09 20:37:35.122 V/GeckoDynamicToolbarAnimator(  906): Requested immediate toolbar animation to translation 0.0
[task 2017-03-10T04:40:03.193907Z] 04:40:03     INFO -  03-09 20:37:35.122 V/GeckoDynamicToolbarAnimator(  906): Changing animation to immediate jump
[task 2017-03-10T04:40:03.194148Z] 04:40:03     INFO -  03-09 20:37:35.752 D/GeckoLayerClient(  906): Screen-size changed to (800,1280)
[task 2017-03-10T04:40:03.194360Z] 04:40:03     INFO -  03-09 20:37:35.752 D/GeckoLayerClient(  906): Window-size changed to (800,1134)
[task 2017-03-10T04:40:03.194599Z] 04:40:03     INFO -  03-09 20:37:35.792 D/        (  906): HostConnection::get() New Host Connection established 0xb874a348, tid 984
[task 2017-03-10T04:40:03.194805Z] 04:40:03     INFO -  03-09 20:37:35.802 E/EGL_emulation(  906): rcCreateWindowSurface returned 0
[task 2017-03-10T04:40:03.195044Z] 04:40:03     INFO -  03-09 20:37:35.802 E/EGL_emulation(  906): tid 984: eglCreateWindowSurface(659): error 0x3003 (EGL_BAD_ALLOC)
[task 2017-03-10T04:40:03.195277Z] 04:40:03     INFO -  03-09 20:37:35.802 D/gralloc_ranchu(  906): gralloc_unregister_buffer: exiting HostConnection (is buffer-handling thread)
[task 2017-03-10T04:40:03.195486Z] 04:40:03     INFO -  03-09 20:37:35.822 W/google-breakpad(  906): ExceptionHandler::GenerateDump cloned child


That might be fixable, but I'm not going to try.  The aws setup has been stable for a long time now, while requirements for local emulators seem to change every few months, with sdk updates.  I think the time has come for us to use separate avds for automation on aws vs local tests via mach.
(Assignee)

Comment 8

9 months ago
Created attachment 8845949 [details] [diff] [review]
update tooltool manifests for avds used by mach android-emulator
Attachment #8845949 - Flags: review?(jmaher)
Comment on attachment 8845949 [details] [diff] [review]
update tooltool manifests for avds used by mach android-emulator

Review of attachment 8845949 [details] [diff] [review]:
-----------------------------------------------------------------

this is rubber stamp territory :)
Attachment #8845949 - Flags: review?(jmaher) → review+
(Assignee)

Comment 10

9 months ago
Full instructions for how this avd was created:


I did this on Ubuntu 16.04 with

Android SDK Tools          25.2.5
Android SDK Platform-tools 25.0.3
Android SDK Build-tools    23.0.3, 23.0.1
ARM EABI v7a System Image  18, rev 4

1. Open the Android AVD Manager
  - Ensure an Android SDK is installed on the local computer.
  - Run "android" to start the Android SDK Manager.
  - Select the "Tools" menu > "Manage AVDs..." to start the AVD Manager.
2. Create a device in the AVD Manager
  - Select the Device Definitions tab
  - Select New Device...
  - Create a new device with these parameters:
     Resolution: 800x1280
     Screen size: 5
     All sensors
     Both cameras
     Keyboard and Dpad
     RAM: 1024
     Size: large
     Screen ratio: long
     Density: xhdpi
     Buttons: Software
     Device states: all
3. Create an AVD in the AVD Manager
   - Select the Android Virtual Device tab
   - Select New...
   - Create an AVD with these parameters:
     Name "test-1"
     Device: select the device created in step 2
     Target: Android 4.3.1
     CPU: armeabi-v7a
     Hardware keyboard present
     Skin: Skin with dynamic hardware controls
     Front camera: emulated
     Back camera: emulated
     RAM: 1024
     VM Heap: 128
     Internal Storage: 600
     SD card: 600
     Use Host GPU
4. Edit ~/.android/avd/test-1.avd/config.ini and set hw.mainKeys=yes
5. (I used the shipped binaries rather than building custom ones.)
6. Start the emulator with the new AVD:
    - emulator -avd test-1
7. Customize settings in the emulator
    - clear the "Make yourself at home" first-run greeting
    - select applications icon: clear "Choose some apps" first-run greeting
    - open Settings and change:
     -- Display > Sleep - 30 minutes
     -- Display > Daydream - OFF
     -- Security > Screen lock - OFF
     -- Developer Options > Window animation scale - off
     -- Developer Options > Transition animation scale - off
     -- Developer Options > Animation duration scale - off
     -- Date & time > Automatic time-zone - off
     -- Date & time > Select time-zone - Pacific time
     -- Apps: disable these components:
       -- Daydream, Calculator, Calendar, Calendar Storage, Clock, Connectivity Test,
          Email, Example Wallpapers, Exchange Service, Homescreen Tips, Music, Widget Preview,
8. Customize data via adb:
    - adb shell mkdir /data/anr
    - adb shell chown system:system /data/anr
    - adb shell mkdir /data/tombstones
    - adb shell chown system:system /data/tombstones
9. Close the emulator
10. Create the AVD archive for export to tooltool, taking care to remove hardware-qemu.ini and updating the path in test-1.ini to /home/cltbld/...

Comment 11

9 months ago
Pushed by gbrown@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/1ed753667e0b
Update avd manifests for 'mach android-emulator', r=jmaher
(Assignee)

Comment 12

9 months ago
This works great for me on Ubuntu 16. :snorp tried it out on mac; he got a warning about gpu support, but the emulator booted and he could still run Firefox on it.
(Assignee)

Comment 13

9 months ago
Some users may need to run "mach android-emulator --force-update", just once, to get the good stuff here.

Comment 14

8 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/1ed753667e0b
Status: NEW → RESOLVED
Last Resolved: 8 months ago
status-firefox55: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 55
You need to log in before you can comment on or make changes to this bug.