infer

metaMIT活跃维护

Meta 开源的静态分析工具,能在编译前扫描 Java、C、C++ 和 Objective-C 代码,提前发现空指针、资源泄漏等潜在缺陷。

A static analyzer for Java, C, C++, and Objective-C

v1.3.0发布于 2026-05-12 15:44 UTC15,749star +3 / 7 天2,099fork同步于 2026-11-10 11:25 UTC

怎么上手

由 README 提炼,执行前请确认
README 未给出具体安装命令,仅指向 Getting Started 页面与 INSTALL.md
硬件要求按 README 说明

README 未说明

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

Meta 开源的静态分析工具,用于在编码阶段发现 Java、C、C++、Objective-C 代码中的缺陷

Meta 开源的静态分析工具,能在编译前扫描 Java、C、C++ 和 Objective-C 代码,提前发现空指针、资源泄漏等潜在缺陷。

核心能力

  • 对 Java、C、C++、Objective-C 做静态分析
  • 用 OCaml 实现的分析引擎
  • 提供打包版本,可直接安装使用
  • 支持从源码构建

容易踩的坑

启用 Java 支持可能需要额外下载并安装 GPL 许可的组件;具体安装步骤需查阅官网 Getting Started 或 INSTALL.md,README 本身未给出命令

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v1.3.0
  1. v1.3.0Infer version v1.3.0最新正式版2026-05-12 · 2026-05-12 15:44 UTC

    This is a binary release of Infer for Linux and MacOS. To use it follow these instructions.

    Checkers

    • Pulse:

      • New over-approximate join operation (heaps, stacks, attributes, formulas) for combined over+under approximation analysis (gated behind option).
      • Summary Specialization: various fixes (alias specialization, dynamic type specialization for Java final-typed parameters).
      • New models for C/C++/ObjC family: folly (Function, Expected, Try), C file operations, memset, atomic builtins, glib/xlib, thrift, ObjC (NSAttributedString), dispatch_async.
      • New COMPARED_TO_NULL_AND_DEREFERENCED issue type with value-origin tracking.
      • New INFINITE_RECURSION issue type: detects recursive calls where argument values match the current formals.
      • New INFINITE_LOOP issue type (experimental, disabled by default): detects infinite loops via loop invariant inference with per-loop-header path conditions.
    • TOPL: annotation patterns, regex negation, nonnull predicate handling, ambiguous state filtering, --topl-filter-unsure option, multicore thread safety fixes.

    • RacerD: multicore thread-safe sync fields cache.

    • Starvation: new report for locks held on UI thread.

    • Biabduction has been removed (previously deprecated in 1.2.0). Use Pulse instead.

    • Quandary has been removed (previously deprecated in 1.2.0). Use Pulse's taint analysis instead.

    • The following checkers are now deprecated and may be removed in a future release: SIOF, BufferOverrun, Impurity, Purity, LoopHoisting.

    Languages

    • New Python frontend. Main usage is unawaited awaitables errors.

    • New Swift frontend. Based on LLVM bitcode analysis. Primary objective is retain-cycle detection. Includes support for Swift/ObjC interop.

    • New Rust frontend (experimental, work in progress): community-contributed frontend via Charon IR translation. Supports constants, operators, function calls, references/pointers, structs, arrays, tuples, boxes, enums, and error handling.

    • Clang/C++/ObjC: upgraded to LLVM 21.

    • Erlang: pattern-matching rework, comprehension scoping fixes, guard simplification, AST cleanup removing no-op nodes.

    • Java: removed legacy biabduction models.

    New Tools

    • Semdiff: semantic diff tool for Python and Hack with an equality saturation (e-graph) engine for filtering semantically irrelevant AST changes. Supports configurable rewriting rules, conditional rules, contextual dict-key matching, and benchmarking infrastructure.

    Infrastructure

    • Textual SIL: C-to-Textual pipeline (from_c), --store-textual/--export-textual DB storage, SSA restoration, multiple crash fixes.

    • Multicore/parallel analysis infrastructure with thread-safe caches.

    • Cross-platform opam Makefile, Windows dune build support.

    • Deprecated options cleanup and logging for deprecated option usage.

    The sha256 checksums of the tarballs are:

    $ shasum -a 256 infer-*-v1.3.0.tar.xz
    02be62ba931cb43e2d42bbf7abf4bd9a410cf8464cce5453934e25c90a825850  infer-linux-x86_64-v1.3.0.tar.xz
    60eccd231e27f2a3d65947ef75b9adcd1983528296bd1da6f67a6da02e22a96e  infer-osx-arm64-v1.3.0.tar.xz
    
  2. v1.2.0Infer version v1.2.02024-06-21 · 2024-06-21 08:49 UTC
    查看更新说明

    This is a binary release of Infer for Linux and MacOS. To use it follow these instructions.

    Changes

    A lot has happened in the years since 1.1.0 so these are just the highlights. Full Changelog: https://github.com/facebook/infer/compare/v1.1.0...v1.2.0.

    Checkers

    Languages

    • New Erlang frontend. You can analyse Erlang code compiling with erlc, rebar3 or buck2.

    • New Hack frontend, based on hackc.

    • New "Textual" intermediate frontend. Textual is a new input format that frontend writers may use to emit SIL, either in text form or from OCaml directly. It is currently used by the Hack frontend. Textual can also be used to write analysis models, i.e. stubs for certain functions that will be used during the analysis as if they were these functions' implementations.

    Build System Integrations

    • Clang upgraded to version 18.

    • buck2 support.

    Backend

    • Incremental mode much improved, see the new --incremental-analysis flag in the updated workflow for CI d
  3. v1.1.0Infer version v1.1.02021-03-26 · 2021-03-26 15:18 UTC
    查看更新说明

    This is a new release of Infer, with a binary tarball for Linux. On MacOS, using Homebrew is recommended. Please follow these instructions.

    Frontends

    Build System Integrations

    • Clang upgraded to version 11.0

    Checkers

    • Liveness: properly handle exceptional control flow
    • Pulse:
    • NEW checker Topl(early alpha): An experimental checker framework: write your own analysis as a state machine representing a temporal property over multiple memory objects at once, eg to write a taint analysis. Topl is based on Pulse.
    • Miscellaneous improvements to cost, inferbo, nullsafe, racerd, starvation

    The sha256 checksums of the tarballs are:

    $ shasum -a 256 infer-linux64-v1.1.0.tar.xz
    5f5d453814422e93e2a70998d8946b09a2721628ff427f67ff0123dea87461d4  infer-linux64-v1.1.0.tar.xz
    
  4. v1.0.0Infer version v1.0.02020-10-12 · 2020-10-12 14:26 UTC
    查看更新说明

    This is a binary release of Infer for Linux and MacOS. To use it follow these instructions.

    The Linux binary is built for Ubuntu 18 and may require adjustments to run on other configurations.

    The Mac binary is built for the Catalina version. MacOS users may get an error "developer cannot be verified" and need to allow the app to run manually following these instructions, or alternatively get infer from Homebrew when it is released there.

    The sha256 checksums of the tarballs are:

    $ shasum -a 256 infer-*-v1.0.0.tar.xz              
    510eeccc7e6bcc2678ac92a88f8e1cb9c07c3e14d272dcc06834e93845bb120f  infer-linux64-v1.0.0.tar.xz
    4f188959f7c61e2ef3b935c8a9e5e66632d7fcb90c5362336fb8305d4f74d6b7  infer-osx-v1.0.0.tar.xz
    

    Changelog

    Checkers

    AL is now deprecated and may be removed in future versions.

    Annotation Reachability

    • reporting format improvements (the trace is no longer included in the report text, only as metadata)

    Biabduction

    • disable some less-used bug types

    Eradicate

    • remove "Field not mutable" check

    RacerD

    • Now defaults to "angelic" ownership: an unknown function is assumed to return owned objects.
    • No more reports on races on paths rooted on temporary or local variables, as these are unreliably modelled.

    Litho Required Properties: new Java checker to check that all non-optional @Props have been specified when constructing Litho components. Self in Block: new Objective-C checker to detect when an Objective-C block incorrectly captures self Starvation

    • New experimental "global" analysis mode. Enable with --starvation-whole-program

    Miscellaneous improvements to most checkers, in particular Annotation Reachability, Cost Analysis, Eradicate, Inefficient Keyset Iterator, InferBO, Pulse, RacerD, Starvation, and Uninitialized Value.

    Build System Integrations

    • The Gradle integration now captures Java files in parallel
    • New Buck integration for Java, enable with --buck-java-flavor
    • Clang upgraded to version 9.0

    Command Line Interface

    • New subcommand infer help to display information about checkers and issue types.
    • New subcommand infer debug that replaces the uses of infer explore not related to reported issues.
    • --debug no longer disables filtering, you have to pass -g -F to get the previous behaviour back.
    • All disk artefacts (except the Java type environment) are now stored in the SQLite database in infer-out/results.db. The contents of the database can be explored with infer debug.
    • Changed how to select the Buck integration. The old command line interface is still supported but is now deprecated.
      • clang via "flavors", activated with --flavors, now with --buck-clang
      • clang via "compilation DB", activated with --buck-compilation-database, unchanged
      • Java via "genrule", activated with --genrule-master-mode, now with --buck-java
      • Java "without genrules", used to be activated b
  5. v0.17.0Infer version 0.17.02019-08-06 · 2019-08-06 11:05 UTC
    查看更新说明

    This is a binary release of Infer for Linux and MacOS. To use it follow these instructions.

    Highlights:
    • There’s a new --inefficient-keyset-iterator checker for finding inefficient uses of Java's keyset iterators that retrieve both key and value (on by default).
    • Complete the set of Android thread annotations and Java nullability annotations. Updated artifacts are available on Maven Central.
    • --starvation is now on by default. This analysis catches problems with threads not being able to make progress due to locking issues, incorrect scheduling priorities, etc. For instance, on Android calling Future.get from a UiThread without a sensible timeout will be flagged as a starvation issue.
    • New Objective-C linter for calls to @optional methods: UNSAFE_CALL_TO_OPTIONAL_METHOD, enabled by default.
    • A new call-graph scheduler (--call-graph-schedule) improves performance of the analysis phase of Infer, especially when the number of files to analyze is less than available CPUs.
    • A new flag --oom-threshold allows to throttle the analysis when the amount of free memory is below the provided threshold.
    • New genrule based Buck/Java integration is much faster than the previous one, use with --genrule-master-mode.
    • Infer’s internal clang is now in version 8.0.0.
    • Update to javalib 3.1 provides better compatibility with Java 9 and Java 11. Refer to their change log for more details.
    • Infer can now be built and run on MacOS Mojave without fiddling with SDKROOT (although you still might need it with non-standard toolchain setup).
    • [β] Pulse is a new experimental lifetime analysis for C++, give it a try with --pulse. Beware that it doesn’t report much yet.
    • --ownership checker was superseded by Pulse and removed.

    ... and many other fixes and improvements. For the full list of changes included see here.

    The facebook-clang-plugins version used for this release is https://github.com/facebook/facebook-clang-plugins/commit/9386890e42043d04f9 cd9e7b204cb525d4417c41.

    The sha256 checksums of the tarballs are:

    $ shasum -a 256 infer-*-v0.17.0.tar.xz
    de972ba3043f18b29a8eff6cd7612e24f5ffaef038dc7949befeaf490931725e  infer-linux64-v0.17.0.tar.xz
    1a3ef6fb51846ae63ffd7fde3b0255f75bab6157f5de1842606fa32988d101f8  infer-osx-v0.17.0.tar.xz
    

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Infer build website

    Infer is a static analysis tool for Java, C++, Objective-C, and C. Infer is written in OCaml.

    Installation

    Read our Getting Started page for details on how to install packaged versions of Infer. To build Infer from source, see INSTALL.md.

    Contributing

    See CONTRIBUTING.md.

    License

    Infer is MIT-licensed.

    Note: Enabling Java support may require you to download and install components licensed under the GPL.