-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #157 from viktormalik/svcomp22-fixes
SV-COMP fixes
- Loading branch information
Showing
18 changed files
with
300 additions
and
141 deletions.
There are no files selected for viewing
Submodule cbmc
updated
3 files
+7 −3 | src/analyses/goto_check.cpp | |
+2 −0 | src/goto-programs/graphml_witness.cpp | |
+0 −10 | src/xmllang/graphml.cpp |
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,61 @@ | ||
/* | ||
hardware integer division program, by Manna | ||
returns q==A//B | ||
*/ | ||
|
||
extern void abort(void); | ||
extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__)); | ||
void reach_error() { __assert_fail("0", "hard2.c", 8, "reach_error"); } | ||
extern int __VERIFIER_nondet_int(void); | ||
extern void abort(void); | ||
void assume_abort_if_not(int cond) { | ||
if(!cond) {abort();} | ||
} | ||
void __VERIFIER_assert(int cond) { | ||
if (!(cond)) { | ||
ERROR: | ||
{reach_error();} | ||
} | ||
return; | ||
} | ||
|
||
int counter = 0; | ||
int main() { | ||
int A, B; | ||
int r, d, p, q; | ||
A = __VERIFIER_nondet_int(); | ||
B = 1; | ||
|
||
r = A; | ||
d = B; | ||
p = 1; | ||
q = 0; | ||
|
||
while (counter++<5) { | ||
__VERIFIER_assert(q == 0); | ||
__VERIFIER_assert(r == A); | ||
__VERIFIER_assert(d == B * p); | ||
if (!(r >= d)) break; | ||
|
||
d = 2 * d; | ||
p = 2 * p; | ||
} | ||
|
||
while (counter++<5) { | ||
__VERIFIER_assert(A == q*B + r); | ||
__VERIFIER_assert(d == B*p); | ||
|
||
if (!(p != 1)) break; | ||
|
||
d = d / 2; | ||
p = p / 2; | ||
if (r >= d) { | ||
r = r - d; | ||
q = q + p; | ||
} | ||
} | ||
|
||
__VERIFIER_assert(A == d*q + r); | ||
__VERIFIER_assert(B == d); | ||
return 0; | ||
} |
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,10 @@ | ||
CORE | ||
main.c | ||
--heap --values-refine --k-induction --competition-mode | ||
^EXIT=10$ | ||
^SIGNAL=0$ | ||
^.*FAILURE$ | ||
-- | ||
-- | ||
This is a past incorrect true benchmark from SV-comp which was caused by a bug | ||
in SSA unwinder where the generated constraints made the analysis unsound. |
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 |
---|---|---|
@@ -1,35 +1,6 @@ | ||
KNOWNBUG | ||
CORE | ||
main.c | ||
--heap --intervals --pointer-check --no-assertions | ||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
^VERIFICATION SUCCESSFUL$ | ||
-- | ||
-- | ||
CBMC 5.9 introduced changes to its implementation of some built-in functions, | ||
the ones affecting this test are malloc and free. Malloc changes have been | ||
already accounted for in 2LS codebase, however the control flow of free | ||
is most likely causing problems in this test making one of the asserts fail: | ||
|
||
[main.pointer_dereference.27] dereference failure: deallocated dynamic object in *p: UNKNOWN | ||
|
||
This may be related to double free assertion, where GOTO changed from: | ||
|
||
... | ||
IF !(__CPROVER_deallocated == ptr) THEN GOTO 6 | ||
// 144 file <builtin-library-free> line 18 function free | ||
ASSERT 0 != 0 // double free | ||
// 145 no location | ||
ASSUME 0 != 0 | ||
// 146 file <builtin-library-free> line 29 function free | ||
6: _Bool record; | ||
... | ||
|
||
to: | ||
ASSERT ptr == NULL || __CPROVER_deallocated != ptr // double free | ||
|
||
Note the new ptr == NULL condition, this could be the root cause of | ||
the problem. However further investigation is required | ||
and will be done once the CBMC rebase is completed. According to the | ||
C standard, free(NULL) is a valid construct (no operation) but 2LS doesn't | ||
seem to handle this case correctly. |
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,9 @@ | ||
void *my_malloc(unsigned int size) { | ||
return malloc(size); | ||
} | ||
|
||
int main() { | ||
void *a = my_malloc(sizeof(int)); | ||
free(a); | ||
free(a); | ||
} |
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,7 @@ | ||
CORE | ||
main.c | ||
--pointer-check --inline | ||
^EXIT=10$ | ||
^SIGNAL=0$ | ||
^VERIFICATION FAILED$ | ||
\[free.precondition.6\] free argument must be NULL or valid pointer: FAILURE |
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 |
---|---|---|
@@ -1,36 +1,6 @@ | ||
KNOWNBUG | ||
CORE | ||
main.c | ||
--heap --intervals --pointer-check --no-assertions | ||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
^VERIFICATION SUCCESSFUL$ | ||
-- | ||
-- | ||
CBMC 5.9 introduced changes to its implementation of some built-in functions, | ||
the ones affecting this test are malloc and free. Malloc changes have been | ||
already accounted for in 2LS codebase, however the control flow of free | ||
is most likely causing problems in this test making one of the asserts fail: | ||
|
||
[main.pointer_dereference.27] dereference failure: deallocated dynamic object in *p: UNKNOWN | ||
|
||
This may be related to double free assertion, where GOTO changed from: | ||
|
||
... | ||
IF !(__CPROVER_deallocated == ptr) THEN GOTO 6 | ||
// 144 file <builtin-library-free> line 18 function free | ||
ASSERT 0 != 0 // double free | ||
// 145 no location | ||
ASSUME 0 != 0 | ||
// 146 file <builtin-library-free> line 29 function free | ||
6: _Bool record; | ||
... | ||
|
||
to: | ||
ASSERT ptr == NULL || __CPROVER_deallocated != ptr // double free | ||
|
||
Note the new ptr == NULL condition, this could be the root cause of | ||
the problem. However further investigation is required | ||
and will be done once the CBMC rebase is completed. According to the | ||
C standard, free(NULL) is a valid construct (no operation) but 2LS doesn't | ||
seem to handle this case correctly. | ||
|
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
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
Oops, something went wrong.