From e0142794a342f520fb069c309dc88f70be5bab56 Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Tue, 16 Mar 2021 02:53:36 -0700 Subject: [PATCH] [lab] adjust README to reflect new option name Summary: The option changed from `--resource-leak` to `--resource-leak-lab`. Fixes https://github.com/facebook/infer/issues/1401 Reviewed By: da319 Differential Revision: D27052496 fbshipit-source-id: baf617fbd --- infer/src/labs/README.md | 4 ++-- infer/tests/codetoanalyze/java/lab/Makefile | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/infer/src/labs/README.md b/infer/src/labs/README.md index ea198163d..c72ff591d 100644 --- a/infer/src/labs/README.md +++ b/infer/src/labs/README.md @@ -56,7 +56,7 @@ Infer should report 7 resource leaks. These reports come from the separation log (b) Run the analyzer on a single test file to produce the debug HTML: ``` -infer -g --resource-leak-only -- javac Leaks.java +infer -g --resource-leak-lab-only -- javac Leaks.java ``` Then, open the debug HTML: @@ -169,7 +169,7 @@ Hint: You will find the `FormalMap` module useful for this. This module lets you (a) Real resource leaks frequently involve failing to close resources along exceptional control-flow paths. For simplicity, the initial version of the current analysis uses a filtered view of the CFG that skips exceptional edges (`ProcCfg.Normal`). To find more bugs, you might want to switch to using `ProcCfg.Exceptional` and make sure that your analysis gets the right answer on some realistic exception examples like [LeaksExceptions.java](https://github.com/facebook/infer/blob/master/infer/tests/codetoanalyze/java/lab/LeaksExceptions.java). (b) Try running on real code! The instructions [here](http://fm.csl.sri.com/SSFT17/infer-instr.html) have several suggestions for open-source Android apps to point your analysis at. Try `./gradlew assembleDebug -x test` first to make sure everything builds correctly without Infer (if not, you are probably missing some dependencies--the error messages should guide you). Once that's working, try -`./gradlew clean; infer run --resource-leak-only -- ./gradlew assembleDebug -x test`. +`./gradlew clean; infer run --resource-leak-lab-only -- ./gradlew assembleDebug -x test`. - Found a real bug? Bonus points! Send a pull request to fix it! Very frequently, the best fix is to use try-with-resources. - Found a false positive in your analysis? Try re-running Infer with `--debug` and see if you can narrow down the root cause/fix it. - How does your analysis compare to Infer's production resource leak analysis? Run with `infer -- ` to see if your analysis finds bugs that Infer misses, or vice versa. diff --git a/infer/tests/codetoanalyze/java/lab/Makefile b/infer/tests/codetoanalyze/java/lab/Makefile index a8aa6b833..4cbb72aaa 100644 --- a/infer/tests/codetoanalyze/java/lab/Makefile +++ b/infer/tests/codetoanalyze/java/lab/Makefile @@ -5,7 +5,7 @@ TESTS_DIR = ../../.. -INFER_OPTIONS = --resource-leak-only --debug-exceptions +INFER_OPTIONS = --resource-leak-lab-only --debug-exceptions INFERPRINT_OPTIONS = --issues-tests SOURCES = $(wildcard *.java)