Abstract
Programming environments for smartphones expose a concurrency model that combines multi-threading and asynchronous event-based dispatch. While this enables the development of efficient and feature-rich applications, unforeseen thread interleavings coupled with non-deterministic reorderings of asynchronous tasks can lead to subtle concurrency errors in the applications.
In this paper, we formalize the concurrency semantics of the Android programming model. We further define the happens-before relation for Android applications, and develop a dynamic race detection technique based on this relation. Our relation generalizes the so far independently studied happens-before relations for multi-threaded programs and single-threaded event-driven programs. Additionally, our race detection technique uses a model of the Android runtime environment to reduce false positives.
We have implemented a tool called DroidRacer. It generates execution traces by systematically testing Android applications and detects data races by computing the happens-before relation on the traces. We analyzed 15 Android applications including popular applications such as Facebook, Twitter and K-9 Mail. Our results indicate that data races are prevalent in Android applications, and that DroidRacer is an effective tool to identify data races.
- J. Alves-Foss, editor. Formal Syntax and Semantics of Java, volume 1523 of LNCS, 1999. Google Scholar
Digital Library
- D. Amalfitano, A. R. Fasolino, P. Tramontana, S. D. Carmine, and A. M. Memon. Using GUI ripping for automated testing of Android applications. In ASE, pages 258--261, 2012. Google Scholar
Digital Library
- A. Desai, V. Gupta, E. Jackson, S. Qadeer, S. Rajamani, and D. Zufferey. P: safe asynchronous event-driven programming. In PLDI, pages 321--332. ACM, 2013. Google Scholar
Digital Library
- A. Dunkels, B. Gronvall, and T. Voigt. Contiki - A lightweight and flexible operating system for tiny networked sensors. In LCN, pages 455--462, 2004. Google Scholar
Digital Library
- D. Engler and K. Ashcraft. RacerX: Effective, static detection of race conditions and deadlocks. In SOSP, pages 237--252, 2003. Google Scholar
Digital Library
- C. Flanagan and S. N. Freund. Type-based race detection for Java. In PLDI, pages 219--232, 2000. Google Scholar
Digital Library
- C. Flanagan and S. N. Freund. FastTrack: Efficient and precise dynamic race detection. In PLDI, pages 121--133, 2009. Google Scholar
Digital Library
- P. Ganty and R. Majumdar. Algorithmic verification of asynchronous programs. TOPLAS, 34(1):6:1--6:48, 2012. Google Scholar
Digital Library
- J. Ide, R. Bodik, and D. Kimelman. Concurrency concerns in rich internet applications. In EC(2), CAV Workshop, 2009.Google Scholar
- A. Igarashi, B. C. Pierce, and P. Wadler. Featherweight Java: A minimal core calculus for Java and GJ. TOPLAS, pages 396--450, 2001. Google Scholar
Digital Library
- A. Itzkovitz, A. Schuster, and O. Zeev-Ben-Mordehai. Toward integration of data race detection in DSM systems. J. Parallel Distrib. Comput., pages 180--203, 1999. Google Scholar
Digital Library
- H. Jula, T. Rensch, and G. Candea. Platform-wide deadlock immunity for mobile phones. In DSN-W, pages 205--210, 2011. Google Scholar
Digital Library
- V. Kahlon, N. Sinha, E. Kruus, and Y. Zhang. Static data race detection for concurrent programs with asynchronous calls. In ESEC/FSE, pages 13--22, 2009. Google Scholar
Digital Library
- K. Klues, C. M. Liang, J. Paek, R. Musaloiu-Elefteri, P. Levis, A. Terzis, and R. Govindan. TOSThreads: Thread-safe and non-invasive preemption in TinyOS. In SenSys, pages 127--140, 2009. Google Scholar
Digital Library
- L. Lamport. Time, clocks, and the ordering of events in a distributed system. Commun. ACM, pages 558--565, 1978. Google Scholar
Digital Library
- A. Machiry, R. Tahiliani, and M. Naik. Dynodroid: an input generation system for Android apps. In FSE, pages 224--234, 2013. Google Scholar
Digital Library
- M. Naik, A. Aiken, and J. Whaley. Effective static race detection for Java. In PLDI, pages 308--319, 2006. Google Scholar
Digital Library
- R. O'Callahan and J. Choi. Hybrid dynamic data race detection. In PPOPP, pages 167--178, 2003. Google Scholar
Digital Library
- V. S. Pai, P. Druschel, and W. Zwaenepoel. Flash: An efficient and portable web server. In USENIX, pages 199--212, 1999. Google Scholar
Digital Library
- B. Petrov, M. Vechev, M. Sridharan, and J. Dolby. Race detection for web applications. In PLDI, pages 251--262, 2012. Google Scholar
Digital Library
- E. Pozniansky and A. Schuster. Efficient on-the-fly data race detection in multithreaded C++ programs. In PPOPP, pages 179--190, 2003. Google Scholar
Digital Library
- E. Pozniansky and A. Schuster. MultiRace: Efficient on-the-fly data race detection in multithreaded C++ programs. Concurr. Comput.: Pract. Exper., pages 327--340, 2007. Google Scholar
Digital Library
- P. Pratikakis, J. S. Foster, and M. Hicks. LOCKSMITH: Practical static race detection for C. TOPLAS, 33(1):3:1--3:55, 2011. Google Scholar
Digital Library
- V. Raychev, M. Vechev, and M. Sridharan. Effective race detection for event-driven programs. In OOPSLA, pages 151--166, 2013. Google Scholar
Digital Library
- S. Savage, M. Burrows, G. Nelson, P. Sobalvarro, and T. Anderson. Eraser: A dynamic data race detector for multithreaded programs. TOCS, pages 391--411, 1997. Google Scholar
Digital Library
- K. Veeraraghavan, P. M. Chen, J. Flinn, and S. Narayanasamy. Detecting and surviving data races using complementary schedules. In SOSP, pages 369--384, 2011. Google Scholar
Digital Library
- J. W. Voung, R. Jhala, and S. Lerner. RELAY: Static race detection on millions of lines of code. In FSE, pages 205--214, 2007. Google Scholar
Digital Library
- Y. Yu, T. Rodeheffer, and W. Chen. Racetrack: Efficient detection of data race conditions via adaptive tracking. In SOSP, pages 221--234, 2005. Google Scholar
Digital Library
- S. Zhang, H. Lü, and M. D. Ernst. Finding errors in multithreaded GUI applications. In ISSTA, pages 243--253, 2012. Google Scholar
Digital Library
- Y. Zheng, T. Bao, and X. Zhang. Statically locating web application bugs caused by asynchronous calls. In WWW, pages 805--814, 2011. Google Scholar
Digital Library
Index Terms
Race detection for Android applications
Recommendations
Scalable race detection for Android applications
OOPSLA '15We present a complete end-to-end dynamic analysis system for finding data races in mobile Android applications. The capabilities of our system significantly exceed the state of the art: our system can analyze real-world application interactions in ...
Race detection for event-driven mobile applications
PLDI '14Mobile systems commonly support an event-based model of concurrent programming. This model, used in popular platforms such as Android, naturally supports mobile devices that have a rich array of sensors and user input modalities. Unfortunately, most ...
Race detection for Android applications
PLDI '14: Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and ImplementationProgramming environments for smartphones expose a concurrency model that combines multi-threading and asynchronous event-based dispatch. While this enables the development of efficient and feature-rich applications, unforeseen thread interleavings ...







Comments