Axis: Automatically fixing atomicity violations through solving control constraints

Atomicity, a general correctness criterion in concurrency programs, is often violated in real-world applications. The violations are difficult for developers to fix, making automatic bug fixing techniques attractive. The state of the art approach aims at automating the manual fixing process but cannot provide any theoretical reasoning and guarantees. We provide an automatic approach that applies well-studied discrete control theory to guarantee deadlocks are not introduced and maximal preservation of the concurrency of the original code. Under the hood, we reduce the problem of violation fixing to a constraint solving problem using the Petri net model. Our evaluation on 13 subjects shows that the slowdown incurred by our patches is only 40% of that of the state of the art. With the deadlock-free guarantee, our patches incur moderate overhead (around 10%), which is a worthwhile cost for safety.

[1]  Rupak Majumdar,et al.  Lock allocation , 2007, POPL '07.

[2]  Jeffrey Overbey,et al.  A type and effect system for deterministic parallel Java , 2009, OOPSLA '09.

[3]  Jeff Huang,et al.  Persuasive prediction of concurrency access anomalies , 2011, ISSTA '11.

[4]  Paola Inverardi,et al.  Model-Based Software Performance Analysis , 2011 .

[5]  Tadao Murata,et al.  Petri nets: Properties, analysis and applications , 1989, Proc. IEEE.

[6]  Yuanyuan Zhou,et al.  CTrigger: exposing atomicity violation bugs from their hiding places , 2009, ASPLOS.

[7]  Sen Hu,et al.  Efficient system-enforced deterministic parallelism , 2010, OSDI.

[8]  Josep Torrellas,et al.  InstantCheck: Checking the Determinism of Parallel Programs Using On-the-Fly Incremental Hashing , 2010, 2010 43rd Annual IEEE/ACM International Symposium on Microarchitecture.

[9]  Eric Rescorla Security Holes . . . Who Cares? , 2003, USENIX Security Symposium.

[10]  Samuel P. Midkiff,et al.  Using data structure knowledge for efficient lock generation and strong atomicity , 2010, PPoPP '10.

[11]  Panos J. Antsaklis,et al.  Supervision Based on Place Invariants: A Survey , 2006, Discret. Event Dyn. Syst..

[12]  Brandon Lucia,et al.  Atom-Aid: Detecting and Surviving Atomicity Violations , 2009, IEEE Micro.

[13]  Francesco Sorrentino,et al.  PENELOPE: weaving threads to expose atomicity violations , 2010, FSE '10.

[14]  Shan Lu,et al.  Automated atomicity-violation fixing , 2011, PLDI '11.

[15]  Betty H. C. Cheng,et al.  Model-based development of dynamically adaptive software , 2006, ICSE.

[16]  Klaus Havelund,et al.  Model Checking Programs , 2004, Automated Software Engineering.

[17]  Eran Yahav,et al.  Abstraction-guided synthesis of synchronization , 2010, POPL.

[18]  Azadeh Farzan,et al.  Causal Atomicity , 2006, CAV.

[19]  Luciano Baresi,et al.  Self-Supervising BPEL Processes , 2011, IEEE Transactions on Software Engineering.

[20]  Jeffrey Overbey,et al.  A type and effect system for deterministic parallel Java , 2009, OOPSLA 2009.

[21]  Eran Yahav,et al.  Automatic fine-grain locking using shape properties , 2011, OOPSLA '11.

[22]  Josep Torrellas,et al.  AtomTracker: A Comprehensive Approach to Atomic Region Inference and Violation Detection , 2010, 2010 43rd Annual IEEE/ACM International Symposium on Microarchitecture.

[23]  Scott A. Mahlke,et al.  Gadara: Dynamic Deadlock Avoidance for Multithreaded Programs , 2008, OSDI.

[24]  David Gay,et al.  Autolocker: synchronization inference for atomic sections , 2006, POPL '06.

[25]  David Lie,et al.  Kivati: fast detection and prevention of atomicity violations , 2010, EuroSys '10.

[26]  Mauricio J. Serrano,et al.  Thin locks: featherweight Synchronization for Java , 2004, SIGP.

[27]  Clark Verbrugge,et al.  Component-Based Lock Allocation , 2007, 16th International Conference on Parallel Architecture and Compilation Techniques (PACT 2007).

[28]  Koushik Sen,et al.  Randomized active atomicity violation detection in concurrent programs , 2008, SIGSOFT '08/FSE-16.

[29]  Yuanyuan Zhou,et al.  Learning from mistakes: a comprehensive study on real world concurrency bug characteristics , 2008, ASPLOS.

[30]  Charles Zhang FlexSync: An aspect-oriented approach to Java synchronization , 2009, 2009 IEEE 31st International Conference on Software Engineering.

[31]  Calton Pu,et al.  The Cracker Patch Choice: An Analysis of Post Hoc Security Techniques , 2000 .

[32]  Frank Tip,et al.  Associating synchronization constraints with data in an object-oriented language , 2006, POPL '06.

[33]  Xiangyu Zhang,et al.  Accentuating the positive: atomicity inference and enforcement using correct executions , 2011, OOPSLA '11.

[34]  Stephen N. Freund,et al.  Atomizer: a dynamic atomicity checker for multithreaded programs , 2004, 18th International Parallel and Distributed Processing Symposium, 2004. Proceedings..

[35]  Scott A. Mahlke,et al.  The theory of deadlock avoidance via discrete control , 2009, POPL '09.

[36]  Laura K. Dillon,et al.  Avoiding Serialization Vulnerabilities through the Use of Synchronization Contracts , 2004 .

[37]  Jong-Deok Choi,et al.  Escape analysis for Java , 1999, OOPSLA '99.