Skip to content

Not using --slice-formula causes invariant violation in CBMC #1810

Closed

Description

@adpaco

When upgrading to CBMC v5.68.0, CBMC crashes in scenarios where we don't push --slice-formula with the following error:

--- begin invariant violation report ---
Invariant check failed
File: ../src/solvers/flattening/boolbv_width.cpp:225 function: get_entry
Condition: false
Reason: Unimplemented
Backtrace:
cbmc(+0xa8c6d0) [0x55b32942f6d0]
cbmc(+0xa8cc79) [0x55b32942fc79]
cbmc(+0x1e7ea8) [0x55b328b8aea8]
cbmc(+0x828ebd) [0x55b3291cbebd]
cbmc(+0x7fbcf9) [0x55b32919ecf9]
cbmc(+0x7e441e) [0x55b32918741e]
cbmc(+0x82f026) [0x55b3291d2026]
cbmc(+0x7e7a70) [0x55b32918aa70]
cbmc(+0x7e39ca) [0x55b3291869ca]
cbmc(+0x7e3a98) [0x55b329186a98]
cbmc(+0x537d81) [0x55b328edad81]
cbmc(+0x540546) [0x55b328ee3546]
cbmc(+0x5410f2) [0x55b328ee40f2]
cbmc(+0x3379a4) [0x55b328cda9a4]
cbmc(+0x337e25) [0x55b328cdae25]
cbmc(+0x3498b5) [0x55b328cec8b5]
cbmc(+0x1f21c9) [0x55b328b951c9]
cbmc(+0x1ee6fe) [0x55b328b916fe]
cbmc(+0x1e5f3f) [0x55b328b88f3f]
cbmc(+0x1d1f49) [0x55b328b74f49]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7f45380190b3]
cbmc(+0x1e78be) [0x55b328b8a8be]

diffblue/cbmc#7276 tries to improve the error message we get in this case.

Activity

  1. changed the title [-]Not using `--slice-formula` causes invariant violation CBMC[/-] [+]Not using `--slice-formula` causes invariant violation in CBMC[/+] on Oct 27, 2022
  2. added
    [C] Bug
    T-High Priority
    on Nov 14, 2022
  3. self-assigned this
    on Nov 15, 2022
  4. celinval commented on Nov 21, 2022

    @celinval
    Contributor

    The following test is enough to trigger the failure without --slice-formula:

    // Copyright Kani Contributors
    // SPDX-License-Identifier: Apache-2.0 OR MIT
    
    #[kani::proof]
    fn check() {
        kani::assert(true, "");
    }
  5. celinval commented on Nov 21, 2022

    @celinval
    Contributor

    If I run the same test as above without --slice-formula and I disable the reachability checks, I get a different error:

    $ kani --no-assertion-reach-checks main.rs
    thread '<unnamed>' panicked at 'assertion failed: !property_name.is_empty() && !message.is_empty()', cprover_bindings/src/goto_program/stmt.rs:183:9
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    
    Kani unexpectedly panicked during compilation.
    If you are seeing this message, please file an issue here: https://github.com/model-checking/kani/issues/new?labels=bug&template=bug_report.md
    
    [Kani] current codegen item: codegen_function: main
    main
    [Kani] current codegen location: Loc { file: "tests/kani/Assume/main.rs", function: None, start_line: 5, start_col: Some(1), end_line: 5, end_col: Some(10) }
    Error: target/kani/bin/kani-compiler exited with status exit status: 101
    
  6. celinval commented on Nov 22, 2022

    @celinval
    Contributor

    @tautschnig Any chance you can help me out please? For my one statement harness, if I remove the --slice-formula, I'm getting the following logs:

    CBMC 5.70.0 (cbmc-5.70.0)
    CBMC version 5.70.0 (cbmc-5.70.0) 64-bit x86_64 linux
    Reading GOTO program from file main.for-check.out
    Generating GOTO Program
    Adding CPROVER library (x86_64)
    Removal of function pointers and virtual functions
    Generic Property Instrumentation
    Running with 16 object bits, 48 offset bits (user-specified)
    Starting Bounded Model Checking
    Runtime Symex: 0.000865465s
    size of program expression: 50 steps
    simple slicing removed 6 assignments
    Generated 2 VCC(s), 1 remaining after simplification
    Runtime Postprocess Equation: 2.0539e-05s
    --- begin invariant violation report ---
    Invariant check failed
    File: ../src/solvers/flattening/boolbv_width.cpp:227 function: get_entry
    Condition: false
    Reason: Reached unimplemented boolbv_widtht::get_entry(integer)
    Backtrace:
    cbmc(+0x92470e) [0x55e86968e70e]
    cbmc(+0x92569a) [0x55e86968f69a]
    cbmc(+0x664cf) [0x55e868dd04cf]
    cbmc(+0x6a4065) [0x55e86940e065]
    cbmc(+0x675869) [0x55e8693df869]
    cbmc(+0x6622d7) [0x55e8693cc2d7]
    cbmc(+0x6a933e) [0x55e86941333e]
    cbmc(+0x665386) [0x55e8693cf386]
    cbmc(+0x661485) [0x55e8693cb485]
    cbmc(+0x66158f) [0x55e8693cb58f]
    cbmc(+0x3af7a1) [0x55e8691197a1]
    cbmc(+0x3b7237) [0x55e869121237]
    cbmc(+0x3b7f61) [0x55e869121f61]
    cbmc(+0x1a51de) [0x55e868f0f1de]
    cbmc(+0x1a58a6) [0x55e868f0f8a6]
    cbmc(+0x1c044c) [0x55e868f2a44c]
    cbmc(+0x6ed60) [0x55e868dd8d60]
    cbmc(+0x6c8c8) [0x55e868dd68c8]
    cbmc(+0x64498) [0x55e868dce498]
    cbmc(+0x505d4) [0x55e868dba5d4]
    /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7f330296ac87]
    cbmc(+0x6610a) [0x55e868dd010a]
    
    
    --- end invariant violation report ---
    Passing problem to propositional reduction
    
    CBMC failed with status 134
    VERIFICATION:- FAILED
    
  7. moved this to Done in Kani 0.16on Nov 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

T-High Priority[C] Bug[F] Crash

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions