Summary: Previously, we wouldn't report races where the write was under synchronization.
Reviewed By: peterogithub
Differential Revision: D4658850
fbshipit-source-id: e9f4c41
Summary: I encountered cases where the class name part of the method name was passed as `(None, "package.Class")` instead of `("package", "Class")` and therefore incorrectly failing some inequality checks
Reviewed By: sblackshear
Differential Revision: D4662617
fbshipit-source-id: 98ee3e3
Summary: We had our own mechanism for saving `./configure` flags, which does not work if flags contain whitespace. It turns out that `./config.stats --config` is a thing though.
Reviewed By: mbouaziz
Differential Revision: D4642422
fbshipit-source-id: ae075ca
Summary:
Given two analysis results, it's now possible to compare them with the following command:
infer --diff --report-current reportA.json --report-previous reportB.json --file-renamings file_renamings.json
this command will then generate 3 files in `infer-out/differential/{introduced, fixed, preexisting}.json`, whose meaning is the following:
- `introduced.json` has all issues in `current` that are not in `previous`
- `fixed.json` has all issues in `previous` that are not in `current`
- `preexisting.json` has all issues that are in both `current` and `previous`
The json files generated can then be used to categorise results coming from incremental analyses of a codebase.
Reviewed By: jvillard
Differential Revision: D4482517
fbshipit-source-id: 1f7df3e
Summary: Make backend aware of some template instantiation arguments for template classes.
Reviewed By: jberdine
Differential Revision: D4421338
fbshipit-source-id: f7d72b4
Summary:
In order to be able to report races like
```
synchronized write() {
this.f = ...
}
read() {
return this.f;
}
```
, we need to track writes that happen inside of synchronization as well as writes that happen outside of synchronization.
This diff takes a step toward making that possible by defining an "AccessDomain" mapping a precondition for the safety of a write ( {Safe, SafeIf i, Unsafe} =~ {true, owned(i), false} ) to a set of writes that are safe if the precondition will hold.
We're not actually tracking safe writes yet, but this domain will make it easy to do so.
This also lets us kill the conditional writes/unconditional writes combo, which was a bit clumsy
Reviewed By: peterogithub
Differential Revision: D4620153
fbshipit-source-id: 2d9c5ef
Summary:
Make sure `inferTraceBugs` works with non-ascii characters. Harden the code a
bit more on the way.
Fixes#592
Reviewed By: mbouaziz
Differential Revision: D4659016
fbshipit-source-id: 79f7a80
Summary:
* Makes running Android example simpler - APG 2.2.0 automatically downloads dependencies so long as the user has previously accepted the Android SDK License.
* APG 2.2.0 requires Gradle 2.14 or newer, so updated to latest.
* Added `buildOptions.abortOnError false` so the build doesn't report any lint issues - the sample is designed to show Infer working, not Android lint.
Closes https://github.com/facebook/infer/pull/595
Reviewed By: dulmarod
Differential Revision: D4642707
Pulled By: jvillard
fbshipit-source-id: a2b2e02
Summary: Not priting it results in staring terminal not priting anything for a long time. Just to realize `make` just started to build clang.
Reviewed By: martinoluca, jvillard
Differential Revision: D4642791
fbshipit-source-id: 177a228
Summary: The implementation of `touch_start_file` was not updating the timestamp when the file exists.
Reviewed By: jvillard
Differential Revision: D4657708
fbshipit-source-id: 0a88ebc
Summary: I accidentally save a summary with the wrong procedure name, which was affecting the analysis in some weird way. This makes this case no longer possible
Reviewed By: cristianoc
Differential Revision: D4654002
fbshipit-source-id: 9fcbe4e
Summary: This function was actually doing the same as `Idenv.create`.
Reviewed By: cristianoc
Differential Revision: D4654241
fbshipit-source-id: 87c098b
Summary:
This is helpful to make sure tests are up to date wrt the models.
Also made the Java deps depend on the models.jar instead of the model sources
as that's what the tests will be using. In particular, updating the sources of
the models will not update the results of a test unless someone rebuilds
models.jar, so rerunning the tests when the models haven't been rebuilt is
useless.
Reviewed By: akotulski
Differential Revision: D4635129
fbshipit-source-id: 75b4ab6
Summary:
This is part of the plan to have every checker take a summary as input, and return the updated sumamry as output. Doing so, we can run all the registered checkers in sequence for every method
This diff change the type of `Ondemand.analyze_ondemand` to return the analysis summary.
Reviewed By: sblackshear
Differential Revision: D4626918
fbshipit-source-id: f8ad928
Summary:
Stop multiple reports per line happening. These come about
because of interprocedural access to multiple fields. Present one trace,
and summary information about other accesses.
Reviewed By: sblackshear
Differential Revision: D4636232
fbshipit-source-id: 9039fea
Summary:
All intermediate `.exp` files used for tests can be generated with custom info, based on what is needed for the tests purposes.
This customisation happens via command-line argument `--issues-fields`.
Reviewed By: cristianoc, jvillard
Differential Revision: D4628062
fbshipit-source-id: feaa382
Summary:
For writes of serialized data, write directly to the file instead of using a temporary one, and lock the file before writing.
Also added an `update` function to the API, to update an existing version of the data file instead of just replacing it with a new value.
Reviewed By: jberdine
Differential Revision: D4619958
fbshipit-source-id: 9642408
Summary: This seems to only be used for stats and for the concept of call rank that is not used right now
Reviewed By: cristianoc
Differential Revision: D4624681
fbshipit-source-id: 7406496
Summary:
With the ondemand analysis framework, the concept of timestamp was only being use to check if a procedure has already been analyzed. There was already a concept of "active" procedure for the procedure that were already being analyzed. This revision removes the concept of timestamp and merge it with the concept of analysis status.
This can be simplified further once the analysis always goes through `Ondemand.analyze`.
Reviewed By: cristianoc
Differential Revision: D4610371
fbshipit-source-id: 0fc516b
Summary:
- The package declaration was wrong
- There was a leftover copy-pasted resource leak test from `CursorLeak.java`.
Reviewed By: sblackshear
Differential Revision: D4612687
fbshipit-source-id: 42c1a35
Summary: procnames will depend on Typ.t soon and we need to go from `type_ptr` to `Typ.t` when creating procnames. `CType_decl` does this translation it can't depend on `mk_procname_` functions.
Reviewed By: jvillard
Differential Revision: D4620560
fbshipit-source-id: 9524178
Summary:
Polymorphic models, and type environment refinements, need mutual
references between general types and struct types.
Reviewed By: cristianoc
Differential Revision: D4620076
fbshipit-source-id: f9d01e6
Summary:
1. That information isn't used anywhere so far
2. It will simplify my future workr
3. It can be put back later when we realize we need it
Reviewed By: jvillard
Differential Revision: D4620475
fbshipit-source-id: 2c21ac1
Summary: Rather than having three separate annotations related to checking/assuming thread-safety, let's just have one annotation instead.
Reviewed By: peterogithub
Differential Revision: D4605258
fbshipit-source-id: 17c935b
Summary:
Required in a follow-up into interpret ThreadSafe(enableChecks = false).
Just translating the bool as a string for simplicity, since we already support string parameters.
Reviewed By: jeremydubreil
Differential Revision: D4605222
fbshipit-source-id: 8608bdd
Summary: The summary was stored to disk at the end of the on-demand analysis, unless an exception was raised in which case it was only updated in the in-memory cache.
Reviewed By: sblackshear
Differential Revision: D4612369
fbshipit-source-id: 1c8d75b
Summary:
Given #524 was required to do the last manual update, perhaps the Dockerfile could be updated as part of the release process instead of catching it after the fact?
Cheers!
Closes https://github.com/facebook/infer/pull/585
Reviewed By: akotulski
Differential Revision: D4620311
Pulled By: jvillard
fbshipit-source-id: fa74d95
Summary:
Fixes this error in the Docker image build (mentioned in https://github.com/facebook/infer/issues/570#issuecomment-282191663):
```
#=== ERROR while installing ctypes.0.11.3 =====================================#
# opam-version 1.2.2
# os linux
# command make XEN=disable ctypes-foreign
# path /root/.opam/infer-4.02.3/build/ctypes.0.11.3
# compiler 4.02.3
# exit-code 2
# env-file /root/.opam/infer-4.02.3/build/ctypes.0.11.3/ctypes-5557-6ff7fe.env
# stdout-file /root/.opam/infer-4.02.3/build/ctypes.0.11.3/ctypes-5557-6ff7fe.out
# stderr-file /root/.opam/infer-4.02.3/build/ctypes.0.11.3/ctypes-5557-6ff7fe.err
### stdout ###
# [...]
# The following required C libraries are missing: libffi.
# Please install them and retry. If they are installed in a non-standard location
# or need special flags, set the environment variables <LIB>_CFLAGS and <LIB>_LIBS
# accordingly and retry.
#
# For e
Closes https://github.com/facebook/infer/pull/587
Reviewed By: mbouaziz
Differential Revision: D4605385
Pulled By: jvillard
fbshipit-source-id: 689cd4e
Summary:
Fixes this error in the Docker image build (mentioned in https://github.com/facebook/infer/issues/570#issuecomment-282191663):
```
#=== ERROR while installing ctypes.0.11.3 =====================================#
# opam-version 1.2.2
# os linux
# command make XEN=disable ctypes-foreign
# path /root/.opam/infer-4.02.3/build/ctypes.0.11.3
# compiler 4.02.3
# exit-code 2
# env-file /root/.opam/infer-4.02.3/build/ctypes.0.11.3/ctypes-5557-6ff7fe.env
# stdout-file /root/.opam/infer-4.02.3/build/ctypes.0.11.3/ctypes-5557-6ff7fe.out
# stderr-file /root/.opam/infer-4.02.3/build/ctypes.0.11.3/ctypes-5557-6ff7fe.err
### stdout ###
# [...]
# The following required C libraries are missing: libffi.
# Please install them and retry. If they are installed in a non-standard location
# or need special flags, set the environment variables <LIB>_CFLAGS and <LIB>_LIBS
# accordingly and retry.
#
# For e
Closes https://github.com/facebook/infer/pull/587
Differential Revision: D4620091
Pulled By: jvillard
fbshipit-source-id: 14c95f4
Summary:
Running Buck can be very expensive depending on your installation of Buck (eg,
no watchman). Hardcoded paths seem good enough for now as `make test` will
catch if they go out of date.
Reviewed By: jeremydubreil
Differential Revision: D4597629
fbshipit-source-id: da9b704
Summary:
As noticed by technion in https://github.com/facebook/infer/issues/570,
failures in the Docker test do not result in failures of the test. Lol.
Reviewed By: mbouaziz
Differential Revision: D4605364
fbshipit-source-id: de9f84c