-
Notifications
You must be signed in to change notification settings - Fork 273
Warn user when unsound flags are enabled. #6479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
NlightNFotis
merged 6 commits into
diffblue:develop
from
NlightNFotis:warn_unsound_flags
Mar 1, 2023
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
7bed09a
Remove (broken) code contracts link from CPROVER manual
tautschnig 0ad6a7b
CPROVER manual: consistent formatting of headings
tautschnig cf4df69
Add missing newline in help output
tautschnig 23b7037
Synchronise help output with actual support for --fp-reachability-slice
tautschnig c40ea7e
Issue warnings when options may yield unsound verification results
NlightNFotis fde9ac5
Explain unsound and experimental options in documentation.
NlightNFotis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,67 @@ | ||
[CPROVER Manual TOC](../) | ||
|
||
## Unsound CLI options for various tools | ||
|
||
### Context | ||
|
||
In [#6480](https://github.com/diffblue/cbmc/issues/6480), there has been some extensive | ||
conversation about what it means for certain options to produce *unsound* behavior. | ||
|
||
We concluded that *unsound* in this context is a proxy for the following two behaviors | ||
that we want to avoid: | ||
|
||
* **A spurious counter example to an assertion**, which means that the tool may report | ||
a coverage property (or a line of code) as reachable when in fact it is not, and | ||
* **Wrong proof to an assertion**, which means that it might indicate an assertion passing | ||
when it's not. | ||
|
||
We expect that, by default, CBMC and JBMC display none of the behavior we | ||
described above (and if they do, it's an extremely serious bug that we aim to | ||
fix on an ASAP basis), but be aware that certain tools, like `goto-instrument`, | ||
may contain components that are experimental in nature and thus do | ||
transformations that eventually lead to behavior such as the ones described | ||
above. Furthermore, some options lead to unsound analysis results *by design*, | ||
and some transformations performed by `goto-instrument` will yield verification | ||
results that are (by design) unsound when taking verification of the | ||
non-transformed program as reference. | ||
|
||
### Examples of Options that may yield Unsound Results | ||
|
||
The following options will produce a warning when used with CBMC or JBMC: | ||
|
||
* Use of `--unwind` or `--unwindset` without `--unwinding-assertions`, or the | ||
use of `--partial-loops`. | ||
* Depth or complexity-limited analysis (`--depth`, `--symex-complexity-limit`). | ||
|
||
See [Understanding Loop Unwinding](../cbmc/unwinding/) for an elaboration of | ||
these options. | ||
|
||
### Experimental Options | ||
|
||
Be advised that the following command line options to `cbmc` and `goto-instrument` | ||
have been reported to be unsound: | ||
|
||
* `--full-slice` has been reported to be unsound in issue [cbmc#260](https://github.com/diffblue/cbmc/issues/260) | ||
In particular, `--full-slice` appears to lead to spurious counter examples, | ||
because values that get assigned by a function whose body gets sliced out are | ||
no longer present in the trace, but still result in flipped verification results. | ||
|
||
`cbmc` and `goto-instrument` have also been modified to warn that options used | ||
are unsound as part of their output. An example of how that output looks is shown | ||
below: | ||
|
||
```sh | ||
$ cbmc --full-slice ~/Devel/cbmc_bugs/6394/before-slice.out | ||
CBMC version 5.45.0 (cbmc-5.43.0-77-g99c5a92de1-dirty) 64-bit arm64 macos | ||
Reading GOTO program from file | ||
Reading: ~/Devel/cbmc_bugs/6394/before-slice.out | ||
Generating GOTO Program | ||
Adding CPROVER library (x86_64) | ||
Removal of function pointers and virtual functions | ||
Generic Property Instrumentation | ||
**** WARNING: Experimental option --full-slice, analysis results may be unsound. See https://github.com/diffblue/cbmc/issues/260 | ||
Performing a full slice | ||
Running with 8 object bits, 56 offset bits (default) | ||
Starting Bounded Model Checking | ||
[...] | ||
``` |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
counterexample