Android Emulator Won’t Start

The Android SDK has a device emulator.  I use it in Eclipse with the Android JUnit test framework.  A few days ago, the emulator refused to start.

From Window -> AVD Manager, I started one of the devices.  A dialog titled “Starting Android Emulator” came up.  Inside it, a progress bar ticked off ten seconds.  Then, nothing.  This behavior was the same for all my devices, from Android version 1.5 through version 4.0.3.

To see if the problem was related to Eclipse, I started the emulator from the command line.  To do this, you need the name of the AVD:

android list avd

Using my Android 1.5 virtual device, I tried to start it:

emulator -avd OldAndroid

And the result was “Segmentation fault”.  I turned on “verbose” and ran again:

emulator -verbose -avd OldAndroid

This prints out what’s happening.  The last line before the seg fault was:  “emulator: Initializing hardware OpenGLES emulation support”.  Next, I tried to see which system call failed:

strace emulator -avd OldAndroid

The last line there is a futex call with operation FUTEX_WAIT and no timeout.  This call was unfinished, resulting in the seg fault.  From the manual page for futex:  “This operation atomically verifies that the futex address uaddr still contains the value val, and sleeps awaiting FUTEX_WAKE on this futex address.”  The address appears in the lines above.

A bug report was filed today about this issue:  http://code.google.com/p/android/issues/detail?id=34233