skip to main content
research-article

Race detection for Android applications

Published:09 June 2014Publication History
Skip Abstract Section

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.

References

  1. J. Alves-Foss, editor. Formal Syntax and Semantics of Java, volume 1523 of LNCS, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  3. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  4. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  5. D. Engler and K. Ashcraft. RacerX: Effective, static detection of race conditions and deadlocks. In SOSP, pages 237--252, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. C. Flanagan and S. N. Freund. Type-based race detection for Java. In PLDI, pages 219--232, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. C. Flanagan and S. N. Freund. FastTrack: Efficient and precise dynamic race detection. In PLDI, pages 121--133, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. P. Ganty and R. Majumdar. Algorithmic verification of asynchronous programs. TOPLAS, 34(1):6:1--6:48, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. J. Ide, R. Bodik, and D. Kimelman. Concurrency concerns in rich internet applications. In EC(2), CAV Workshop, 2009.Google ScholarGoogle Scholar
  10. A. Igarashi, B. C. Pierce, and P. Wadler. Featherweight Java: A minimal core calculus for Java and GJ. TOPLAS, pages 396--450, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  12. H. Jula, T. Rensch, and G. Candea. Platform-wide deadlock immunity for mobile phones. In DSN-W, pages 205--210, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  14. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  15. L. Lamport. Time, clocks, and the ordering of events in a distributed system. Commun. ACM, pages 558--565, 1978. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. A. Machiry, R. Tahiliani, and M. Naik. Dynodroid: an input generation system for Android apps. In FSE, pages 224--234, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. M. Naik, A. Aiken, and J. Whaley. Effective static race detection for Java. In PLDI, pages 308--319, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. R. O'Callahan and J. Choi. Hybrid dynamic data race detection. In PPOPP, pages 167--178, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. V. S. Pai, P. Druschel, and W. Zwaenepoel. Flash: An efficient and portable web server. In USENIX, pages 199--212, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. B. Petrov, M. Vechev, M. Sridharan, and J. Dolby. Race detection for web applications. In PLDI, pages 251--262, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. E. Pozniansky and A. Schuster. Efficient on-the-fly data race detection in multithreaded C++ programs. In PPOPP, pages 179--190, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  23. P. Pratikakis, J. S. Foster, and M. Hicks. LOCKSMITH: Practical static race detection for C. TOPLAS, 33(1):3:1--3:55, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. V. Raychev, M. Vechev, and M. Sridharan. Effective race detection for event-driven programs. In OOPSLA, pages 151--166, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  26. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  27. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  28. Y. Yu, T. Rodeheffer, and W. Chen. Racetrack: Efficient detection of data race conditions via adaptive tracking. In SOSP, pages 221--234, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. S. Zhang, H. Lü, and M. D. Ernst. Finding errors in multithreaded GUI applications. In ISSTA, pages 243--253, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Y. Zheng, T. Bao, and X. Zhang. Statically locating web application bugs caused by asynchronous calls. In WWW, pages 805--814, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Race detection for Android applications

                Recommendations

                Comments

                Login options

                Check if you have access through your login credentials or your institution to get full access on this article.

                Sign in

                Full Access

                • Published in

                  cover image ACM SIGPLAN Notices
                  ACM SIGPLAN Notices  Volume 49, Issue 6
                  PLDI '14
                  June 2014
                  598 pages
                  ISSN:0362-1340
                  EISSN:1558-1160
                  DOI:10.1145/2666356
                  • Editor:
                  • Andy Gill
                  Issue’s Table of Contents
                  • cover image ACM Conferences
                    PLDI '14: Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation
                    June 2014
                    619 pages
                    ISBN:9781450327848
                    DOI:10.1145/2594291

                  Copyright © 2014 ACM

                  Publisher

                  Association for Computing Machinery

                  New York, NY, United States

                  Publication History

                  • Published: 9 June 2014

                  Check for updates

                  Qualifiers

                  • research-article

                PDF Format

                View or Download as a PDF file.

                PDF

                eReader

                View online with eReader.

                eReader
                About Cookies On This Site

                We use cookies to ensure that we give you the best experience on our website.

                Learn more

                Got it!