Debugging Multithreaded Programs as if They Were Sequential

Debugging multithread programs is extremely difficult because the basic assumption that underlies sequential program debugging, that is, the program behavior is deterministic under a fixed input, is no longer valid due to the nondeterminism attributed to thread scheduling. It is because the programs behavior is non-deterministic due to the nondeterminism of parallel execution, which makes debugging or testing multithreaded programs extremely difficult. In this paper, we propose a proactive debugging method to restore this basic assumption so that programmers can debug multithreaded programs as if they were sequential. Our approach is based on the synergistic integration of symbolic analysis and dynamic analysis techniques. In particular, symbolic analysis investigates the program behavior under the same input to search whether there is a thread schedule would trigger a bug or a not-yet-explored path. Dynamic analysis is to execute these new paths with the guide of the generated thread schedules, thereby further guiding the symbolic analysis. The net effect of applying this feedback loop is a systematic and complete coverage of the program behavior under a fixed test input. We implement the proposed approach in a prototype tool called proactive-debugger. Our experiments show that proactive-debugger outperforms both ESBMC and Maple, which are two powerful and well-known testing tools for failure detection in multithreaded programs.

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

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

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

[4]  Vikram S. Adve,et al.  LLVM: a compilation framework for lifelong program analysis & transformation , 2004, International Symposium on Code Generation and Optimization, 2004. CGO 2004..

[5]  Anoop Gupta,et al.  The SPLASH-2 programs: characterization and methodological considerations , 1995, ISCA.

[6]  Madan Musuvathi,et al.  Iterative context bounding for systematic testing of multithreaded programs , 2007, PLDI '07.

[7]  Dawson R. Engler,et al.  KLEE: Unassisted and Automatic Generation of High-Coverage Tests for Complex Systems Programs , 2008, OSDI.

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

[9]  Michael D. Ernst,et al.  Finding errors in multithreaded GUI applications , 2012, ISSTA 2012.

[10]  Sebastian Burckhardt,et al.  Effective ? , 2010 .

[11]  W. K. Chan,et al.  ConLock: a constraint-based approach to dynamic checking on deadlocks in multithreaded programs , 2014, ICSE.

[12]  L. D. Moura,et al.  The YICES SMT Solver , 2006 .

[13]  Martin C. Rinard,et al.  ACM Conference on Object-Oriented Programming, Systems, Languages and Applications (OOPSLA), November 2002 Ownership Types for Safe Programming: Preventing Data Races and Deadlocks , 2022 .

[14]  Chao Wang,et al.  Symbolic Predictive Analysis for Concurrent Programs , 2009, FM.

[15]  Koushik Sen,et al.  CUTE: a concolic unit testing engine for C , 2005, ESEC/FSE-13.

[16]  Harish Patil,et al.  Pin: building customized program analysis tools with dynamic instrumentation , 2005, PLDI '05.

[17]  Scott D. Stoller,et al.  Testing Concurrent Java Programs using Randomized Scheduling , 2002, RV@FLoC.

[18]  Chao Wang,et al.  Coverage guided systematic concurrency testing , 2011, 2011 33rd International Conference on Software Engineering (ICSE).

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

[20]  Chao Wang,et al.  Abstraction and mining of traces to explain concurrency bugs , 2016, FM 2016.

[21]  Koushik Sen,et al.  A trace simplification technique for effective debugging of concurrent programs , 2010, FSE '10.

[22]  Satish Narayanasamy,et al.  A case for an interleaving constrained shared-memory multi-processor , 2009, ISCA '09.

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

[24]  Chao Wang,et al.  BEST: A symbolic testing tool for predicting multi-threaded program failures , 2011, 2011 26th IEEE/ACM International Conference on Automated Software Engineering (ASE 2011).

[25]  Qinghua Zheng,et al.  Dependence Guided Symbolic Execution , 2017, IEEE Transactions on Software Engineering.

[26]  Nikolaj Bjørner,et al.  Z3: An Efficient SMT Solver , 2008, TACAS.

[27]  Jeff Huang,et al.  Stateless model checking concurrent programs with maximal causality reduction , 2015, PLDI.

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

[29]  Lucas C. Cordeiro,et al.  Verifying multi-threaded software using smt-based context-bounded model checking , 2011, 2011 33rd International Conference on Software Engineering (ICSE).

[30]  James C. King,et al.  Symbolic execution and program testing , 1976, CACM.

[31]  Francesco Sorrentino,et al.  Predicting null-pointer dereferences in concurrent programs , 2012, SIGSOFT FSE.

[32]  Satish Narayanasamy,et al.  Maple: a coverage-driven testing tool for multithreaded programs , 2012, OOPSLA '12.

[33]  Rupak Majumdar,et al.  Race detection for Android applications , 2014, PLDI.

[34]  Christoph W. Ueberhuber,et al.  Visualization of Scientific Parallel Programs , 1994, Lecture Notes in Computer Science.

[35]  Pravesh Kothari,et al.  A randomized scheduler with probabilistic guarantees of finding bugs , 2010, ASPLOS XV.

[36]  Satish Narayanasamy,et al.  Parallelizing data race detection , 2013, ASPLOS '13.

[37]  Eran Yahav,et al.  Testing atomicity of composed concurrent operations , 2011, OOPSLA '11.

[38]  Eran Yahav,et al.  Verifying atomicity via data independence , 2014, ISSTA 2014.

[39]  Danny Dig,et al.  Practical static race detection for Java parallel loops , 2013, ISSTA.

[40]  Klaus Havelund,et al.  Towards a framework and a benchmark for testing tools for multi‐threaded programs , 2007, Concurr. Comput. Pract. Exp..

[41]  Kai Li,et al.  The PARSEC benchmark suite: Characterization and architectural implications , 2008, 2008 International Conference on Parallel Architectures and Compilation Techniques (PACT).

[42]  Sharad Malik,et al.  Predictive analysis for detecting serializability violations through Trace Segmentation , 2011, Ninth ACM/IEEE International Conference on Formal Methods and Models for Codesign (MEMPCODE2011).

[43]  Wenguang Chen,et al.  RACEZ: a lightweight and non-invasive race detection tool for production applications , 2011, 2011 33rd International Conference on Software Engineering (ICSE).

[44]  Swarnendu Biswas,et al.  DoubleChecker: efficient sound and precise atomicity checking , 2014, PLDI.

[45]  Thomas R. Gross,et al.  Static conflict analysis for multi-threaded object-oriented programs , 2003, PLDI '03.

[46]  Satish Narayanasamy,et al.  LiteRace: effective sampling for lightweight data-race detection , 2009, PLDI '09.

[47]  Chao Wang,et al.  Generating Data Race Witnesses by an SMT-Based Analysis , 2011, NASA Formal Methods.

[48]  Brandon Lucia,et al.  Production-guided concurrency debugging , 2016, PPoPP.

[49]  Qinghua Zheng,et al.  Debugging Multithreaded Programs as if They Were Sequential , 2016, 2016 International Conference on Software Analysis, Testing and Evolution (SATE).

[50]  Koushik Sen,et al.  Detecting Errors in Multithreaded Programs by Generalized Predictive Analysis of Executions , 2005, FMOODS.

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

[52]  Shin Hong,et al.  Testing concurrent programs to achieve high synchronization coverage , 2012, ISSTA 2012.

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