Verifying Synchronization for Atomicity Violation Fixing

Atomicity is a fundamental property to guarantee the isolation of a work unit (i.e., a sequence of related events in a thread) from concurrent threads. However, ensuring atomicity is often very challenging due to complex thread interactions. We present an approach to help developers verify whether such work units, which have triggered bugs due to certain violations of atomicity, are sufficiently synchronized or not by locks introduced for fixing the bugs. A key feature of our approach is that it combines the fortes of both bug-driven and change-aware techniques, which enables it to effectively verify synchronizations by testing only a minimal set of suspicious atomicity violations without any knowledge on the to-be-isolated work units, thus being more efficient and practical than other approaches. Besides, unlike existing approaches, our approach effectively utilizes all the inferred execution traces even they may not be completely feasible, such that the verification algorithm can converge much faster. We demonstrate via extensive evaluation that our approach is much more effective and efficient than the state-of-the-arts. Besides, we show that although there have existed sound automatic fixing techniques for atomicity violations, our approach is still necessary and useful for quality assurance of concurrent programs, because the assumption behind our approach is much weaker. We have also investigated one of the largest bug databases and found that insufficient synchronizations are common and difficult to be found in software development.

[1]  Ding Yuan,et al.  How do fixes become bugs? , 2011, ESEC/FSE '11.

[2]  Darko Marinov,et al.  Change-aware preemption prioritization , 2011, ISSTA '11.

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

[4]  Anna Philippou,et al.  Tools and Algorithms for the Construction and Analysis of Systems , 2018, Lecture Notes in Computer Science.

[5]  Amer Diwan,et al.  The DaCapo benchmarks: java benchmarking development and analysis , 2006, OOPSLA '06.

[6]  Laurie Hendren,et al.  Soot: a Java bytecode optimization framework , 2010, CASCON.

[7]  Yuanyuan Zhou,et al.  Efficient online validation with delta execution , 2009, ASPLOS.

[8]  Jeff Huang,et al.  CLAP: recording local executions to reproduce concurrency failures , 2013, PLDI.

[9]  Koushik Sen,et al.  CONCURRIT: a domain specific language for reproducing concurrency bugs , 2013, PLDI.

[10]  Jeff Huang,et al.  LEAP: lightweight deterministic multi-processor replay of concurrent java programs , 2010, SIGSOFT FSE.

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

[12]  W. K. Chan,et al.  MagicFuzzer: Scalable deadlock detection for large-scale applications , 2012, 2012 34th International Conference on Software Engineering (ICSE).

[13]  Charles Zhang,et al.  Axis: Automatically fixing atomicity violations through solving control constraints , 2012, 2012 34th International Conference on Software Engineering (ICSE).

[14]  Gregg Rothermel,et al.  Regression model checking , 2009, 2009 IEEE International Conference on Software Maintenance.

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

[16]  Shing-Chi Cheung,et al.  Detecting atomic-set serializability violations in multithreaded programs through active randomized testing , 2010, 2010 ACM/IEEE 32nd International Conference on Software Engineering.

[17]  Leonid Ryzhyk,et al.  Efficient Synthesis for Concurrency by Semantics-Preserving Transformations , 2013, CAV.

[18]  Sriram Sankaranarayanan,et al.  Symbolic Deadlock Analysis in Concurrent Libraries and Their Clients , 2009, 2009 IEEE/ACM International Conference on Automated Software Engineering.

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

[20]  Charles Zhang,et al.  Finding incorrect compositions of atomicity , 2013, ESEC/FSE 2013.

[21]  Thomas A. Henzinger,et al.  Succinct Representation of Concurrent Trace Sets , 2015, POPL.

[22]  Assaf Schuster,et al.  Scaling model checking of dataraces using dynamic information , 2005, J. Parallel Distributed Comput..

[23]  Chao Wang,et al.  Symbolic predictive analysis for concurrent programs , 2009, Formal Aspects of Computing.

[24]  Maurice Herlihy,et al.  Linearizability: a correctness condition for concurrent objects , 1990, TOPL.

[25]  Huai Liu,et al.  How Effectively Does Metamorphic Testing Alleviate the Oracle Problem? , 2014, IEEE Transactions on Software Engineering.

[26]  Scott D. Stoller,et al.  Accurate and efficient runtime detection of atomicity errors in concurrent programs , 2006, PPoPP '06.

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

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

[29]  Sriram Sankaranarayanan,et al.  Symbolic modular deadlock analysis , 2011, Automated Software Engineering.

[30]  Grigore Rosu,et al.  GPredict: Generic Predictive Concurrency Analysis , 2015, 2015 IEEE/ACM 37th IEEE International Conference on Software Engineering.

[31]  Grigore Rosu,et al.  Maximal sound predictive race detection with control flow abstraction , 2014, PLDI.

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

[33]  Helmut Veith,et al.  Con2colic testing , 2013, ESEC/FSE 2013.

[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]  Yuanyuan Zhou,et al.  CTrigger: exposing atomicity violation bugs from their hiding places , 2009, ASPLOS.

[36]  Grigore Rosu,et al.  Maximal Causal Models for Sequentially Consistent Systems , 2012, RV.

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

[38]  Charles Zhang,et al.  Stride: Search-based deterministic replay in polynomial time via bounded linkage , 2012, 2012 34th International Conference on Software Engineering (ICSE).

[39]  Jason Nieh,et al.  Transparent mutable replay for multicore debugging and patch validation , 2013, ASPLOS '13.

[40]  Bertrand Meyer,et al.  Inferring better contracts , 2011, 2011 33rd International Conference on Software Engineering (ICSE).

[41]  Chao Wang,et al.  Trace-Based Symbolic Analysis for Atomicity Violations , 2010, TACAS.

[42]  Thomas Ball,et al.  Finding and Reproducing Heisenbugs in Concurrent Programs , 2008, OSDI.

[43]  Wei Zhang,et al.  Automated Concurrency-Bug Fixing , 2012, OSDI.

[44]  David L. Dill,et al.  A Decision Procedure for Bit-Vectors and Arrays , 2007, CAV.

[45]  Sebastian Burckhardt,et al.  CheckFence: checking consistency of concurrent data types on relaxed memory models , 2007, PLDI '07.

[46]  Grigore Rosu,et al.  jPredictor: a predictive runtime analysis tool for java , 2008, ICSE '08.

[47]  Christian Hammer,et al.  Detecting deadlock in programs with data-centric synchronization , 2013, 2013 35th International Conference on Software Engineering (ICSE).

[48]  Cormac Flanagan,et al.  A type and effect system for atomicity , 2003, PLDI.

[49]  Yuanyuan Zhou,et al.  AVIO: Detecting Atomicity Violations via Access-Interleaving Invariants , 2007, IEEE Micro.