25-08-2017, 09:32 PM
Platform-wide Deadlock Immunity for Mobile Phones
Platform-wide Deadlock Immunity for Mobile Phones.pdf (Size: 102.89 KB / Downloads: 53)
Introduction
Having deadlock immunity for mobile applications
is useful; we describe below a real deadlock that we
reproduced on an Android phone. The deadlock involves
Android’s NotificationManagerService and StatusBarService
classes, and freezes the entire phone’s interface.
Without deadlock immunity, the phone may
freeze whenever the user expands the status bar while
notifications are sent to the status bar. With deadlock immunity,
the phone hangs just once, then the deadlock is
deterministically avoided.
Dimmunix
Dimmunix is a tool for gaining immunity against
deadlocks with no assistance from programmers or users.
Dimmunix runs within the address space of the target
program. Dimmunix can be used by customers to defend
against deadlocks while waiting for a vendor patch,
and by software vendors as a safety net. Dimmunix handles
only mutex deadlocks, i.e., deadlocks involving mutex
(monitor) acquisitions. Therefore, in this paper we
refer only to mutex deadlocks.
Platform-wide Deadlock Immunity
We first explain the notions of platform-wide and
application-level deadlock immunity, from the user’s perspective.
Platform-wide immunitymeans that all applications
are immunized against deadlocks by default, without
having to be launched in a special way. Applicationlevel
immunity means that the applications are not immunized
by default against deadlocks, and have to be executed
in a special way to run with Dimmunix.
Deadlock Immunity for Android OS
In this section we explain the design choices we took
in the implementation of Android Dimmunix. First, we
explain our choice of implementing Dimmunix within
Android’s Dalvik VM. Second, we explain our decision
to store only the top frames in the outer call stacks; we
also show that, for synchronized blocks/methods, it is
safe to use outer call stacks of depth 1.
Conclusion
We implemented Dimmunix for Android OS, within
the Dalvik VM. Android Dimmunix provides deadlock
immunity to all the applications running on an Android
phone, with small performance and memory overheads,
i.e., 4-5% and 4%, respectively. Therefore, Android
Dimmunix is a practical solution for protecting mobile
applications against deadlock bugs.