Fix random main loop crashes.
This is a cherry-pick of https://android-review.googlesource.com/#/c/82762/
Fix random main loop crashes.
The recent qemu-timer.c back-port added random runtime crashes to
the emulator binary. The main reason for this is that some of the
clock-related functions now acquire/release global mutexes, and
they were being called from within the SIGALRM signal handler,
which could result, randomly, into a double-lock (that GLibc
detected by aborting on Linux).
Upstream doesn't use SIGALRM timers anymore, but the changes to
get there require moving CPU execution to its own thread, which
cannot be done just yet.
This patch fixes the issue by getting rid of any complicated
processing in the signal handler, and ensuring the corresponding
computations are performed in the main loop instead.
+ Get rid of obsolete icount handling code. While we may want to
re-enable that in the future, this will happen after the
upstream main-loop.c is back-ported.
+ Get rid of the Linux "hpet" and "rtc" alarm timers. These
only work when running the emulator as root, which isn't a
use case we want to support (and seriously, if you're going
to run QEMU as root, you're going to have a bad time!).
Change-Id: If8bd120fb64c6eadc731bc7a6f63ee03a4a30312
Change-Id: Ib08734cd2464c02e8e21cdf56036c1780a6d3252
1 file changed