Closed Bug 1562339 Opened 5 years ago Closed 5 years ago

'mach android-emulator' fails with SIG_SEGV (Address boundary error)

Categories

(Firefox for Android Graveyard :: Testing, defect, P3)

x86_64
Linux
defect

Tracking

(firefox77 fixed)

RESOLVED FIXED
Firefox 77
Tracking Status
firefox77 --- fixed

People

(Reporter: mythmon, Assigned: gbrown)

Details

(Whiteboard: dev-prod-2020)

Attachments

(2 files)

Attached file emulator.log

Running mach android-emulator on my system (Fedora 30) causes the emulator to open briefly and then close. The log file (attached) doesn't reveal anything interesting.

Running the command that is used directly produces a little more output, in the form of my shell reporting "SIG_SEGV (Address boundary error)".

Try 'mach android-emulator --force-update'; that will delete your avd, then re-create it from scratch -- in case there's something in the avd that is causing the emulator to crash.

Also, there is a small chance bug 1562938 will help.

Priority: -- → P3

--force-update doesn't change the behavior.

The patch from bug 1562938 changes the behavior, but I don't think it is actually helping. The emulator takes a bit longer to crash, but it is still crashing very quickly.

Whiteboard: dev-prod-2020

:mythmon - Can you try running 'mach android-emulator' again to see if this is still a problem? There have been several updates to the sdk/emulator since you reported the crash. (If you haven't lately, maybe run 'mach bootstrap' first, to pick up the latest emulator.)

Flags: needinfo?(mcooper)
Assignee: nobody → gbrown
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → INACTIVE

I'm hitting what I believe is the same issue, running on Fedora 31. I did a little digging, and was having seg faults with any x86 AVD, even those created myself in Android Studio. I was able to workaround the issue by switching the graphics mode of the AVD to software, rather than automatic (which must have been choosing hardware).

i.e. patching ~/.mozbuild/android-device/avd/mozemulator-x86-7.0.avd/config.ini and adding hw.gpu.mode=software allowed the AVD to boot and run.

Status: RESOLVED → REOPENED
Resolution: INACTIVE → ---

Thanks for figuring that out. It reminds me of bug 1311412: If specific gpu-related errors are seen on emulator startup, 'mach android-emulator' tries again without a -gpu argument. Maybe that logic can be refined for this case.

Sorry, but I'm not able to test this right now. The machine that was getting segfaults was my desktop that is locked up in a Mozilla office right now. If this is still ongoing once the pandemic is over, I can test it then.

Flags: needinfo?(mcooper)

No worries :mythmon. I think you probably hit the same issue as :smacleod: In some environments, the emulator will need to use a different gpu mode. I think the way forward is to allow greater flexibility in how mach starts the emulator:

  • add a --gpu argument to 'mach android-emulator' to allow over-riding the -gpu argument passed to the emulator;
  • check for an environment variable allow complete over-ride of the emulator command arguments.

Add a --gpu option to 'mach android-emulator' as a convenient way to over-ride the -gpu argument
passed to the emulator.
Also check the environment for MOZ_EMULATOR_COMMAND_ARGS to allow for additional over-rides
of the emulator command line.

Pushed by gbrown@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d1d49c6e816e Allow customization of command line used to start emulator by 'mach android-emulator'; r=jmaher
Status: REOPENED → RESOLVED
Closed: 5 years ago5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 77
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: