forked from Floorp-Projects/Floorp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1479503: Check infer in ./mach static-analysis autotest. r=nalexa…
…nder Adds infer to ./mach static-analysis autotest. Differential Revision: https://phabricator.services.mozilla.com/D4547
- Loading branch information
Robert Bartlensky
committed
Sep 12, 2018
1 parent
b26730b
commit 4435ef3
Showing
30 changed files
with
1,242 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# %ARG DOCKER_IMAGE_PARENT | ||
FROM $DOCKER_IMAGE_PARENT | ||
MAINTAINER Robert Bartlensky <[email protected]> | ||
|
||
VOLUME /builds/worker/checkouts | ||
VOLUME /builds/worker/workspace | ||
VOLUME /builds/worker/tooltool-cache | ||
|
||
ENV XZ_OPT=-T0 | ||
|
||
RUN apt-get update && \ | ||
apt-get install \ | ||
autoconf2.13 \ | ||
automake \ | ||
bison \ | ||
bzip2 \ | ||
cmake \ | ||
flex \ | ||
curl \ | ||
opam \ | ||
libsqlite3-dev \ | ||
file \ | ||
gawk \ | ||
gcc-multilib \ | ||
gnupg \ | ||
libc6-dev \ | ||
openjdk-8-jdk-headless \ | ||
pkg-config \ | ||
patch \ | ||
p7zip-full \ | ||
procps \ | ||
python-pip \ | ||
python-setuptools \ | ||
python-virtualenv \ | ||
rsync \ | ||
screen \ | ||
tar \ | ||
unzip \ | ||
uuid \ | ||
valgrind \ | ||
wget \ | ||
yasm \ | ||
zip \ | ||
zlib1g-dev \ | ||
x11-utils \ | ||
xvfb \ | ||
linux-libc-dev \ | ||
libdbus-glib-1-dev \ | ||
libfontconfig1-dev \ | ||
libfreetype6-dev \ | ||
libgconf2-dev \ | ||
libgtk-3-dev \ | ||
libgtk2.0-dev \ | ||
libpango1.0-dev \ | ||
libpulse-dev \ | ||
libx11-xcb-dev \ | ||
libxt-dev \ | ||
lib32z1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
apply plugin: 'java' | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
compile "com.google.code.findbugs:jsr305:3.0.2" | ||
} | ||
|
||
def createSingleTask = { name -> | ||
task("compileInferTest${name}", type: JavaCompile) { | ||
source = fileTree(dir: '.', include: "src/main/java/${name}.java") | ||
classpath = project.configurations.compileClasspath | ||
destinationDir = file("${topobjdir}/gradle/build/tools/infer/test/autotest") | ||
} | ||
} | ||
|
||
createSingleTask('Biabduction') | ||
createSingleTask('Checkers') | ||
createSingleTask('Eradicate') | ||
createSingleTask('Racerd') | ||
createSingleTask('Starvation') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
import javax.annotation.Nullable; | ||
import java.util.List; | ||
|
||
public class Biabduction { | ||
private String get() { return null; } | ||
|
||
public void f1() { | ||
get().length(); // error | ||
} | ||
|
||
public void f2() { | ||
try { | ||
get().length(); // error | ||
} catch (NullPointerException e) { | ||
|
||
} | ||
} | ||
} |
114 changes: 114 additions & 0 deletions
114
tools/infer/test/autotest/src/main/java/Biabduction.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
[ | ||
{ | ||
"bug_class": "PROVER", | ||
"bug_trace": [ | ||
{ | ||
"column_number": -1, | ||
"description": "start of procedure f1()", | ||
"filename": "autotest/src/main/java/Biabduction.java", | ||
"level": 0, | ||
"line_number": 11 | ||
}, | ||
{ | ||
"column_number": -1, | ||
"description": "", | ||
"filename": "autotest/src/main/java/Biabduction.java", | ||
"level": 0, | ||
"line_number": 12 | ||
}, | ||
{ | ||
"column_number": -1, | ||
"description": "start of procedure get()", | ||
"filename": "autotest/src/main/java/Biabduction.java", | ||
"level": 1, | ||
"line_number": 9 | ||
}, | ||
{ | ||
"column_number": -1, | ||
"description": "return from a call to String Biabduction.get()", | ||
"filename": "autotest/src/main/java/Biabduction.java", | ||
"level": 1, | ||
"line_number": 9 | ||
}, | ||
{ | ||
"column_number": -1, | ||
"description": "", | ||
"filename": "autotest/src/main/java/Biabduction.java", | ||
"level": 0, | ||
"line_number": 12 | ||
} | ||
], | ||
"bug_type": "NULL_DEREFERENCE", | ||
"bug_type_hum": "Null Dereference", | ||
"censored_reason": "", | ||
"column": -1, | ||
"file": "autotest/src/main/java/Biabduction.java", | ||
"hash": "918d7eaedf45f651f04c55554c72478c", | ||
"key": "Biabduction.java|f1|NULL_DEREFERENCE", | ||
"kind": "ERROR", | ||
"line": 12, | ||
"node_key": "9afcdcc9d4253c36267a0d34b98c337d", | ||
"procedure": "void Biabduction.f1()", | ||
"procedure_id": "Biabduction.f1():void.4b49520e7621606a0d5661886ff0b098", | ||
"procedure_start_line": 11, | ||
"qualifier": "object returned by `get(this)` could be null and is dereferenced at line 12.", | ||
"severity": "HIGH", | ||
"visibility": "user" | ||
}, | ||
{ | ||
"bug_class": "PROVER", | ||
"bug_trace": [ | ||
{ | ||
"column_number": -1, | ||
"description": "start of procedure f2()", | ||
"filename": "autotest/src/main/java/Biabduction.java", | ||
"level": 0, | ||
"line_number": 15 | ||
}, | ||
{ | ||
"column_number": -1, | ||
"description": "", | ||
"filename": "autotest/src/main/java/Biabduction.java", | ||
"level": 0, | ||
"line_number": 17 | ||
}, | ||
{ | ||
"column_number": -1, | ||
"description": "start of procedure get()", | ||
"filename": "autotest/src/main/java/Biabduction.java", | ||
"level": 1, | ||
"line_number": 9 | ||
}, | ||
{ | ||
"column_number": -1, | ||
"description": "return from a call to String Biabduction.get()", | ||
"filename": "autotest/src/main/java/Biabduction.java", | ||
"level": 1, | ||
"line_number": 9 | ||
}, | ||
{ | ||
"column_number": -1, | ||
"description": "", | ||
"filename": "autotest/src/main/java/Biabduction.java", | ||
"level": 0, | ||
"line_number": 17 | ||
} | ||
], | ||
"bug_type": "NULL_DEREFERENCE", | ||
"bug_type_hum": "Null Dereference", | ||
"censored_reason": "", | ||
"column": -1, | ||
"file": "autotest/src/main/java/Biabduction.java", | ||
"hash": "bc952ce8bad58dac5cb6672dc3150524", | ||
"key": "Biabduction.java|f2|NULL_DEREFERENCE", | ||
"kind": "ERROR", | ||
"line": 17, | ||
"node_key": "9afcdcc9d4253c36267a0d34b98c337d", | ||
"procedure": "void Biabduction.f2()", | ||
"procedure_id": "Biabduction.f2():void.41c05a632eb912a458482c1e2e4dcbb4", | ||
"procedure_start_line": 15, | ||
"qualifier": "object returned by `get(this)` could be null and is dereferenced at line 17.", | ||
"severity": "HIGH", | ||
"visibility": "user" | ||
} | ||
] |
Oops, something went wrong.