skip to main content
10.1145/3239332.3242765acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
research-article

Automatic detection of core Erlang message passing errors

Published:29 September 2018Publication History

ABSTRACT

Erlang's powerful communication model allows us to build high-level concurrent systems. These can, however, harbour subtle communication errors less severe than global deadlock or crashes: messages never received can degrade performance and consume swaths of memory. We believe that some of these errors can be quickly detected with static analysis. We have built a prototype tool which operates at the Core Erlang level to assist identification of some of these errors.

We present a fragment of Erlang's type system as a subtyping relation, following up with type inference functions for a portion of Core Erlang's patterns, guards, and message syntax. The implementation of the prototype is detailed, noting specific behaviours of the Erlang compiler and nuances of Core Erlang's syntax along the way, some of which complicate our analysis.

Although our tool is at a very early stage of development, we show examples of the errors we can identify, despite using a considerable over-approximation in our type inference system. After comparing our tool to other work in the Erlang community and beyond, we reflect on the current state of the prototype, before considering further applications of our concept of message compatibility.

References

  1. Duncan Paul Attard, Ian Cassar, Adrian Francalanza, Luca Aceto, and Anna Ingólfsdóttir. 2017. Behavioural Types: From Theory to Tools. River Publishers, Chapter 3, 49–76.Google ScholarGoogle Scholar
  2. F. Barbanera, M. Dezaniciancaglini, and U. Deliguoro. 1995. Intersection and Union Types: Syntax and Semantics. Information and Computation 119, 2 (1995), 202 – 230. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Richard Carlsson. 2001. An introduction to Core Erlang. In PLI’01 Erlang Workshop.Google ScholarGoogle Scholar
  4. Richard Carlsson, Björn Gustavsson, Erik Johansson, Thomas Lindgren, Sven-Olof Nyström, Mikael Pettersson, and Robert Virding. 2004. Core Erlang 1.0.3 language specification. Technical Report. Uppsala University.Google ScholarGoogle Scholar
  5. Maria Christakis and Konstantinos Sagonas. 2011. Detection of Asynchronous Message Passing Errors Using Static Analysis. In Practical Aspects of Declarative Languages. Springer, Berlin, Heidelberg, 5–18. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Emanuele D’Osualdo, Jonathan Kochems, and C. H. Luke Ong. 2013. Automatic Verification of Erlang-Style Concurrency. In Static Analysis, Francesco Logozzo and Manuel Fähndrich (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg, 454–476.Google ScholarGoogle Scholar
  7. Emanuele D’Osualdo, Jonathan Kochems, and Luke Ong. 2013. SOTER - Safety verifier fOr The ERlang language. https://mjolnir.cs.ox.ac.uk/ soter/Google ScholarGoogle Scholar
  8. Erlang/OTP Team. 2018. Erlang Reference Manual. Ericsson AB. v9.3, Chapter: Expressions.Google ScholarGoogle Scholar
  9. Erlang/OTP Team. 2018. Erlang/OTP. http://erlang.org/download/ otp_src_20.3.tar.gz v20.3.Google ScholarGoogle Scholar
  10. Lars Fredlund and Hans Svensson. 2007. McErlang: A Model Checker for a Distributed Functional Programming Language. In Proceedings of the 12th ACM SIGPLAN International Conference on Functional Programming (ICFP ’07). ACM, New York, NY, USA, 125–136. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Alkis Gotovos, Maria Christakis, and Konstantinos Sagonas. 2011. Testdriven Development of Concurrent Programs Using Concuerror. In Proceedings of the 10th ACM SIGPLAN Workshop on Erlang (Erlang ’11). ACM, New York, NY, USA, 51–61. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Joe Harrison. 2018. sigwinch28/pdis: Erlang’18 artifact.Google ScholarGoogle Scholar
  13. Julien Lange, Nicholas Ng, Bernardo Toninho, and Nobuko Yoshida. 2018. A Static Verification Framework for Message Passing in Go Using Behavioural Types. In Proceedings of the 40th International Conference on Software Engineering (ICSE ’18). ACM, New York, NY, USA, 1137– 1148. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Tobias Lindahl and Konstantinos Sagonas. 2006. Practical Type Inference Based on Success Typings. In Proceedings of the 8th ACM SIGPLAN International Conference on Principles and Practice of Declarative Programming (PPDP ’06). ACM, New York, NY, USA, 167–178. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Simon Marlow and Philip Wadler. 1997. A Practical Subtyping System for Erlang. In Proceedings of the Second ACM SIGPLAN International Conference on Functional Programming (ICFP ’97). ACM, New York, NY, USA, 136–149. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Rumyana Neykova and Nobuko Yoshida. 2017. Let It Recover: Multiparty Protocol-induced Recovery. In Proceedings of the 26th International Conference on Compiler Construction (CC 2017). ACM, New York, NY, USA, 98–108. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Sven-Olof Nyström. 2003. A Soft-typing System for Erlang. In Proceedings of the 2003 ACM SIGPLAN Workshop on Erlang (ERLANG ’03). ACM, New York, NY, USA, 56–71. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. David J. Pearce. 2013. Sound and Complete Flow Typing with Unions, Intersections and Negations. In Proceedings of the 14th International Conference on Verification, Model Checking, and Abstract Interpretation - Volume 7737 (VMCAI 2013). Springer-Verlag, Berlin, Heidelberg, 335– 354. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Josef Svenningsson. 2018. A gradual type system. (06 2018). Talk at Code BEAM STO.Google ScholarGoogle Scholar

Index Terms

  1. Automatic detection of core Erlang message passing errors

              Recommendations

              Comments

              Login options

              Check if you have access through your login credentials or your institution to get full access on this article.

              Sign in
              • Published in

                cover image ACM Conferences
                Erlang 2018: Proceedings of the 17th ACM SIGPLAN International Workshop on Erlang
                September 2018
                70 pages
                ISBN:9781450358248
                DOI:10.1145/3239332

                Copyright © 2018 ACM

                Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

                Publisher

                Association for Computing Machinery

                New York, NY, United States

                Publication History

                • Published: 29 September 2018

                Permissions

                Request permissions about this article.

                Request Permissions

                Check for updates

                Qualifiers

                • research-article

                Acceptance Rates

                Overall Acceptance Rate51of68submissions,75%

                Upcoming Conference

                ICFP '24

              PDF Format

              View or Download as a PDF file.

              PDF

              eReader

              View online with eReader.

              eReader