ABSTRACT
Asynchronous programming model is commonly used in mobile systems and Web 2.0 environments. Asynchronous race detectors use algorithms that are an order of magnitude performance and space inefficient compared to conventional data race detectors. We solve this problem by identifying and addressing two important problems in reasoning about causality between asynchronous events.
Unlike conventional signal-wait operations, establishing causal order between two asynchronous events is fundamentally more challenging as there is no common handle they operate on. We propose a new primitive named AsyncClock that addresses this problem by explicitly tracking causally preceding events, and show that AsyncClock can handle a wide variety of asynchronous causality models. We also address the important scalability problem of efficiently identifying heirless events whose metadata can be reclaimed.
We built the first single-pass, non-graph-based Android race detector using our algorithm and applied it to find errors in 20 popular applications. Our tool incurs about 6x performance overhead, which is several times more efficient than the state-of-the-art solution. It also scales well with the execution length. We used our tool to find 147 previously unknown harmful races.
- Message | android developers. https://developer.android.com/reference/android/os/Message.html#setAsynchronous(boolean). [Online; accessed 2016-08-15].Google Scholar
- tool:androidmonkeyUi/application exerciser monkey | android studio. https://developer.android.com/studio/test/monkey.html,natexlaba. [Online; accessed 2016-08--15].Google Scholar
- tool:droidracerdroidracer - software engineering and analysis lab (seal), iisc bangalore. http://www.iisc-seal.net/droidracer,natexlabb. [Online; accessed 2016-08-15].Google Scholar
- tool:eventracerandroid Event racer for android. http://eventracer.org/android/,natexlabc. [Online; accessed 2016-08--15].Google Scholar
- S. V. Adve, M. D. Hill, B. P. Miller, and R. H. B. Netzer. Detecting data races on weak memory systems. SIGARCH Comput. Archit. News, 19 (3): 234--243, Apr. 1991. ISSN 0163--5964. 10.1145/115953.115976. URL http://doi.acm.org/10.1145/115953.115976.Google ScholarDigital Library
- P. Bielik, V. Raychev, and M. Vechev. Scalable race detection for android applications. In Proceedings of the 2015 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2015, pages 332--348, New York, NY, USA, 2015. ACM. ISBN 978-1-4503-3689-5. 10.1145/2814270.2814303. URL http://doi.acm.org/10.1145/2814270.2814303.Google ScholarDigital Library
- M. Christiaens and K. Bosschere. Euro-Par 2001 Parallel Processing: 7th International Euro-Par Conference Manchester, UK, August 28--31, 2001 Proceedings, chapter Accordion Clocks: Logical Clocks for Data Race Detection, pages 494--503. Springer Berlin Heidelberg, Berlin, Heidelberg, 2001. ISBN 978-3-540-44681-1. 10.1007/3-540-44681-8_73. URL http://dx.doi.org/10.1007/3-540-44681-8_73. Google ScholarCross Ref
- D. Dimitrov, V. Raychev, M. Vechev, and E. Koskinen. Commutativity race detection. In Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI '14, pages 305--315, New York, NY, USA, 2014. ACM. ISBN 978-1-4503-2784-8. 10.1145/2594291.2594322. URL http://doi.acm.org/10.1145/2594291.2594322.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
- C.-H. Hsiao, J. Yu, S. Narayanasamy, Z. Kong, C. L. Pereira, G. A. Pokam, P. M. Chen, and J. Flinn. Race detection for event-driven mobile applications. In Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI '14, pages 326--336, New York, NY, USA, 2014. ACM. ISBN 978-1-4503-2784-8. 10.1145/2594291.2594330. URL http://doi.acm.org/10.1145/2594291.2594330.Google ScholarDigital Library
- H. V. Jagadish. A compression technique to materialize transitive closure. ACM Trans. Database Syst., 15 (4): 558--598, Dec. 1990. ISSN 0362-5915. 10.1145/99935.99944. URL http://doi.acm.org/10.1145/99935.99944.Google ScholarDigital Library
- P. Maiya, A. Kanade, and R. Majumdar. Race detection for android applications. In Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI '14, pages 316--325, New York, NY, USA, 2014. ACM. ISBN 978-1-4503-2784-8. 10.1145/2594291.2594311. URL http://doi.acm.org/10.1145/2594291.2594311.Google ScholarDigital Library
- F. Mattern. Virtual time and global states of distributed systems. In Parallel and Distributed Algorithms, pages 215--226. North-Holland, 1989.Google Scholar
- 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
- B. Petrov, M. T. Vechev, M. Sridharan, and J. Dolby. Race detection for web applications. In PLDI, pages 251--262, 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
- 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
Index Terms
- AsyncClock: Scalable Inference of Asynchronous Event Causality
Recommendations
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 ...
AsyncClock: Scalable Inference of Asynchronous Event Causality
ASPLOS '17Asynchronous programming model is commonly used in mobile systems and Web 2.0 environments. Asynchronous race detectors use algorithms that are an order of magnitude performance and space inefficient compared to conventional data race detectors. We ...
AsyncClock: Scalable Inference of Asynchronous Event Causality
Asplos'17Asynchronous programming model is commonly used in mobile systems and Web 2.0 environments. Asynchronous race detectors use algorithms that are an order of magnitude performance and space inefficient compared to conventional data race detectors. We ...
Comments