Skip to content

Commit 4e08c62

Browse files
authored
Merge pull request #150 from FrNecas/frnecas-cbmc-5.9
Update to CBMC 5.9
2 parents 64a3320 + 6941059 commit 4e08c62

36 files changed

+300
-261
lines changed

lib/cbmc

Submodule cbmc updated 5214 files
Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,35 @@
1-
CORE
1+
KNOWNBUG
22
main.c
33
--heap --intervals --pointer-check --no-assertions
44
^EXIT=0$
55
^SIGNAL=0$
66
^VERIFICATION SUCCESSFUL$
7+
--
8+
--
9+
CBMC 5.9 introduced changes to its implementation of some built-in functions,
10+
the ones affecting this test are malloc and free. Malloc changes have been
11+
already accounted for in 2LS codebase, however the control flow of free
12+
is most likely causing problems in this test making one of the asserts fail:
13+
14+
[main.pointer_dereference.27] dereference failure: deallocated dynamic object in *p: UNKNOWN
15+
16+
This may be related to double free assertion, where GOTO changed from:
17+
18+
...
19+
IF !(__CPROVER_deallocated == ptr) THEN GOTO 6
20+
// 144 file <builtin-library-free> line 18 function free
21+
ASSERT 0 != 0 // double free
22+
// 145 no location
23+
ASSUME 0 != 0
24+
// 146 file <builtin-library-free> line 29 function free
25+
6: _Bool record;
26+
...
27+
28+
to:
29+
ASSERT ptr == NULL || __CPROVER_deallocated != ptr // double free
30+
31+
Note the new ptr == NULL condition, this could be the root cause of
32+
the problem. However further investigation is required
33+
and will be done once the CBMC rebase is completed. According to the
34+
C standard, free(NULL) is a valid construct (no operation) but 2LS doesn't
35+
seem to handle this case correctly.
Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,36 @@
1-
CORE
1+
KNOWNBUG
22
main.c
33
--heap --intervals --pointer-check --no-assertions
44
^EXIT=0$
55
^SIGNAL=0$
66
^VERIFICATION SUCCESSFUL$
7+
--
8+
--
9+
CBMC 5.9 introduced changes to its implementation of some built-in functions,
10+
the ones affecting this test are malloc and free. Malloc changes have been
11+
already accounted for in 2LS codebase, however the control flow of free
12+
is most likely causing problems in this test making one of the asserts fail:
13+
14+
[main.pointer_dereference.27] dereference failure: deallocated dynamic object in *p: UNKNOWN
15+
16+
This may be related to double free assertion, where GOTO changed from:
17+
18+
...
19+
IF !(__CPROVER_deallocated == ptr) THEN GOTO 6
20+
// 144 file <builtin-library-free> line 18 function free
21+
ASSERT 0 != 0 // double free
22+
// 145 no location
23+
ASSUME 0 != 0
24+
// 146 file <builtin-library-free> line 29 function free
25+
6: _Bool record;
26+
...
27+
28+
to:
29+
ASSERT ptr == NULL || __CPROVER_deallocated != ptr // double free
30+
31+
Note the new ptr == NULL condition, this could be the root cause of
32+
the problem. However further investigation is required
33+
and will be done once the CBMC rebase is completed. According to the
34+
C standard, free(NULL) is a valid construct (no operation) but 2LS doesn't
35+
seem to handle this case correctly.
36+
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
CORE
1+
KNOWNBUG
22
main.c
33
--inline
44
^EXIT=0$
55
^SIGNAL=0$
66
^VERIFICATION SUCCESSFUL$
7+
--
8+
--
9+
This test is broken with CBMC 5.9 due to constant-propagation.
10+
Running it with --no-propagation works as expected

src/2ls/2ls_languages.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ Author: Daniel Kroening, [email protected]
1313

1414
#include <ansi-c/ansi_c_language.h>
1515
#include <cpp/cpp_language.h>
16-
#include <java_bytecode/java_bytecode_language.h>
1716

1817
#include "2ls_parse_options.h"
1918

0 commit comments

Comments
 (0)