Abstract
Mobile 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 existing tools for detecting concurrency errors of parallel programs focus on a thread-based model of concurrency. If one applies such tools directly to an event-based program, they work poorly because they infer false dependencies between unrelated events handled sequentially by the same thread.
In this paper we present a race detection tool named CAFA for event-driven mobile systems. CAFA uses the causality model that we have developed for the Android event-driven system. A novel contribution of our model is that it accounts for the causal order due to the event queues, which are not accounted for in past data race detectors. Detecting races based on low-level races between memory accesses leads to a large number of false positives. CAFA overcomes this problem by checking for races between high-level operations. We discuss our experience in using CAFA for finding and understanding a number of known and unknown harmful races in open-source Android applications.
- Android Open Source Project. http://source.android.com/.Google Scholar
- Dalvik Technical Information. http://source.android.com/devices/tech/dalvik/index.html.Google Scholar
- List of free and open-source Android apllications. http://en.wikipedia.org/wiki/List_of_free_and_open-source_Android_applications.Google Scholar
- F-Droid. https://f-droid.org.Google Scholar
- Twitter Finagle. https://github.com/twitter/finagle.Google Scholar
- Libprocess. http://www.eecs.berkeley.edu/~benh/libprocess/.Google Scholar
- S. V. Adve and M. D. Hill. Weak ordering---a new definition. In Proceedings of the 17th Annual International Symposium on Computer Architecture, ISCA '90, pages 2--14, New York, NY, USA, 1990. ACM. ISBN 0-89791-366-3.. URL http://doi.acm.org/10.1145/325164.325100. Google ScholarDigital Library
- J. Armstrong, R. Virding, and M. Williams. Concurrent programming in ERLANG. Prentice Hall, 1993. ISBN 978-0-13-285792-5. Google ScholarDigital Library
- A. Desai, V. Gupta, E. K. Jackson, S. Qadeer, S. K. Rajamani, and D. Zufferey. P: safe asynchronous event-driven programming. In PLDI, pages 321--332, 2013. Google ScholarDigital Library
- D. R. Engler and K. Ashcraft. RacerX: Effective, Static Detection of Race Conditions and Deadlocks. In SOSP, pages 237--252, 2003. Google ScholarDigital Library
- C. Flanagan and S. N. Freund. FastTrack: Efficient and Precise Dynamic Race Detection. In PLDI, pages 121--133, 2009. Google ScholarDigital Library
- R. C. Huang, E. Halberg, and G. E. Suh. Non-race concurrency bug detection through order-sensitive critical sections. In ISCA, pages 655--666, 2013. Google ScholarDigital Library
- V. Kahlon and C. Wang. Universal Causality Graphs: A Precise Happens-Before Model for Detecting Bugs in Concurrent Programs. In CAV, pages 434--449, 2010. Google ScholarDigital Library
- L. Lamport. How to make a multiprocessor computer that correctly executes multiprocess programs. Computers, IEEE Transactions on, C-28(9):690--691, Sept 1979. ISSN 0018--9340.. Google ScholarDigital Library
- R. H. B. Netzer. Optimal Tracing and Replay for Debugging Shared-Memory Parallel Programs. In Workshop on Parallel and Distributed Debugging, pages 1--11, 1993. Google ScholarDigital Library
- A. Pathak, Y. C. Hu, and M. Zhang. Bootstrapping energy debugging on smartphones: a first look at energy bugs in mobile devices. In HotNets, page 5, 2011. Google ScholarDigital Library
- A. Pathak, A. Jindal, Y. C. Hu, and S. P. Midkiff. What is keeping my phone awake?: characterizing and detecting no-sleep energy bugs in smartphone apps. In MobiSys, pages 267--280, 2012. Google ScholarDigital Library
- B. Petrov, M. T. Vechev, M. Sridharan, and J. Dolby. Race detection for web applications. In PLDI, pages 251--262, 2012. Google ScholarDigital Library
- L. Ravindranath, J. Padhye, S. Agarwal, R. Mahajan, I. Obermiller, and S. Shayandeh. Appinsight: mobile app performance monitoring in the wild. In OSDI, pages 107--120, 2012. Google ScholarDigital Library
- V. Raychev, M. T. Vechev, and M. Sridharan. Effective race detection for event-driven programs. In OOPSLA, pages 151--166, 2013. Google ScholarDigital Library
- Y. Smaragdakis, J. Evans, C. Sadowski, J. Yi, and C. Flanagan. Sound predictive race detection in polynomial time. In POPL, pages 387--400, 2012. Google ScholarDigital Library
- J. W. Voung, R. Jhala, and S. Lerner. RELAY: Static Race Detection on Millions of Lines of Code. In ESEC/SIGSOFT FSE, pages 205--214, 2007. Google ScholarDigital Library
- L. Zhang, D. R. Bild, R. P. Dick, Z. M. Mao, and P. A. Dinda. Panappticon: Event-based tracing to measure mobile application and platform performance. In CODES+ISSS, pages 1--10, 2013. Google ScholarDigital Library
- W. Zhang, J. Lim, R. Olichandran, J. Scherpelz, G. Jin, S. Lu, and T. W. Reps. ConSeq: Detecting Concurrency Bugs through Sequential Errors. In ASPLOS, pages 251--264, 2011. Google ScholarDigital Library
- W. Zhang, C. Sun, J. Lim, S. Lu, and T. W. Reps. Conmem: Detecting crash-triggering concurrency bugs through an effect-oriented approach. ACM Trans. Softw. Eng. Methodol., 22(2):10, 2013. Google ScholarDigital Library
Index Terms
- Race detection for event-driven mobile applications
Recommendations
Effective race detection for event-driven programs
OOPSLA '13: Proceedings of the 2013 ACM SIGPLAN international conference on Object oriented programming systems languages & applicationsLike shared-memory multi-threaded programs, event-driven programs such as client-side web applications are susceptible to data races that are hard to reproduce and debug. Race detection for such programs is hampered by their pervasive use of ad hoc ...
Race detection for event-driven mobile applications
PLDI '14: Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and ImplementationMobile 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 ...
What happens-after the first race? enhancing the predictive power of happens-before based dynamic race detection
Dynamic race detection is the problem of determining if an observed program execution reveals the presence of a data race in a program. The classical approach to solving this problem is to detect if there is a pair of conflicting memory accesses that are ...
Comments