Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Hide --lib-c and add assume-false to unknown fns #964

Merged
merged 2 commits into from
Mar 22, 2022

Conversation

celinval
Copy link
Contributor

Description of changes:

  • Support to --lib-c is not well tested. Keep it as experimental.
  • Change how CBMC behaves when a function that is not defined is
    reachable. This mitigates issues Failing verification for proptest example using format! #576. We should still add an
    unimplemented assertion so we can flip the results of other checks to
    undetermined.

Resolved issues:

None

Call-outs:

I had to change the float test since fround() function is missing.

Testing:

  • How is this change tested?

  • Is this a refactor change?

Checklist

  • Each commit message has a non-empty body, explaining why the change was made
  • Methods or procedures are documented
  • Regression or unit tests are included, or existing tests cover the modified code
  • My PR is restricted to a single feature or bugfix

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.

@celinval celinval requested a review from a team as a code owner March 19, 2022 00:14
@@ -79,7 +79,7 @@ impl KaniSession {
fn undefined_functions(&self, file: &Path) -> Result<()> {
let args: Vec<OsString> = vec![
"--generate-function-body-options".into(),
"assert-false".into(),
"assert-false-assume-false".into(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a test that checks this behavior, e.g.:

extern "C" {
    fn missing_function() -> u32;
}

#[kani::proof]
fn main() {
    unsafe {
        let x = missing_function();
        assert!(x == 5);
    }
}

The assert should be reported as unreachable. Without your change, it fails.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.

 - Support to --lib-c is not well tested. Keep it as experiemental.
 - Change how CBMC behaves when a function that is not defined is
   reachable. This mitigates issues model-checking#576. We should still add an
   unimplemented assertion so we can flip the results of other checks to
   undetermined.
@celinval celinval force-pushed the issue-576-mitigation branch from 246e45d to 56d6ff8 Compare March 22, 2022 19:13
@celinval celinval merged commit f088f9c into model-checking:main Mar 22, 2022
tedinski pushed a commit to tedinski/rmc that referenced this pull request Apr 22, 2022
 - Support to --lib-c is not well tested. Keep it as experiemental.
 - Change how CBMC behaves when a function that is not defined is
   reachable. This mitigates issues model-checking#576. We should still add an
   unimplemented assertion so we can flip the results of other checks to
   undetermined.
tedinski pushed a commit to tedinski/rmc that referenced this pull request Apr 25, 2022
 - Support to --lib-c is not well tested. Keep it as experiemental.
 - Change how CBMC behaves when a function that is not defined is
   reachable. This mitigates issues model-checking#576. We should still add an
   unimplemented assertion so we can flip the results of other checks to
   undetermined.
tedinski pushed a commit to tedinski/rmc that referenced this pull request Apr 26, 2022
 - Support to --lib-c is not well tested. Keep it as experiemental.
 - Change how CBMC behaves when a function that is not defined is
   reachable. This mitigates issues model-checking#576. We should still add an
   unimplemented assertion so we can flip the results of other checks to
   undetermined.
tedinski pushed a commit that referenced this pull request Apr 27, 2022
 - Support to --lib-c is not well tested. Keep it as experiemental.
 - Change how CBMC behaves when a function that is not defined is
   reachable. This mitigates issues #576. We should still add an
   unimplemented assertion so we can flip the results of other checks to
   undetermined.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants