Skip to content

Commit 7e00a30

Browse files
authored
Merge pull request diffblue#1759 from smowton/smowton/feature/symex-driven-program-loading
JBMC: Add symex-based program loading
2 parents 22e9b32 + 953e2df commit 7e00a30

File tree

64 files changed

+464
-117
lines changed

Some content is hidden

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

64 files changed

+464
-117
lines changed

regression/cbmc-java/CMakeLists.txt

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
add_test_pl_tests(
22
"$<TARGET_FILE:jbmc>"
33
)
4+
5+
add_test_pl_profile(
6+
"cbmc-java-symex-driven-lazy-loading"
7+
"$<TARGET_FILE:jbmc> --symex-driven-lazy-loading"
8+
"-C;-X;symex-driven-lazy-loading-expected-failure"
9+
"CORE"
10+
)

regression/cbmc-java/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ default: tests.log
22

33
test:
44
@../test.pl -p -c ../../../src/jbmc/jbmc
5+
@../test.pl -p -c "../../../src/jbmc/jbmc --symex-driven-lazy-loading" -X symex-driven-lazy-loading-expected-failure
56

67
tests.log: ../test.pl
78
@../test.pl -p -c ../../../src/jbmc/jbmc
9+
@../test.pl -p -c "../../../src/jbmc/jbmc --symex-driven-lazy-loading" -X symex-driven-lazy-loading-expected-failure
810

911
show:
1012
@for dir in *; do \
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
Test.class
33
--function Test.check --lazy-methods
44
^VERIFICATION SUCCESSFUL$
55
--
6+
--
7+
This doesn't work under symex-driven lazy loading because it is incompatible with --lazy-methods
+17-11
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
CORE
22
covered1.class
3-
--cover location --json-ui --show-properties
3+
--cover location --json-ui --show-properties --function 'covered1.<init>'
44
^EXIT=0$
55
^SIGNAL=0$
66
.*\"coveredLines\": \"22\",$
7-
.*\"coveredLines\": \"4\",$
8-
.*\"coveredLines\": \"6\",$
9-
.*\"coveredLines\": \"7\",$
10-
.*\"coveredLines\": \"23\",$
11-
.*\"coveredLines\": \"24\",$
12-
.*\"coveredLines\": \"25\",$
13-
.*\"coveredLines\": \"31\",$
14-
.*\"coveredLines\": \"32\",$
15-
.*\"coveredLines\": \"33\",$
16-
.*\"coveredLines\": \"36\",$
7+
(.*\"coveredLines\": \"4\")|(\"coveredLines\": \"4,6,7,23-25,31-33,36\"),$
8+
.*\"coveredLines\": \"6\"|(\"coveredLines\": \"4,6,7,23-25,31-33,36\"),$
9+
.*\"coveredLines\": \"7\"|(\"coveredLines\": \"4,6,7,23-25,31-33,36\"),$
10+
.*\"coveredLines\": \"23\"|(\"coveredLines\": \"4,6,7,23-25,31-33,36\"),$
11+
.*\"coveredLines\": \"24\"|(\"coveredLines\": \"4,6,7,23-25,31-33,36\"),$
12+
.*\"coveredLines\": \"25\"|(\"coveredLines\": \"4,6,7,23-25,31-33,36\"),$
13+
.*\"coveredLines\": \"31\"|(\"coveredLines\": \"4,6,7,23-25,31-33,36\"),$
14+
.*\"coveredLines\": \"32\"|(\"coveredLines\": \"4,6,7,23-25,31-33,36\"),$
15+
.*\"coveredLines\": \"33\"|(\"coveredLines\": \"4,6,7,23-25,31-33,36\"),$
16+
.*\"coveredLines\": \"36\"|(\"coveredLines\": \"4,6,7,23-25,31-33,36\"),$
1717
.*\"coveredLines\": \"26\",$
1818
.*\"coveredLines\": \"28\",$
1919
.*\"coveredLines\": \"28\",$
@@ -25,3 +25,9 @@ covered1.class
2525
.*\"coveredLines\": \"35\",$
2626
--
2727
^warning: ignoring
28+
--
29+
The alternation between the grouped and ungrouped reporting formats for coveredLines accommodates the
30+
difference between symex-driven-lazy-loading (which currently causes jbmc to use the grouped format)
31+
and normal loading (which uses the ungrouped format).
32+
The cause of the difference appears to be symex-driven loading being more pessimistic about possible
33+
exceptions coming from callees, which in turn changes the shape of the CFG.

regression/cbmc-java/exceptions26/test.desc

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
CORE
22
test.class
3+
34
^VERIFICATION SUCCESSFUL$
45
--
56
^warning: ignoring

regression/cbmc-java/exceptions27/test.desc

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
CORE
22
test.class
3+
34
VERIFICATION SUCCESSFUL
45
--
56
^warning: ignoring

regression/cbmc-java/generic_class_bound1/test.desc

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
Gn.class
33
--cover location
44
^EXIT=0$
@@ -9,3 +9,6 @@ Gn.class
99
.*file Gn.java line 11 function java::Gn.foo1:\(LGn;\)V bytecode-index 5 block 3: FAILED
1010
.*file Gn.java line 13 function java::Gn.main:\(\[Ljava/lang/String;\)V bytecode-index 2 block 2: SATISFIED
1111
--
12+
--
13+
This fails under symex-driven lazy loading because the FAILED blocks occur in functions that are unreachable
14+
from the entry point, so with symex-driven loading the functions foo1 and the constructor don't get created at all.

regression/cbmc-java/jsr1/test.desc

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
edu/emory/mathcs/backport/java/util/concurrent/ConcurrentHashMap.class
33
--show-goto-functions
44
^EXIT=0$
55
^SIGNAL=0$
66
--
77
\\"statement\\" \(\\"jsr\\"\)
88
\\"statement\\" \(\\"ret\\"\)
9+
--
10+
This doesn't work under symex-driven lazy loading because no entry-point function is given.
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
SymStream.class
33
--verbosity 10 --show-goto-functions
44
^EXIT=0
55
^SIGNAL=0
66
--
77
--
88
just to test that it doesn't crash in this situation, cf. TG-2684
9+
Doesn't work with symex-driven loading because there is no entry point (we want to load the entire class)
+3-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
test.class
33
--lazy-methods --verbosity 10 --function test.main
44
^EXIT=0$
55
^SIGNAL=0$
66
elaborate java::A\.f:\(\)V
77
--
88
elaborate java::B\.g:\(\)V
9+
--
10+
This doesn't work under symex-driven lazy loading because it is incompatible with --lazy-methods
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
test.class
33
--lazy-methods --verbosity 10 --function test.f --lazy-methods-extra-entry-point test.sety
44
^EXIT=6$
55
^SIGNAL=0$
66
entry point 'test\.sety' is ambiguous between:
77
test\.sety:\(I\)V
88
test\.sety:\(F\)V
9+
--
10+
--
11+
This doesn't work under symex-driven lazy loading because it is incompatible with --lazy-methods

regression/cbmc-java/lazyloading11/test.desc

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
test.class
33
--lazy-methods --verbosity 10 --function test.f --lazy-methods-extra-entry-point 'test.sety:(I)V' --lazy-methods-extra-entry-point 'test.sety:(F)V'
44
^EXIT=0$
@@ -8,3 +8,5 @@ CI lazy methods: elaborate java::test\.sety:\(I\)V
88
CI lazy methods: elaborate java::test\.sety:\(F\)V
99
--
1010
CI lazy methods: elaborate java::test\.setx:\(I\)V
11+
--
12+
This doesn't work under symex-driven lazy loading because it is incompatible with --lazy-methods
+3-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
test.class
33
--lazy-methods --verbosity 10 --function test.main
44
^EXIT=0$
55
^SIGNAL=0$
66
elaborate java::A\.f:\(\)V
77
--
88
elaborate java::B\.g:\(\)V
9+
--
10+
This doesn't work under symex-driven lazy loading because it is incompatible with --lazy-methods
+3-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
test.class
33
--lazy-methods --verbosity 10 --function test.main
44
^EXIT=0$
55
^SIGNAL=0$
66
elaborate java::A\.f:\(\)V
77
--
88
elaborate java::B\.g:\(\)V
9+
--
10+
This doesn't work under symex-driven lazy loading because it is incompatible with --lazy-methods
+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
Main.class
33
--lazy-methods
44
^EXIT=0$
55
^SIGNAL=0$
66
VERIFICATION SUCCESSFUL
7+
--
8+
--
9+
This doesn't work under symex-driven lazy loading because it is incompatible with --lazy-methods
+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
test.class
33
--lazy-methods --function test.main
44
^EXIT=0$
55
^SIGNAL=0$
66
VERIFICATION SUCCESSFUL
7+
--
8+
--
9+
This doesn't work under symex-driven lazy loading because it is incompatible with --lazy-methods

regression/cbmc-java/lazyloading6/test.desc

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
test.class
33
--lazy-methods --verbosity 10 --function test.f --lazy-methods-extra-entry-point test.setx
44
^EXIT=0$
@@ -8,3 +8,5 @@ CI lazy methods: elaborate java::test\.setx:\(I\)V
88
--
99
CI lazy methods: elaborate java::test\.sety:\(I\)V
1010
CI lazy methods: elaborate java::test\.sety:\(F\)V
11+
--
12+
This doesn't work under symex-driven lazy loading because it is incompatible with --lazy-methods

regression/cbmc-java/lazyloading7/test.desc

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
test.class
33
--lazy-methods --verbosity 10 --function test.f --lazy-methods-extra-entry-point 'test.sety:(I)V'
44
^EXIT=0$
@@ -8,3 +8,5 @@ CI lazy methods: elaborate java::test\.sety:\(I\)V
88
--
99
CI lazy methods: elaborate java::test\.setx:\(I\)V
1010
CI lazy methods: elaborate java::test\.sety:\(F\)V
11+
--
12+
This doesn't work under symex-driven lazy loading because it is incompatible with --lazy-methods

regression/cbmc-java/lazyloading8/test.desc

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
test.class
33
--lazy-methods --verbosity 10 --function test.f --lazy-methods-extra-entry-point 'test.sety:(F)V'
44
^EXIT=0$
@@ -8,3 +8,5 @@ CI lazy methods: elaborate java::test\.sety:\(F\)V
88
--
99
CI lazy methods: elaborate java::test\.sety:\(I\)V
1010
CI lazy methods: elaborate java::test\.setx:\(I\)V
11+
--
12+
This doesn't work under symex-driven lazy loading because it is incompatible with --lazy-methods
+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
test.class
33
--lazy-methods --verbosity 10 --function test.f --lazy-methods-extra-entry-point 'test.*'
44
^EXIT=0$
@@ -7,3 +7,6 @@ VERIFICATION SUCCESSFUL
77
CI lazy methods: elaborate java::test\.setx:\(I\)V
88
CI lazy methods: elaborate java::test\.sety:\(I\)V
99
CI lazy methods: elaborate java::test\.sety:\(F\)V
10+
--
11+
--
12+
This doesn't work under symex-driven lazy loading because it is incompatible with --lazy-methods
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
test.class
33
--lazy-methods --verbosity 10 --function test.g
44
^EXIT=0$
55
^SIGNAL=0$
66
elaborate java::test\.f:\(\)I
77
VERIFICATION SUCCESSFUL
8+
--
9+
--
10+
This doesn't work under symex-driven lazy loading because it is incompatible with --lazy-methods
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
test.class
33
--lazy-methods --verbosity 10 --function test.test
44
^EXIT=0$
55
^SIGNAL=0$
66
elaborate java::Base\.f:\(\)V
77
--
8+
--
9+
This doesn't work under symex-driven lazy loading because it is incompatible with --lazy-methods
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
test.class
33
--lazy-methods --verbosity 10 --function test.g
44
^EXIT=0$
55
^SIGNAL=0$
66
elaborate java::test\.f:\(\)I
77
VERIFICATION SUCCESSFUL
8+
--
9+
--
10+
This doesn't work under symex-driven lazy loading because it is incompatible with --lazy-methods
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
test.class
33
--lazy-methods --verbosity 10 --function test.g
44
^EXIT=0$
55
^SIGNAL=0$
66
elaborate java::test\.f:\(\)I
77
VERIFICATION SUCCESSFUL
8+
--
9+
--
10+
This doesn't work under symex-driven lazy loading because it is incompatible with --lazy-methods
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
test.class
33
--lazy-methods --verbosity 10 --function test.test
44
^EXIT=0$
@@ -7,3 +7,5 @@ elaborate java::Base\.f:\(\)V
77
--
88
elaborate java::Derived\.f:\(\)V
99
elaborate java::Middle\.f:\(\)V
10+
--
11+
This doesn't work under symex-driven lazy loading because it is incompatible with --lazy-methods
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
test.class
33
--lazy-methods --verbosity 10 --function test.test
44
^EXIT=0$
55
^SIGNAL=0$
66
elaborate java::Base\.f:\(\)V
77
--
8+
--
9+
This doesn't work under symex-driven lazy loading because it is incompatible with --lazy-methods
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
Test.class
33
--lazy-methods --verbosity 10 --function Test.check
44
^EXIT=0$
55
^SIGNAL=0$
66
elaborate java::A\.f:\(\)I
77
elaborate java::B\.g:\(\)I
88
VERIFICATION SUCCESSFUL
9+
--
10+
--
11+
This doesn't work under symex-driven lazy loading because it is incompatible with --lazy-methods
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
test.class
33
--lazy-methods --verbosity 10 --function test.g
44
^EXIT=0$
55
^SIGNAL=0$
66
elaborate java::test\.f:\(\)I
77
VERIFICATION SUCCESSFUL
8+
--
9+
--
10+
This doesn't work under symex-driven lazy loading because it is incompatible with --lazy-methods

regression/cbmc-java/lazyloading_nested_generic_parameters/test.desc

+1
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ The right methods are loaded, but verification is not successful
1111
because __CPROVER_start doesn't create appropriately typed input for
1212
this kind of nested generic parameter, so dynamic cast checks fail upon
1313
fetching the generic type's field.
14+
This doesn't work under symex-driven lazy loading because it is incompatible with --lazy-methods
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
test.class
33
--lazy-methods --verbosity 10 --function test.test
44
^EXIT=0$
55
^SIGNAL=0$
66
elaborate java::Base\.f:\(\)V
77
--
8+
--
9+
This doesn't work under symex-driven lazy loading because it is incompatible with --lazy-methods

regression/cbmc-java/lazyloading_synthetic_method_cleanup1/check_clinit_normally_present.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
Test.class
33
--show-goto-functions --function Test.main
44
java::Unused::clinit_wrapper
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
Test.class
33
--lazy-methods --show-goto-functions --function Test.main
44
--
55
java::Unused::clinit_wrapper
66
Unused\.<clinit>\(\)
7+
--
8+
This doesn't work under symex-driven lazy loading because it is incompatible with --lazy-methods
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
Test.class
33
--lazy-methods --function Test.main
44
VERIFICATION SUCCESSFUL
5+
--
6+
--
7+
This doesn't work under symex-driven lazy loading because it is incompatible with --lazy-methods

regression/cbmc-java/lazyloading_synthetic_method_cleanup2/check_clinit_normally_present.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
CORE symex-driven-lazy-loading-expected-failure
22
Test.class
33
--show-goto-functions --function Test.main
44
java::Unused1::clinit_wrapper

0 commit comments

Comments
 (0)