Skip to content

Commit aa610ab

Browse files
committed
goto-symex/concurrency: limit unsoundness-abort to dereferencing shared pointers
Reading and writing pointers is not not itself unsound, only the interaction with value sets may cause unsound results. Hence, do not reject programs that never dereference a shared pointer. Fixes: #8714 Fixes: #7957
1 parent 1e945cd commit aa610ab

File tree

18 files changed

+98
-90
lines changed

18 files changed

+98
-90
lines changed

regression/book-examples/account/C10.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
KNOWNBUG
1+
CORE
22
account.c
33

44
^EXIT=10$
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
CORE
22
main.c
33
--no-standard-checks
4-
^EXIT=10$
4+
pointer handling for concurrency is unsound
5+
^EXIT=6$
56
^SIGNAL=0$
6-
^VERIFICATION FAILED$
77
--
88
^warning: ignoring
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE pthread
2+
main.c
3+
4+
pointer handling for concurrency is unsound
5+
^EXIT=6$
6+
^SIGNAL=0$
7+
--
8+
^warning: ignoring

regression/cbmc-concurrency/global_pointer1/main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ void *thread1(void * arg)
1212
void *thread2(void *arg)
1313
{
1414
assert(v == &g);
15+
#ifndef NO_DEREF
1516
*v = 1;
17+
#endif
1618
}
1719

1820
int main()
@@ -26,7 +28,9 @@ int main()
2628
pthread_join(t2, 0);
2729

2830
assert(v == &g);
31+
#ifndef NO_DEREF
2932
assert(*v == 1);
33+
#endif
3034

3135
return 0;
3236
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
KNOWNBUG pthread
2+
main.c
3+
-DNO_DEREF
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^VERIFICATION SUCCESSFUL$
7+
--
8+
^warning: ignoring
9+
--
10+
Simplification with value sets causes unsound results despite the absence of
11+
dereferencing.

regression/cbmc-concurrency/global_pointer1/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
KNOWNBUG
1+
KNOWNBUG pthread
22
main.c
33

44
^EXIT=0$
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
CORE
22
main.c
33
--no-malloc-may-fail
4-
^EXIT=0$
4+
pointer handling for concurrency is unsound
5+
^EXIT=6$
56
^SIGNAL=0$
6-
^VERIFICATION SUCCESSFUL$
77
--
88
^warning: ignoring
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
CORE
22
main.c
33
--no-malloc-may-fail
4-
^EXIT=0$
4+
pointer handling for concurrency is unsound
5+
^EXIT=6$
56
^SIGNAL=0$
6-
^VERIFICATION SUCCESSFUL$
77
--
88
^warning: ignoring

regression/cbmc-concurrency/thread_chain_posix2/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
KNOWNBUG pthread
1+
CORE pthread
22
main.c
33
-D_ENABLE_CHAIN_ --unwind 2
44
^EXIT=0$

regression/cbmc-concurrency/thread_chain_posix3/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
KNOWNBUG pthread
1+
CORE pthread
22
main.c
33
-D_ENABLE_CHAIN_ -D_SANITY_CHECK_ --unwind 2
44
^EXIT=10$

0 commit comments

Comments
 (0)