facebook / infer

A static analyzer for Java, C, C++, and Objective-C
http://fbinfer.com/
MIT License
14.79k stars 2k forks source link

Improving Robustness of Infer Command #1813

Open DHolden24 opened 5 months ago

DHolden24 commented 5 months ago

I'm doing some research the presence of bugs in Java projects (only projects which use Maven). I'm trying to use Infer to determine the issues present in ~3100 projects, but I'm finding that Infer is failing on 40-50% of the projects.

In most of the failing cases that I've manually investigated, the Infer command fails to run the specified Maven command while the Maven command runs without issue when not using Infer. So I'm wondering if there's a way I can improve the robustness of the Infer command I'm using. I'm not expecting to get Infer running for every project, but I'd like the failure rate to be quite a bit lower if possible.

Infer Version: 1.1.0

OS: Ubuntu 20.04.6 LTS (Running on WSL2)

Command: infer --java-version # --starvation --pulse --biabduction --quandary --annotation-reachability --immutable-cast --loop-hoisting --keep-going -- mvn clean compile -DskipTests -Dmaven.tests.skip=true -Djacoco.skip -Dcheckstyle.skip -Dspotless.apply.skip -Drat.skip -Denforcer.skip -Danimal.sniffer.skip -Dmaven.javadoc.skip -Dmaven.gitcommitid.skip -Dfindbugs.skip -Dwarbucks.skip -Dmodernizer.skip -Dimpsort.skip -Dpmd.skip -Dxjc.skip -Dair.check.skip-all -Dlicense.skip -Dfindbugs.skip -Denforcer.skip -Dremoteresources.skip The value for --java-version gets set based on the Java version specified in each project's pom file to one of 8, 11, or 17. The JAVA_HOME environment variable also gets set to point at the correct Java version.

Infer Output: I can provide an example output if requested, but I'm not noticing a common error between most of the runs (besides that it's a compile error).