You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CBMC version: 5.15.0
Operating system:
Exact command line resulting in the issue: cbmc r_ok_unsound.c
What behaviour did you expect: verification failed
What happened instead: verification successful r_ok_unsound.zip
The predicate __CPROVER_r_ok behaves strangely when the memory pointed to will be allocated in the future. Here is an example:
CBMC proves this even though, obviously, p != q should not be provable, since p is uninitialized. It seems the reason is that __CPROVER_r_ok returns true when p happens to be equal to the address of the object that will be allocated at the next line. Is this the intended semantics? I guess you could argue that you shouldn't pass an invalid pointer to __CPROVER_r_ok, but it seems to me that for __CPROVER_r_ok to be useful in specifications, you should be able to pass it an invalid pointer and get the value false.
The text was updated successfully, but these errors were encountered:
Hello Ken, Please see #5194 for an earlier discussion on this, and the documentation at http://cprover.diffblue.com/memory-primitives.html. In short, using __CPROVER_r_ok within __CPROVER_assume is only permissible when the pointer is guaranteed to be either null or valid (and running CBMC with --pointer-primitive-check will ensure this is the case).
This also implies that __CPROVER_r_ok is not to be used in preconditions.
For some context, these primitives were never really meant for end users at all. They were mostly meant to be used by cbmcs own pointer and bounds checking. You can use them if you really want to, but you need to be very careful with them!
CBMC version: 5.15.0
Operating system:
Exact command line resulting in the issue: cbmc r_ok_unsound.c
What behaviour did you expect: verification failed
What happened instead: verification successful
r_ok_unsound.zip
The predicate __CPROVER_r_ok behaves strangely when the memory pointed to will be allocated in the future. Here is an example:
CBMC proves this even though, obviously,
p != q
should not be provable, sincep
is uninitialized. It seems the reason is that __CPROVER_r_ok returns true whenp
happens to be equal to the address of the object that will be allocated at the next line. Is this the intended semantics? I guess you could argue that you shouldn't pass an invalid pointer to __CPROVER_r_ok, but it seems to me that for __CPROVER_r_ok to be useful in specifications, you should be able to pass it an invalid pointer and get the value false.The text was updated successfully, but these errors were encountered: