Declarative debugging of concurrent Erlang programs

Abstract Despite the growing number of concurrent applications in nowadays systems, debugging concurrent programs remains an open issue due to its intrinsic complexity. In this work, we present a declarative debugger for the concurrent language Erlang. Following the ideas of algorithmic debugging, our tool asks questions to the user about the validity of transitions between those program points that involve message passing, and also about the expected results of the function calls occurred during the computation. The differences between the user answers, which represent the intended behavior of the program, and the actual program execution, allow the debugger to detect the function responsible for the error, and to point out the pieces of source code responsible for the bugs. The proposal is based on a concurrent calculus for Erlang programs, and we show a benchmark that assesses its scalability both in terms of resources usage and considering the number of questions asked to the user and their complexity. Furthermore, we check the usability of our proposal, applying the debugger to the Erlang library poolboy .

[1]  Konstantinos Sagonas,et al.  Detecting Software Defects in Telecom Applications Through Lightweight Static Analysis: A War Story , 2004, APLAS.

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

[3]  J. Armstrong Concurrency Oriented Programming in Erlang , .

[4]  Adrián Riesco,et al.  A zoom-declarative debugger for sequential Erlang programs , 2015, Sci. Comput. Program..

[5]  Jon Postel,et al.  Transmission Control Protocol , 1981, RFC.

[6]  Lars-Åke Fredlund,et al.  McErlang: a model checker for a distributed functional programming language , 2007, ICFP '07.

[7]  Germán Vidal Towards Erlang Verification by Term Rewriting , 2013, LOPSTR.

[8]  Tadanori Mizuno,et al.  A framework of an assertion-based algorithmic debugging for distributed programs , 2001, Proceedings 15th International Conference on Information Networking.

[9]  Adrián Riesco,et al.  EDD: A Declarative Debugger for Sequential Erlang Programs , 2014, TACAS.

[10]  Per Runeson,et al.  A survey of unit testing practices , 2006, IEEE Software.

[11]  Konstantinos Sagonas,et al.  Precise explanation of success typing errors , 2013, PEPM '13.

[12]  Richard Carlsson,et al.  EUnit: a lightweight unit testing framework for Erlang , 2006, ERLANG '06.

[13]  Leslie Lamport,et al.  Time, clocks, and the ordering of events in a distributed system , 1978, CACM.

[14]  Lars-Åke Fredlund,et al.  A more accurate semantics for distributed erlang , 2007, ERLANG '07.

[15]  Ehud Shapiro,et al.  Concurrent algorithmic debugging , 1988, PADD '88.

[16]  Jason Gait,et al.  A debugger for concurrent programs , 1985, Softw. Pract. Exp..

[17]  Alkis Gotovos,et al.  Systematic Testing for Detecting Concurrency Errors in Erlang Programs , 2013, 2013 IEEE Sixth International Conference on Software Testing, Verification and Validation.

[18]  Joe Armstrong,et al.  Making reliable distributed systems in the presence of software errors , 2003 .

[19]  Frank Wolter,et al.  Handbook of Modal Logic, Volume 3 (Studies in Logic and Practical Reasoning) , 2006 .

[20]  Charles E. McDowell,et al.  Debugging concurrent programs , 1989, ACM Comput. Surv..

[21]  Frank Huch,et al.  Verification of Erlang programs using abstract interpretation and model checking , 1999, ICFP '99.

[22]  Richard Carlsson An introduction to Core Erlang , 2001 .

[23]  Josep Silva A survey on algorithmic debugging strategies , 2011, Adv. Eng. Softw..

[24]  Lars-Åke Fredlund,et al.  A framework for reasoning about Erlang code , 2001 .

[25]  Sanjay Ghemawat,et al.  MapReduce: Simplified Data Processing on Large Clusters , 2004, OSDI.

[26]  Adrián Riesco,et al.  A Declarative Debugger for Sequential Erlang Programs , 2013, TAP@STAF.

[27]  Ehud Shapiro,et al.  Algorithmic Program Debugging , 1983 .

[28]  Markus P. J. Fromherz Towards Declarative Debugging of Concurrent Constraint Programs , 1993, AADEBUG.

[29]  Adrián Riesco,et al.  A Survey of Algorithmic Debugging , 2017, ACM Comput. Surv..

[30]  Stephan Merz,et al.  Model Checking , 2000 .

[31]  Adrian Francalanza,et al.  Towards a formalisation of Erlang failure and failure detection , 2012 .

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

[33]  Jens Krinke,et al.  Context-sensitive slicing of concurrent programs , 2003, ESEC/FSE-11.

[34]  Konstantinos Sagonas,et al.  A PropEr integration of types and function specifications with property-based testing , 2011, Erlang Workshop.

[35]  Adrián Riesco,et al.  Debugging Meets Testing in Erlang , 2016, TAP@STAF.

[36]  Ivan Lanese,et al.  A Theory of Reversibility for Erlang , 2018, J. Log. Algebraic Methods Program..

[37]  Gul A. Agha,et al.  ACTORS - a model of concurrent computation in distributed systems , 1985, MIT Press series in artificial intelligence.

[38]  G. G. Stokes "J." , 1890, The New Yale Book of Quotations.

[39]  Parosh Aziz Abdulla,et al.  Optimal dynamic partial order reduction , 2014, POPL.

[40]  Parosh Aziz Abdulla,et al.  Static Detection of Race Conditions in Erlang , 2009 .

[41]  Koen Claessen,et al.  QuickCheck: a lightweight tool for random testing of Haskell programs , 2011, SIGP.

[42]  John Hughes,et al.  Testing telecoms software with quviq QuickCheck , 2006, ERLANG '06.

[43]  Henrik Nilsson,et al.  How to look busy while being as lazy as ever: the Implementation of a lazy functional debugger , 2001, Journal of Functional Programming.

[44]  Josep Silva,et al.  An algorithmic debugger for Java , 2010, 2010 IEEE International Conference on Software Maintenance.