Skip to content

Gate PRs on some tests running in an Android emulator on CI #21116

Closed

Description

@SimonSapin

#21094 adds ./mach test-android-startup, a minimal test based on the Android emulator. A next step (in addition to running more tests, such as a subset of WPT) is to add it somewhere in etc/ci/buildbot_steps.yml so that PRs need to make it pass before landing.

However, the current configuration of ./mach test-android-startup runs an emulator for Android x86. On CI machines, this fails to start with:

emulator: ERROR: x86 emulation currently requires hardware acceleration!
Please ensure KVM is properly installed and usable.
CPU acceleration status: KVM requires a CPU that supports vmx or svm

vmx and svm are other names for Intel VT-x and AMD-V, hardware support for virtualization. It appears that the AWS EC2 host machine is already using this support, so it not available to our already-virtualized guest instance.

On EC2, it appears possible to use VT-x on “bare metal” instance that are not already virtualized. However these only come ridiculously oversized (and so expensive) for this task.

An alternative would be to run those tests on macOS machines from Macstadium, since those run directly of “real” hardware.

Another might be to emulate Android ARM instead of x86. However so far I haven’t managed to start Servo in and ARM emulator because OpenGL ES 3 is required, but only GLES 2 is available in the configurations that I’ve tried.

https://android-developers.googleblog.com/2017/05/android-studio-3-0-canary1.html suggests that Android O (which is API level 26) or more recent is required for GLES3, but the most recent emulator system image available pre-built from Google at this time is API level 25. (https://stackoverflow.com/questions/43017539/cant-find-android-8-0-oreo-api-26-arm-system-images asks the same, https://developer.android.com/about/versions/oreo/android-8.0-migration mentions Intel x86 Atom System Image specifically.)

CC @jdm

Activity

  1. SimonSapin commented on Jul 2, 2018

    @SimonSapin
    MemberAuthor

    I have now managed to start Servo on emulated ARM with the API level 25 system image, but this was on a Macbook without giving a -gpu flag when starting the emulator, so it probably used the host’s hardware GPU. This configuration is likely not available on "normal" AWS EC2 machines that do not have a GPU.

  2. SimonSapin commented on Jul 2, 2018

    @SimonSapin
    MemberAuthor

    -gpu swiftshader_indirect also seems to work on mac (still with ARM), although it did not on my Linux desktop…

  3. SimonSapin commented on Jul 2, 2018

    @SimonSapin
    MemberAuthor
    emulator: ERROR: x86 emulation currently requires hardware acceleration!
    

    It turns out this isn’t quite the case! With -no-accel it doesn’t need KVM, but of course CPU emulation is a slow as for ARM. Also it prints:

    emulator: WARNING: x86 emulation may not work without hardware acceleration!
    

    … which probably means that this isn’t a supported configuration and that they might not be fixing bugs in it.

    Some simple programs do run correctly, but Servo gets another startup crash. With an unhelpful stack trace, despite debug mode.

    % adb -e logcat --pid 6546                                                                                                                                     
    --------- beginning of main
    07-03 01:12:58.731  6546  6546 I crash_dump32: obtaining output fd from tombstoned, type: kDebuggerdTombstone
    07-03 01:12:58.755  6546  6546 I crash_dump32: performing dump of process 6521 (target tid = 6542)
    --------- beginning of crash
    07-03 01:12:58.797  6546  6546 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    07-03 01:12:58.798  6546  6546 F DEBUG   : Build fingerprint: 'google/sdk_gphone_x86/generic_x86:9/PPP4.180612.007/4860066:userdebug/dev-keys'
    07-03 01:12:58.798  6546  6546 F DEBUG   : Revision: '0'
    07-03 01:12:58.798  6546  6546 F DEBUG   : ABI: 'x86'
    07-03 01:12:58.798  6546  6546 F DEBUG   : pid: 6521, tid: 6542, name: m.mozilla.servo  >>> com.mozilla.servo <<<
    07-03 01:12:58.798  6546  6546 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
    07-03 01:12:58.799  6546  6546 F DEBUG   : Cause: null pointer dereference
    07-03 01:12:58.799  6546  6546 F DEBUG   :     eax 00000046  ebx cb205978  ecx 846d4674  edx 00000046
    07-03 01:12:58.799  6546  6546 F DEBUG   :     edi cb2298ec  esi c9ad2cb4
    07-03 01:12:58.799  6546  6546 F DEBUG   :     ebp cb0762c0  esp cc8fef80  eip c780ad18
    07-03 01:12:59.184  6546  6546 F DEBUG   : 
    07-03 01:12:59.184  6546  6546 F DEBUG   : backtrace:
    07-03 01:12:59.184  6546  6546 F DEBUG   :     #00 pc 0ae85d18  /data/app/com.mozilla.servo-jCBLNjEHI2GL0hOS8N_cow==/lib/x86/libservo.so (mozalloc_abort(char const*)+56)
    07-03 01:12:59.184  6546  6546 F DEBUG   :     #01 pc 0ae85cdd  /data/app/com.mozilla.servo-jCBLNjEHI2GL0hOS8N_cow==/lib/x86/libservo.so (abort+29)
    07-03 01:12:59.184  6546  6546 F DEBUG   :     #02 pc 0b8e3eb4  /data/app/com.mozilla.servo-jCBLNjEHI2GL0hOS8N_cow==/lib/x86/libservo.so
    07-03 01:12:59.185  6546  6546 F DEBUG   :     #03 pc 0b8efc16  /data/app/com.mozilla.servo-jCBLNjEHI2GL0hOS8N_cow==/lib/x86/libservo.so
    07-03 01:12:59.185  6546  6546 F DEBUG   :     #04 pc 0b8f4149  /data/app/com.mozilla.servo-jCBLNjEHI2GL0hOS8N_cow==/lib/x86/libservo.so
    07-03 01:12:59.185  6546  6546 F DEBUG   :     #05 pc 0b8f3fdc  /data/app/com.mozilla.servo-jCBLNjEHI2GL0hOS8N_cow==/lib/x86/libservo.so (std::panicking::rust_panic_with_hook::h5ae31a806bf77aee+540)
    07-03 01:12:59.185  6546  6546 F DEBUG   :     #06 pc 0b8f3cb6  /data/app/com.mozilla.servo-jCBLNjEHI2GL0hOS8N_cow==/lib/x86/libservo.so
    07-03 01:12:59.185  6546  6546 F DEBUG   :     #07 pc 0b8f3968  /data/app/com.mozilla.servo-jCBLNjEHI2GL0hOS8N_cow==/lib/x86/libservo.so (rust_begin_unwind+24)
    07-03 01:12:59.185  6546  6546 F DEBUG   :     #08 pc 0b90eaa9  /data/app/com.mozilla.servo-jCBLNjEHI2GL0hOS8N_cow==/lib/x86/libservo.so (core::panicking::panic_fmt::h52dbeda324b6cedb+89)
    07-03 01:12:59.185  6546  6546 F DEBUG   :     #09 pc 02b06e29  /data/app/com.mozilla.servo-jCBLNjEHI2GL0hOS8N_cow==/lib/x86/libservo.so
    07-03 01:12:59.185  6546  6546 F DEBUG   :     #10 pc 02b04b5e  /data/app/com.mozilla.servo-jCBLNjEHI2GL0hOS8N_cow==/lib/x86/libservo.so
    07-03 01:12:59.185  6546  6546 F DEBUG   :     #11 pc 02baedd5  /data/app/com.mozilla.servo-jCBLNjEHI2GL0hOS8N_cow==/lib/x86/libservo.so
    07-03 01:12:59.185  6546  6546 F DEBUG   :     #12 pc 02b6f89a  /data/app/com.mozilla.servo-jCBLNjEHI2GL0hOS8N_cow==/lib/x86/libservo.so
    07-03 01:12:59.185  6546  6546 F DEBUG   :     #13 pc 02afd8aa  /data/app/com.mozilla.servo-jCBLNjEHI2GL0hOS8N_cow==/lib/x86/libservo.so
    07-03 01:12:59.185  6546  6546 F DEBUG   :     #14 pc 02b2d016  /data/app/com.mozilla.servo-jCBLNjEHI2GL0hOS8N_cow==/lib/x86/libservo.so
    07-03 01:12:59.186  6546  6546 F DEBUG   :     #15 pc 02bbf1b1  /data/app/com.mozilla.servo-jCBLNjEHI2GL0hOS8N_cow==/lib/x86/libservo.so
    07-03 01:12:59.186  6546  6546 F DEBUG   :     #16 pc 0008f065  /system/lib/libc.so (__pthread_start(void*)+53)
    07-03 01:12:59.186  6546  6546 F DEBUG   :     #17 pc 0002485b  /system/lib/libc.so (__start_thread+75)
    
  4. jdm commented on Jul 3, 2018

    @jdm
    Member

    To get a better backtrace, follow #20912 (comment).

  5. SimonSapin commented on Jul 4, 2018

    @SimonSapin
    MemberAuthor

    Thanks, though the warning suggests that x86 emulation without KVM is a configuration that is not supported at all and probably buggy (in addition to being very slow), so I don’t know that this lead is worth exploring further.

    With @larsbergstrom and @edunham we’ve been chatting on IRC about getting servers from https://www.packet.net/bare-metal/servers/ in order to run the emulator with KVM. The same provider is apparently being considered for running GeckoView tests in Android emulators.

  6. added a commit that references this issue on Jul 11, 2018
  7. SimonSapin commented on Jul 11, 2018

    @SimonSapin
    MemberAuthor

    Closing this is roughly the same as #21124.

  8. added a commit that references this issue on Jul 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions