The DIALYZER: a DIscrepancy AnaLYZer for ERlang programs
The Dialyzer is a static analysis tool that identifies software discrepancies and bugs such as obvious type errors, code that has become unreachable due to some programming error, redundant tests, unsatisfiable conditions, etc. in single Erlang modules or entire applications. Dialyzer analyzes either Erlang source code files or debug-compiled BEAM bytecode files and reports to its user the functions where the discrepancies occur and an indication of what the discrepancy is about.
Dialyzer is completely automatic (in its basic mode of operation it does not require any annotations from the user), very easy to use, and currently supports various modes of operation. The analysis that detects defects in the sequential part of Erlang is precise (in particular, no false alarms are reported) and typically also quite fast. We are currently in the process of extending Dialyzer to also detect concurrency defects such as race conditions.
Dialyzer has been applied to large code bases, for example the entire code base of AXD301 consisting of about 2,000,000 lines of Erlang code, and has identified a significant number of software defects that have gone unnoticed after years of extensive testing. It is also under continuous use in the Erlang/OTP system system and its reports have helped eliminate numerous bugs that the Erlang/OTP system contained in some of its standard libraries. In addition, various commercial and open source projects have also integrated Dialyzer in their development toolkits.
We welcome user feedback! In particular, examples of interesting discrepancies identified by Dialyzer, discrepancies that went unnoticed by it (currently Dialyzer is conservative in order not to generate any false positives), and suggestions for improvements.
Related Publications (in reverse chronological order)
Relatively recently, Dialyzer has been extended with the ability to detect data races in Erlang programs and the results are described in the following publication:
- Maria Christakis and Konstantinos Sagonas. Static Detection of Race Conditions in Erlang. In Proceedings of the Twelfth International Symposium on Practical Aspects of Declarative Languages (PADL'10), pages 119-133, 2010. Springer. (BibTeX entry)
We strongly recommend the following paper to all Dialyzer users (and not only):
- Konstantinos Sagonas and Daniel Luna. Gradual Typing of Erlang Programs: A Wrangler Experience. In Proceedings of the Seventh ACM SIGPLAN Erlang Workshop (Erlang'08), pages 73-82, September 2008. ACM. (BibTeX entry)
The theoretical basis of Dialyzer's type inference and analysis is described in:
- Tobias Lindahl and Konstantinos Sagonas. Practical type inference based on success typings. In Proceedings of the Eight ACM SIGPLAN Symposium on Principles and Practice of Declarative Programming (PPDP'06), pages 167-178, 2006. ACM. (BibTeX entry)
Interesting experiences from using Dialyzer in its early development stages are described in the following two papers:
- Konstantinos Sagonas. Experience from Developing the Dialyzer: A Static Analysis Tool Detecting Defects In Erlang Applications Presented at the ACM SIGPLAN Workshop on the Evaluation of Software Defect Detection Tools (Bugs'05). This workshop did not have formal proceedings.
- Tobias Lindahl and Konstantinos Sagonas. Detecting Software Defects in Telecom Applications Through Lightweight Static Analysis: A War Story In Proceedings of the Second ASIAN Symposium on Programming Languages and Systems (APLAS'04), pages 86-101, LNCS, November 2004. Springer. (BibTeX entry)
- Presentation of Dialyzer at the Erlang User Conference, Älvsjö, Sweden, October 2004 (ppt)
Since the Erlang/OTP R11B, dialyzer is an integrated component of the Erlang/OTP distribution (but its development is still done by Kostis Sagonas and his students). We strongly suggest that you try the dialyzer version in the latest Erlang/OTP release. If you for some reason want to use some older versions of dialyzer these can be found below.
Important: Different dialyzer versions need the presence of specific versions of Erlang/OTP. In fact, some Erlang/OTP releases first need to be patched in order for dialyzer to work properly.
|Dialyzer Version||Date||Demanded Erlang/OTP||Remarks|
|v1.4.0||Mar 2006||R10B-10||Needed patches here|
|v1.3.0||Mar 2005||R10B-4||Needed paches here|
|v1.2.0||Dec 2004||R10B-2 (or -3)||Works on all platforms|
|v1.1.0||Nov 2004||R10B-1||Needs HiPE support.|
See also the major features added in each version (Dialyzer's release notes).
Prehistoric versions of Dialyzer can be found here