Infer | Need help?
Need help?β
Do not hesitate to ask questions using the following channels, or to submit pull request!
GitHub issuesβ
The GitHub issues page is a good place to ask questions, find answers, and report issues.
Please include as many details as possible when submitting a GitHub issue. If
you are able to run Infer, please include the contents of
infer-out/toplevel.log
in your report. If not, please include at least your
operating system and the version of Infer that you are using.
Updatesβ
Keep up to date with the latest Infer news on our Facebook page and our Twitter account.
IRCβ
Our IRC channel is #infer
on Libera Chat.
Troubleshootingβ
Infer cannot analyze my CocoaPods projectβ
In the presence of CocoaPods, you should use xcworkspace and not xcodeproj in the compilation command that you supply to Infer. Here is an example you can adapt to your project:
infer run -- xcodebuild -workspace HelloWorld.xcworkspace -scheme HelloWorld
infer [options] -- <build command>
fails during a linking stepβ
The linker will sometimes not work if files have been compiled using a different compiler, such as the one Infer uses under the hood to analyze your files.
A workaround consists in setting the LD
environment variable to a dummy
linker, for instance:
LD=/bin/true infer [options] -- <build command>
I get a compilation error involving PCH files when running Inferβ
For instance,
error: PCH file uses an older PCH format that is no longer supported
.
This is a known issue.
Please run Infer with the following environment variable setting:
GCC_PRECOMPILE_PREFIX_HEADER=NO
Infer reports a "Too many open files" errorβ
The maximum number of files a program can simultaneously hold open is a bit low on MacOs. You can increase the limit by running these commands for example:
sysctl -w kern.maxfiles=20480
sysctl -w kern.maxfilesperproc=22480
ulimit -S -n 2048
Note that the settings will be reset at the next reboot.
See also this GitHub issue.
I get a lint error when running Infer with gradleβ
You need to manually disable linters to run Infer. For instance
infer run -- gradle build -x lint
See also this GitHub issue.
Running infer [options] -- <build command>
fails with some other errorβ
Please make sure that:
<build command>
runs successfully on its own.infer
is in your$PATH
(trywhich infer
, it should show whereinfer
is located)
I get errors compiling Inferβ
Make sure the dependencies are up to date. They may change as we update Infer itself. See the installation document for an up-to-date list of dependencies and how to get them.
My problem is not listed hereβ
Do not hesitate to contact us.
FAQβ
Here are some frequently asked questions. More to come.
How do I suppress Infer warnings on a class or method?β
In Java code, you can do this for some error types by annotating
your class or method with @SuppressLint("<ISSUE_TYPE>")
, for example
@SuppressLint("NULL_DEREFERENCE")
. However, not all checkers honor
this annotation.
Is Infer supported for Windows?β
Infer is not supported on Windows at the moment. You may try installing Infer on a Linux virtual machine if your project can be compiled on Linux.
How does Infer compare to the Clang Static Analyzer?β
Infer and Clang Static Analyzer (CSA) will typically find different kinds of issues on the same project. One thing that sets Infer apart from other static analysis tools is its ability to reason and find issues across multiple files. But CSA will find many kinds of issues that Infer doesn't find: we send big respect to CSA! Really, these tools complement one another and it makes sense to use both.
How does Infer compare to Android linters and Findbugs?β
Infer finds deeper infer-procedural bugs sometimes spanning multiple files. Linters, in contrast, typically implement simple syntactic checks that are local within one procedure. But they are valuable and Infer doesn't try to duplicate what they are good at. At Facebook we run both Infer and a collection of Android linters. Findbugs can be useful too; it is more akin to linters.