Skip to content

Merge develop to security scanner support #1354

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
10a0c01
Pointers returned by getenv must not be manipulated
tautschnig Aug 15, 2017
6d68345
ansi-c library: explicit non-det initialisation, cleanup, syntax fixes
tautschnig Aug 15, 2017
e49c751
Improve ansi-c library syntax check and run via travis
tautschnig Aug 15, 2017
b142da4
Check for memory leaks in C++ new/delete
tautschnig Jan 5, 2017
b934a13
Flag java internal functions as internal in JSON/XML output
peterschrammel Aug 31, 2017
94ec790
Clarified INVARIANT message in get_message_handler
NathanJPhillips Aug 31, 2017
45a97aa
Merge pull request #1313 from NathanJPhillips/bugfix/invariant-message
Aug 31, 2017
d5a5045
HAVE_BV_REFINEMENT and HAVE_JAVA_BYTECODE are no longer needed
Aug 31, 2017
02ed3bf
Merge pull request #1318 from diffblue/HAVE_JAVA_BYTECODE_cleanup
Sep 1, 2017
5fb4cbf
Merge pull request #1243 from tautschnig/ansi-c-library-fixes
Sep 1, 2017
4be7685
Do not add an "l" prefix to double constants when double==long double
tautschnig Sep 1, 2017
e8129a0
Merge basic blocks that are chains of unconditional gotos
peterschrammel Aug 15, 2017
6a8b46f
Instruction to be instrumented representative for basic block
peterschrammel Aug 15, 2017
317f7e8
Protect internals of basic_blockst
peterschrammel Aug 30, 2017
60eb74e
Factor out updating of covered lines in block
peterschrammel Aug 31, 2017
f9ac37a
Select basic block representative instruction
peterschrammel Aug 15, 2017
7f374b3
Warn about anomalies in basic block instrumentation
peterschrammel Aug 15, 2017
99d9613
Expect existing coverage file only to contain array of goals
peterschrammel Aug 21, 2017
5e7a328
List existing goals
peterschrammel Aug 21, 2017
e641d76
Use target source location for java code branches
peterschrammel Aug 16, 2017
d8fdbdb
Regex match on files to be coverage-instrumented
peterschrammel Aug 29, 2017
45ca408
Do not instrument java array built-in functions
peterschrammel Aug 29, 2017
6fee437
Debug info for unique bytecode instrumentation selection
peterschrammel Aug 31, 2017
b85624e
Add missing function ids to instrumented instructions
peterschrammel Aug 31, 2017
bbc99d9
Remove redundant function name from goal descriptions
peterschrammel Aug 31, 2017
e54bc47
Tests for unique java bytecode instrumentation selection
peterschrammel Aug 31, 2017
b6ef688
Fix and run cbmc-cover tests
peterschrammel Aug 31, 2017
15a67e4
Merge pull request #1320 from tautschnig/double-output
Sep 1, 2017
4c94e7c
goto-instrument model-argc-argv: place environment in __CPROVER__start
tautschnig Apr 12, 2017
e8e1677
dump-c: output a generated environment via --harness
tautschnig Apr 12, 2017
a01eeb7
Use invariant annotations instead of asserts
tautschnig Jun 28, 2017
4466408
Replace 3-valued char by enum
tautschnig Aug 23, 2017
48845af
Interpreter: constify mp_integer typed address parameters
tautschnig Aug 23, 2017
f39e5ab
Merge pull request #810 from tautschnig/harness-output
tautschnig Sep 1, 2017
052c149
Merge pull request #1255 from peterschrammel/bugfix/java-unambiguous-…
peterschrammel Sep 1, 2017
8254a3f
Merge pull request #1312 from peterschrammel/bugfix/java-is-internal
peterschrammel Sep 1, 2017
52d1e04
Do not use default arguments for json(...)
tautschnig Aug 23, 2017
4d35274
Simplify pointer_offset(constant)
tautschnig Aug 23, 2017
27fd210
Use generic simplify_expr instead of local simplification rules
tautschnig Aug 23, 2017
28fb804
Merge pull request #1288 from tautschnig/develop-json
tautschnig Sep 2, 2017
6c56f19
Do not attempt to compute union sizes when not required
Aug 25, 2017
165ec47
Test alignment of unions
Aug 25, 2017
4349d91
Merge pull request #1297 from diffblue/union-padding-fix
tautschnig Sep 2, 2017
003482a
MetaChar: use std::stringstream for incremental escaped-string constr…
tautschnig May 13, 2017
8555871
member_offset_bits: express member offset in bits instead of bytes
tautschnig May 13, 2017
3fdcae4
Merge pull request #1331 from tautschnig/cleanup-metachar
Sep 3, 2017
75bdd63
Merge pull request #1332 from tautschnig/member_offset_bits
Sep 3, 2017
4c1b3b3
target name wrong for signed variant of goto-diff
Sep 3, 2017
db77596
Merge pull request #1289 from tautschnig/develop-interpreter-fixes
Sep 3, 2017
52cbfe8
Merge pull request #1334 from diffblue/goto-diff-signed
tautschnig Sep 3, 2017
5bfe346
use ranged for
Aug 29, 2017
29f1e2a
eliminate constrained BP calls
Aug 29, 2017
9e43500
remove assert()
Aug 29, 2017
ede380f
goto-gcc removes CPROVER macros for native gcc
karkhaz Jun 21, 2017
c8f69b5
Merge pull request #1108 from karkhaz/kk-neu-cprover-remove
tautschnig Sep 4, 2017
1fd8b87
Add header for magic numbers
karkhaz Jul 14, 2017
85521b0
goto-gcc reads definitions from linker scripts
karkhaz Jun 5, 2017
cb467c9
Merge pull request #1173 from karkhaz/kk-synthesise-linker-symbols
tautschnig Sep 4, 2017
3947228
Do not overwrite non-zero return codes
tautschnig Sep 4, 2017
433e139
Fix verbosity in goto-gcc
Aug 24, 2017
94ce608
Merge pull request #1344 from tautschnig/fix-result-checking
tautschnig Sep 4, 2017
dd5adf7
Properly prepare goto model for (reachability) slice
tautschnig Sep 4, 2017
b2397e4
Merge pull request #1346 from tautschnig/slicing-prep
Sep 4, 2017
59c882b
Merge pull request #1294 from diffblue/goto-gcc-fix
tautschnig Sep 5, 2017
2e04c17
Replace syntactic_difft pointer by automatic variable
Sep 1, 2017
3dd8fe5
Merge pull request #1352 from janmroczkowski/janmroczkowski/syntactic…
tautschnig Sep 6, 2017
dce6ae1
Improve filter_by_diff.py and friends
smowton Sep 5, 2017
389221e
run_diff.sh shellcheck fixes
smowton Sep 6, 2017
b28e701
fixup! variants of service functions for goto_modelt
tautschnig Sep 4, 2017
fd56921
fixup! Fix and run cbmc-cover tests
tautschnig Sep 4, 2017
8054162
fixup! Instrument string-refinement code such that null-pointer check…
tautschnig Sep 4, 2017
7d26139
fixup! Replace BV_ADDR_BITS by config setting
tautschnig Sep 4, 2017
d5db0bc
fixup! added a test case for combination use of forall/exists/not.
tautschnig Sep 5, 2017
191f371
fixup! a right place to implement the quantifier handling.
tautschnig Sep 5, 2017
24be89c
fixup! simplify \'not exists\' to the form of \'forall not\'
tautschnig Sep 5, 2017
dfd00d3
fixup! Translate exprt to/from miniBDD
tautschnig Sep 5, 2017
66719a9
fixup! goto-instrument --print-path-lengths: statistics about control…
tautschnig Sep 5, 2017
f12c790
fixup! fixup! Add --drop-unused-functions option
tautschnig Sep 5, 2017
82ab237
fixup! Split java nondet pass in two
tautschnig Sep 5, 2017
2060b34
fixup! Added __CPROVER_array_replace to complement __CPROVER_array_set
tautschnig Sep 5, 2017
9d5d907
fixup! Allow extra entry-points to be specified for CI lazy loading
tautschnig Sep 5, 2017
f72b7fc
pointer_typet now requires a width
Aug 23, 2017
ce86319
pointer types now have width
May 28, 2017
d3c0b57
remove legacy constructors
Aug 15, 2017
02c4ac6
Merge pull request #1303 from diffblue/cleanup-goto-inline
Sep 7, 2017
0423be7
Merge pull request #1351 from tautschnig/develop-cleanup
Sep 7, 2017
8425bf4
Merge pull request #970 from diffblue/pointers-with-width
Sep 7, 2017
34492db
Merge pull request #1350 from diffblue/smowton/feature/improved_filte…
smowton Sep 7, 2017
5648db1
Merge latest changes from develop to Security Scanner Support
NathanJPhillips Sep 7, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ install:
eval ${PRE_COMMAND} ${COMMAND}
- COMMAND="make -C src boost-download" &&
eval ${PRE_COMMAND} ${COMMAND}
- COMMAND="make -C src/ansi-c library_check" &&
eval ${PRE_COMMAND} ${COMMAND}
- COMMAND="make -C src CXX=\"$COMPILER\" CXXFLAGS=\"-Wall -Werror -pedantic -O2 -g -DUSE_BOOST $EXTRA_CXXFLAGS\" -j2" &&
eval ${PRE_COMMAND} ${COMMAND}
- COMMAND="make -C src CXX=\"$COMPILER\" CXXFLAGS=\"$FLAGS $EXTRA_CXXFLAGS\" -j2 clobber.dir memory-models.dir musketeer.dir" &&
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* GOTO-INSTRUMENT: New option --remove-function-body
* GOTO-INSTRUMENT: New option --use-all-headers, changed --use-system-headers to
--no-system-headers
* GOTO-INSTRUMENT: dump-c can output the generated environment via --harness


5.7
Expand Down
1 change: 1 addition & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ test_script:
rmdir /s /q cbmc-java\classpath1
rmdir /s /q cbmc-java\jar-file3
rmdir /s /q cbmc-java\tableswitch2
rmdir /s /q goto-gcc
rmdir /s /q goto-instrument\slice08

make test
Expand Down
13 changes: 10 additions & 3 deletions regression/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
DIRS = ansi-c \
cbmc \
cpp \
cbmc-cover \
cbmc-java \
cbmc-java-inheritance \
cpp \
goto-analyzer \
goto-diff \
goto-gcc \
goto-instrument \
goto-instrument-typedef \
invariants \
Expand All @@ -13,9 +15,14 @@ DIRS = ansi-c \
test-script \
# Empty last line


# Check for the existence of $dir. Tests under goto-gcc cannot be run on
# Windows, so appveyor.yml unlinks the entire directory under Windows.
test:
$(foreach var,$(DIRS), $(MAKE) -C $(var) test || exit 1;)
@for dir in $(DIRS); do \
if [ -d "$$dir" ]; then \
$(MAKE) -C "$$dir" test || exit 1; \
fi; \
done;

clean:
@for dir in *; do \
Expand Down
27 changes: 27 additions & 0 deletions regression/ansi-c/Union_Padding1/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,33 @@ STATIC_ASSERT(sizeof(union some_union4)==3);

#endif

#ifdef _MSC_VER

union some_union5
{
int i;
};

STATIC_ASSERT(__alignof(union some_union5)==1);

#else

union some_union5
{
int i;
};

union some_union6
{
int i;
} __attribute__((__packed__));

// Packing may affect alignment
STATIC_ASSERT(_Alignof(union some_union5)==4);
STATIC_ASSERT(_Alignof(union some_union6)==1);

#endif

int main()
{
}
34 changes: 34 additions & 0 deletions regression/ansi-c/Union_Padding2/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
static unsigned bar()
{
unsigned r;
return r;
}

#ifdef _MSC_VER

static void foo()
{
}

#else

static void foo()
{
unsigned len=bar();
struct {
int a;
union {
int s;
unsigned char b[len];
} __attribute__ (( packed )) S;
int c;
} __attribute__ (( packed )) *l;
}

#endif

int main()
{
foo();
return 0;
}
8 changes: 8 additions & 0 deletions regression/ansi-c/Union_Padding2/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CORE
main.c

^EXIT=0$
^SIGNAL=0$
--
^warning: ignoring
^CONVERSION ERROR$
12 changes: 12 additions & 0 deletions regression/ansi-c/linker_script_start+end/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
extern char src_start[];
extern char src_end[];
extern char dst_start[];

void *memcpy(void *dest, void *src, unsigned n){
return (void *)0;
}

int main(){
memcpy(dst_start, src_start, (unsigned)src_end - (unsigned)src_start);
return 0;
}
22 changes: 22 additions & 0 deletions regression/ansi-c/linker_script_start+end/script.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
MEMORY {
RAM : ORIGIN = 0x0, LENGTH = 25M
}

SECTIONS
{
/* GCC insists on having these */
.note.gnu.build-id : { } > RAM
.text : { } > RAM

.src_section : {
src_start = .;
*(.text*)
src_end = .;
} > RAM

.dst_section : {
dst_start = .;
*(.text*)
dst_end = .;
} > RAM
}
17 changes: 17 additions & 0 deletions regression/ansi-c/linker_script_start+end/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
CORE
main.c
-o out.gb -T script.ld -nostdlib
^EXIT=0$
^SIGNAL=0$
--
^warning: ignoring
^CONVERSION ERROR$
--
Tesing the functionality of goto-cc's linker script parsing
functionality, ensuring that it can get the values of symbols that are
defined in linker scripts.

This test ensures that goto-cc and ls-parse can:

- get the value of a symbol whose value indicates the start of a section;
- get the value of a symbol whose value indicates the end of a section.
12 changes: 12 additions & 0 deletions regression/ansi-c/linker_script_start+size/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
extern char src_start[];
extern char src_size[];
extern char dst_start[];

void *memcpy(void *dest, void *src, unsigned n){
return (void *)0;
}

int main(){
memcpy(dst_start, src_start, (unsigned)src_size);
return 0;
}
25 changes: 25 additions & 0 deletions regression/ansi-c/linker_script_start+size/script.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

MEMORY {
RAM : ORIGIN = 0x0, LENGTH = 25M
}

SECTIONS
{
/* GCC insists on having these */
.note.gnu.build-id : { } > RAM
.text : { } > RAM

.src_section : {
src_start = .;
*(.text*)
src_end = .;
} > RAM

src_size = src_end - src_start;

.dst_section : {
dst_start = .;
*(.text*)
dst_end = .;
} > RAM
}
19 changes: 19 additions & 0 deletions regression/ansi-c/linker_script_start+size/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
CORE
main.c
-o out.gb -T script.ld -nostdlib
^EXIT=0$
^SIGNAL=0$
--
^warning: ignoring
^CONVERSION ERROR$
--
Tesing the functionality of goto-cc's linker script parsing
functionality, ensuring that it can get the values of symbols that are
defined in linker scripts.

This test ensures that goto-cc and ls-parse can:

- get the value of a symbol whose value indicates the start of a section;
- get the value of a symbol whose value indicates the size of a section,
and whose value has been generated through a basic arithmetic
expression in the linker script.
6 changes: 6 additions & 0 deletions regression/ansi-c/linker_script_symbol-only/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
extern char sym[];

int main(){
int foo = (int)sym;
return 0;
}
15 changes: 15 additions & 0 deletions regression/ansi-c/linker_script_symbol-only/script.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
MEMORY {
RAM : ORIGIN = 0x0, LENGTH = 25M
}

SECTIONS
{
/* GCC insists on having these */
.note.gnu.build-id : { } > RAM
.text : { } > RAM

.src_section : {
sym = .;
*(.text*)
} > RAM
}
15 changes: 15 additions & 0 deletions regression/ansi-c/linker_script_symbol-only/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
CORE
main.c
-o out.gb -T script.ld -nostdlib
^EXIT=0$
^SIGNAL=0$
--
^warning: ignoring
^CONVERSION ERROR$
--
Tesing the functionality of goto-cc's linker script parsing
functionality, ensuring that it can get the values of symbols that are
defined in linker scripts.

This test ensures that goto-cc and ls-parse can get the value of a
symbol whose value indicates the start of a section.
1 change: 1 addition & 0 deletions regression/cbmc-cover/assertion1/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ int main()
__CPROVER_input("input1", input1);
__CPROVER_input("input2", input2);

// assert() is platform-dependent and changes set of coverage goals
__CPROVER_assert(!input1, "");

if(input1)
Expand Down
4 changes: 2 additions & 2 deletions regression/cbmc-cover/assertion1/test.desc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ main.c
--cover assertion
^EXIT=0$
^SIGNAL=0$
^\[main.coverage.1\] file main.c line 8 function main: SATISFIED$
^\[main.coverage.2\] file main.c line 12 function main: SATISFIED$
^\[main.coverage.1\] file main.c line 9 function main: SATISFIED$
^\[main.coverage.2\] file main.c line 13 function main: SATISFIED$
--
^warning: ignoring
14 changes: 7 additions & 7 deletions regression/cbmc-cover/branch1/test.desc
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ main.c
--cover branch
^EXIT=0$
^SIGNAL=0$
^\[main.coverage.1\] file main.c line 3 function main function main entry point: SATISFIED$
^\[main.coverage.2\] file main.c line 8 function main function main block 1 branch false: SATISFIED$
^\[main.coverage.3\] file main.c line 8 function main function main block 1 branch true: SATISFIED$
^\[main.coverage.4\] file main.c line 10 function main function main block 2 branch false: FAILED$
^\[main.coverage.5\] file main.c line 10 function main function main block 2 branch true: SATISFIED$
^\[main.coverage.6\] file main.c line 16 function main function main block 4 branch false: SATISFIED$
^\[main.coverage.7\] file main.c line 16 function main function main block 4 branch true: SATISFIED$
^\[main.coverage.1\] file main.c line 3 function main entry point: SATISFIED$
^\[main.coverage.2\] file main.c line 8 function main block 1 branch false: SATISFIED$
^\[main.coverage.3\] file main.c line 8 function main block 1 branch true: SATISFIED$
^\[main.coverage.4\] file main.c line 10 function main block 2 branch false: FAILED$
^\[main.coverage.5\] file main.c line 10 function main block 2 branch true: SATISFIED$
^\[main.coverage.6\] file main.c line 16 function main block 4 branch false: SATISFIED$
^\[main.coverage.7\] file main.c line 16 function main block 4 branch true: SATISFIED$
--
^warning: ignoring
6 changes: 3 additions & 3 deletions regression/cbmc-cover/branch2/test.desc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ main.c
--cover branch --unwind 2
^EXIT=0$
^SIGNAL=0$
^\[main.coverage.1\] file main.c line 5 function main function main entry point: SATISFIED$
^\[main.coverage.2\] file main.c line 6 function main function main block .* branch false: SATISFIED$
^\[main.coverage.3\] file main.c line 6 function main function main block .* branch true: SATISFIED$
^\[main.coverage.1\] file main.c line 5 function main entry point: SATISFIED$
^\[main.coverage.2\] file main.c line 6 function main block .* branch false: SATISFIED$
^\[main.coverage.3\] file main.c line 6 function main block .* branch true: SATISFIED$
--
^warning: ignoring
1 change: 0 additions & 1 deletion regression/cbmc-cover/branch3/main.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#include <assert.h>
#include <stdio.h>

int main()
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc-cover/branch3/test.desc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ main.c
--cover branch --unwind 6
^EXIT=0$
^SIGNAL=0$
^\*\* 23 of 23 covered \(100.0%\)$
^\*\* .* of .* covered \(100.0%\)$
--
^warning: ignoring
2 changes: 1 addition & 1 deletion regression/cbmc-cover/built-ins2/test.desc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ main.c
--cover location --unwind 10
^EXIT=0$
^SIGNAL=0$
^\*\* 4 of 4 covered
^\*\* .* of .* covered \(100.0%\)
--
^warning: ignoring
^\[.*<builtin-library-
1 change: 1 addition & 0 deletions regression/cbmc-cover/cover1/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ int main()
}

// should not produce a goal
// assert() is platform-dependent and changes set of coverage goals
__CPROVER_assert(input1, "");
}
8 changes: 4 additions & 4 deletions regression/cbmc-cover/inlining1/test.desc
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ main.c
--cover branch
^EXIT=0$
^SIGNAL=0$
^\[my_func.coverage.1\] file main.c line 3 function my_func function my_func block 1 branch false: SATISFIED$
^\[my_func.coverage.2\] file main.c line 3 function my_func function my_func block 1 branch true: FAILED$
^\[my_func.coverage.3\] file main.c line 3 function my_func function my_func block 2 branch false: FAILED$
^\[my_func.coverage.4\] file main.c line 3 function my_func function my_func block 2 branch true: SATISFIED$
^\[my_func.coverage.1\] file main.c line 3 function my_func block 1 branch false: SATISFIED$
^\[my_func.coverage.2\] file main.c line 3 function my_func block 1 branch true: FAILED$
^\[my_func.coverage.3\] file main.c line 3 function my_func block 2 branch false: FAILED$
^\[my_func.coverage.4\] file main.c line 3 function my_func block 2 branch true: SATISFIED$
--
^warning: ignoring
2 changes: 0 additions & 2 deletions regression/cbmc-cover/location11/main.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#include <assert.h>

int myfunc(int x, int y)
{
int z = x + y;
Expand Down
Loading