Skip to content

Commit c4c75da

Browse files
Merge pull request #656 from NathanJPhillips/security-scanner-support
Merge master into Security scanner support
2 parents 749264b + 8723d57 commit c4c75da

File tree

275 files changed

+12820
-628
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

275 files changed

+12820
-628
lines changed

.gitignore

+11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Local files generated by IDEs
2+
.vs/*
23
.vscode/*
4+
~AutoRecover.*
5+
*.sln
6+
*.vcxproj*
7+
scripts/__pycache__/*
8+
src/goto-analyzer/taint_driver_scripts/.idea/*
9+
/*.config
10+
/*.creator
11+
/*.creator.user
12+
/*.files
13+
/*.includes
314

415
# compilation files
516
*.lo

.travis.yml

+39-12
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,35 @@
11
language: cpp
22

3-
sudo: false
4-
53
matrix:
64
include:
5+
6+
# Alpine Linux with musl-libc using g++
7+
- os: linux
8+
sudo: required
9+
compiler: gcc
10+
services:
11+
- docker
12+
before_install:
13+
- docker pull diffblue/cbmc-builder:alpine
14+
env:
15+
- PRE_COMMAND="docker run -v ${TRAVIS_BUILD_DIR}:/cbmc diffblue/cbmc-builder:alpine"
16+
- COMPILER=g++
17+
18+
# OS X using g++
19+
- os: osx
20+
sudo: false
21+
compiler: gcc
22+
env: COMPILER=g++
23+
24+
# OS X using clang++
25+
- os: osx
26+
sudo: false
27+
compiler: clang
28+
env: COMPILER=clang++
29+
30+
# Ubuntu Linux with glibc using g++-5
731
- os: linux
32+
sudo: false
833
compiler: gcc
934
addons:
1035
apt:
@@ -20,7 +45,10 @@ matrix:
2045
- mkdir bin ; ln -s /usr/bin/gcc-5 bin/gcc
2146
# env: COMPILER=g++-5 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover -fno-omit-frame-pointer"
2247
env: COMPILER=g++-5
48+
49+
# Ubuntu Linux with glibc using clang++-3.7
2350
- os: linux
51+
sudo: false
2452
compiler: clang
2553
addons:
2654
apt:
@@ -38,18 +66,17 @@ matrix:
3866
- mkdir bin ; ln -s /usr/bin/clang-3.7 bin/gcc
3967
# env: COMPILER=clang++-3.7 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover=undefined,integer -fno-omit-frame-pointer"
4068
env: COMPILER=clang++-3.7
41-
- os: osx
42-
compiler: gcc
43-
env: COMPILER=g++
44-
- os: osx
45-
compiler: clang
46-
env: COMPILER=clang++
69+
4770
- env: NAME="CPP-LINT"
4871
script: scripts/travis_lint.sh || true
4972

5073
script:
5174
- if [ -L bin/gcc ] ; then export PATH=$PWD/bin:$PATH ; fi ;
52-
make -C src minisat2-download &&
53-
make -C src CXX=$COMPILER CXXFLAGS="-Wall -O2 -g -Werror -Wno-deprecated-register -pedantic -Wno-sign-compare" -j2 &&
54-
env UBSAN_OPTIONS=print_stacktrace=1 make -C regression test &&
55-
make -C src CXX=$COMPILER CXXFLAGS=$FLAGS -j2 cegis.dir clobber.dir memory-models.dir musketeer.dir
75+
COMMAND="make -C src minisat2-download" &&
76+
eval ${PRE_COMMAND} ${COMMAND} &&
77+
COMMAND="make -C src CXX=$COMPILER CXXFLAGS=\"-Wall -O2 -g -Werror -Wno-deprecated-register -pedantic -Wno-sign-compare\" -j2" &&
78+
eval ${PRE_COMMAND} ${COMMAND} &&
79+
COMMAND="env UBSAN_OPTIONS=print_stacktrace=1 make -C regression test" &&
80+
eval ${PRE_COMMAND} ${COMMAND} &&
81+
COMMAND="make -C src CXX=$COMPILER CXXFLAGS=$FLAGS -j2 cegis.dir clobber.dir memory-models.dir musketeer.dir" &&
82+
eval ${PRE_COMMAND} ${COMMAND}

COMPILING

+9-13
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ environments:
1010

1111
- Solaris 11
1212

13-
- FreeBSD 10 or 11
13+
- FreeBSD 11
1414

1515
- Cygwin
16-
(We recommend the i686-pc-mingw32-g++ cross compiler, version 4.7 or above.)
16+
(We recommend the i686-pc-mingw32-g++ cross compiler, version 5.4 or above.)
1717

1818
- Microsoft's Visual Studio version 12 (2013), version 14 (2015),
1919
or version 15 (older versions won't work)
@@ -29,16 +29,16 @@ COMPILATION ON LINUX
2929
We assume that you have a Debian/Ubuntu or Red Hat-like distribution.
3030

3131
0) You need a C/C++ compiler, Flex and Bison, and GNU make.
32-
The GNU Make needs to be version 3.81 or higher. On Debian-like
33-
distributions, do
32+
The GNU Make needs to be version 3.81 or higher.
33+
On Debian-like distributions, do
3434

35-
apt-get install g++ gcc flex bison make git libz-dev libwww-perl patch libzip-dev
35+
apt-get install g++-6 gcc flex bison make git libwww-perl patch
3636

3737
On Red Hat/Fedora or derivates, do
3838

3939
yum install gcc gcc-c++ flex bison perl-libwww-perl patch
4040

41-
Note that you need g++ version 4.9 or newer.
41+
Note that you need g++ version 5.2 or newer.
4242

4343
1) As a user, get the CBMC source via
4444

@@ -48,8 +48,6 @@ We assume that you have a Debian/Ubuntu or Red Hat-like distribution.
4848

4949
cd cbmc-git/src
5050
make minisat2-download
51-
make libzip-download zlib-download
52-
make libzip-build
5351
make
5452

5553

@@ -59,7 +57,7 @@ COMPILATION ON SOLARIS 11
5957
1) As root, get the necessary development tools:
6058

6159
pkg install system/header developer/lexer/flex developer/parser/bison developer/versioning/git
62-
pkg install --accept developer/gcc-49
60+
pkg install --accept developer/gcc-5
6361

6462
2) As a user, get the CBMC source via
6563

@@ -85,8 +83,8 @@ COMPILATION ON SOLARIS 11
8583
It will mis-optimize MiniSat2.
8684

8785

88-
COMPILATION ON FREEBSD 10/11
89-
----------------------------
86+
COMPILATION ON FREEBSD 11
87+
-------------------------
9088

9189
1) As root, get the necessary tools:
9290

@@ -126,8 +124,6 @@ Follow these instructions:
126124

127125
cd cbmc-git/src
128126
make minisat2-download
129-
make libzip-download zlib-download
130-
make libzip-build
131127
make
132128

133129

Binary file not shown.

regression/cbmc-java/NullPointer3/NullPointer3.java

-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ public static void main(String[] args)
44
{
55
throw null; // NULL pointer dereference
66
}
7-
87
}
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
CORE
22
NullPointer3.class
3-
--pointer-check --stop-on-fail
3+
--pointer-check
44
^EXIT=10$
55
^SIGNAL=0$
6-
^ file NullPointer3.java line 5 function java::NullPointer3.main:\(\[Ljava/lang/String;\)V bytecode_index 1$
6+
^.*Throw null: FAILURE$
77
^VERIFICATION FAILED$
88
--
99
^warning: ignoring

regression/cbmc-java/VarLengthArrayTrace1/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ VarLengthArrayTrace1.class
33
--trace
44
^EXIT=10$
55
^SIGNAL=0$
6-
dynamic_3_array\[1l\]=10
6+
dynamic_3_array\[1.*\]=10
77
--
88
^warning: ignoring
99
assignment removed
351 Bytes
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
public class classtest1
2+
{
3+
static void main(String[] args)
4+
{
5+
g(classtest1.class);
6+
}
7+
static void g(Object c)
8+
{
9+
assert true;
10+
}
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
classtest1.class
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^VERIFICATION SUCCESSFUL$
7+
--
8+
^warning: ignoring
234 Bytes
Binary file not shown.
216 Bytes
Binary file not shown.
216 Bytes
Binary file not shown.
216 Bytes
Binary file not shown.
1 KB
Binary file not shown.
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CORE
2+
test.class
3+
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^.*assertion at file test.java line 26 function.*: FAILURE$
7+
\*\* 1 of 9 failed \(2 iterations\)$
8+
^VERIFICATION FAILED$
9+
--
10+
^warning: ignoring
+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
class A extends Throwable {}
2+
class B extends A {}
3+
class C extends B {}
4+
class D extends C {}
5+
6+
public class test {
7+
public static void main (String arg[]) {
8+
try {
9+
D d = new D();
10+
C c = new C();
11+
B b = new B();
12+
A a = new A();
13+
A e = a;
14+
throw e;
15+
}
16+
catch(D exc) {
17+
assert false;
18+
}
19+
catch(C exc) {
20+
assert false;
21+
}
22+
catch(B exc) {
23+
assert false;
24+
}
25+
catch(A exc) {
26+
assert false;
27+
}
28+
}
29+
}
30+
241 Bytes
Binary file not shown.
216 Bytes
Binary file not shown.
216 Bytes
Binary file not shown.
875 Bytes
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
test.class
3+
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^.*assertion at file test.java line 12 function.*: FAILURE$
7+
^VERIFICATION FAILED$
8+
--
9+
^warning: ignoring
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
class A extends RuntimeException {}
2+
class B extends A {}
3+
class C extends B {}
4+
5+
public class test {
6+
static void foo() {
7+
try {
8+
A b = new A();
9+
throw b;
10+
}
11+
catch(A exc) {
12+
assert false;
13+
}
14+
}
15+
16+
public static void main (String args[]) {
17+
try {
18+
A a = new A();
19+
foo();
20+
}
21+
catch(B exc) {
22+
assert false;
23+
}
24+
}
25+
}
276 Bytes
Binary file not shown.
216 Bytes
Binary file not shown.
976 Bytes
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
test.class
3+
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^.*assertion at file test.java line 36 function.*: FAILURE$
7+
^VERIFICATION FAILED$
8+
--
9+
^warning: ignoring
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
class A extends RuntimeException {
2+
int i=1;
3+
};
4+
5+
class B extends A {
6+
};
7+
8+
public class test {
9+
static int foo(int k) {
10+
try {
11+
if(k==0)
12+
{
13+
A a = new A();
14+
throw a;
15+
}
16+
else
17+
{
18+
A b = new A();
19+
throw b;
20+
}
21+
22+
}
23+
catch(B exc) {
24+
assert exc.i==1;
25+
}
26+
return 1;
27+
}
28+
29+
30+
public static void main (String args[]) {
31+
try {
32+
A a = new A();
33+
foo(6);
34+
}
35+
catch(A exc) {
36+
assert exc.i==2;
37+
}
38+
}
39+
}
241 Bytes
Binary file not shown.
216 Bytes
Binary file not shown.
216 Bytes
Binary file not shown.
641 Bytes
Binary file not shown.
740 Bytes
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
test.class
3+
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^.*assertion at file test.java line 12 function.*: FAILURE$
7+
^VERIFICATION FAILED$
8+
--
9+
^warning: ignoring
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
class A extends RuntimeException {}
2+
class B extends A {}
3+
class C extends B {}
4+
5+
class F {
6+
void foo() {
7+
try {
8+
B b = new B();
9+
throw b;
10+
}
11+
catch(B exc) {
12+
assert false;
13+
}
14+
}
15+
}
16+
17+
public class test {
18+
public static void main (String args[]) {
19+
try {
20+
F f = new F();
21+
f.foo();
22+
}
23+
catch(B exc) {
24+
assert false;
25+
}
26+
}
27+
}
241 Bytes
Binary file not shown.
216 Bytes
Binary file not shown.
216 Bytes
Binary file not shown.
405 Bytes
Binary file not shown.
740 Bytes
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
test.class
3+
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
^.*assertion at file test.java line 25 function.*: FAILURE$
7+
^VERIFICATION FAILED$
8+
--
9+
^warning: ignoring

0 commit comments

Comments
 (0)