Race detection for event-driven mobile applications

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.

[1]  Shan Lu,et al.  ConMem: Detecting Crash-Triggering Concurrency Bugs through an Effect-Oriented Approach , 2013, TSEM.

[2]  Samuel P. Midkiff,et al.  What is keeping my phone awake?: characterizing and detecting no-sleep energy bugs in smartphone apps , 2012, MobiSys '12.

[3]  Ratul Mahajan,et al.  AppInsight: Mobile App Performance Monitoring in the Wild , 2022 .

[4]  Leslie Lamport,et al.  How to Make a Multiprocessor Computer That Correctly Executes Multiprocess Programs , 2016, IEEE Transactions on Computers.

[5]  Ming Zhang,et al.  Bootstrapping energy debugging on smartphones: a first look at energy bugs in mobile devices , 2011, HotNets-X.

[6]  Sorin Lerner,et al.  RELAY: static race detection on millions of lines of code , 2007, ESEC-FSE '07.

[7]  吉田 則裕,et al.  Android Open Source Projectを対象としたパッチレビュー活動の調査 , 2012 .

[8]  G. Edward Suh,et al.  Non-race concurrency bug detection through order-sensitive critical sections , 2013, ISCA.

[9]  Chao Wang,et al.  Universal Causality Graphs: A Precise Happens-Before Model for Detecting Bugs in Concurrent Programs , 2010, CAV.

[10]  Robert H. B. Netzer Optimal tracing and replay for debugging shared-memory parallel programs , 1993, PADD '93.

[11]  Joe Armstrong,et al.  Concurrent programming in ERLANG , 1993 .

[12]  Dawson R. Engler,et al.  RacerX: effective, static detection of race conditions and deadlocks , 2003, SOSP '03.

[13]  Stephen N. Freund,et al.  FastTrack: efficient and precise dynamic race detection , 2009, PLDI '09.

[14]  Shan Lu,et al.  ConSeq: detecting concurrency bugs through sequential errors , 2011, ASPLOS XVI.

[15]  Yannis Smaragdakis,et al.  Sound predictive race detection in polynomial time , 2012, POPL '12.

[16]  Mark D. Hill,et al.  Weak ordering—a new definition , 1998, ISCA '98.

[17]  Manu Sridharan,et al.  Effective race detection for event-driven programs , 2013, OOPSLA.

[18]  Damien Zufferey,et al.  P: safe asynchronous event-driven programming , 2013, PLDI.

[19]  Peter A. Dinda,et al.  Panappticon: Event-based tracing to measure mobile application and platform performance , 2013, 2013 International Conference on Hardware/Software Codesign and System Synthesis (CODES+ISSS).

[20]  Manu Sridharan,et al.  Race detection for web applications , 2012, PLDI.

[21]  Mike Williams,et al.  ERLANG for Concurrent Programming , 1993 .