Infer for Erlang - a static analysis tool used by WhatsApp

Infer is a static analysis tool by Meta: GitHub - facebook/infer: A static analyzer for Java, C, C++, and Objective-C

By its description, “Infer is a static analysis tool for Java, C++, Objective-C, and C. Infer is written in OCaml.”

Yesterday I learned that it is being used to analyze Erlang code at WhatsApp.

Trying Infer on Simple Erlang Code

8 Likes

There is also this paper:
InfERL: Scalable and Extensible Erlang Static Analysis

Thanks, Luiz Aoki.

@adolfont thanks for sharing.

I tried to build infer without success (nightmare Ocaml dependencies).
Then, i tested the Linux (Ubuntu 22.04LTS) prebuilt version but it doesn’t support Erlang.

$ ./bin/infer --pulse-only -- erlc ex1.erl
Usage Error: Unsupported build command 'erlc'.
If this is an alias for another build system that infer supports, you can use
`--force-integration <command>` where <command> is one of the following supported build systems:
  ant
  buck
  cc
  gradle
  java
  javac
  make
  mvn
  ndk-build
  xcodebuild

Same on macOS:

$ brew install infer                                                                                                                ─╯
==> Downloading https://formulae.brew.sh/api/formula.jws.json

==> Downloading https://formulae.brew.sh/api/cask.jws.json
################################################################################################################################ 100.0%
Error: infer has been disabled because it does not build

@adolfont Any chance to make prebuilt versions for macOS and Linux with Erlang support?

2 Likes

Hey! I’m Akos, one of the maintainers of the Erlang support in Infer at WhatsApp. Thanks for your interest! I’ll check with the core Infer team to see if they plan to do a release any time soon. The latest one is from 2021 March and we started to work on Erlang support just after that.

6 Likes

@hajduakos this is great. Thanks

1 Like