Skip to content

CBMC invariant violation in precondition (exit code 134) #1836

Closed

Description

@adpaco

Mirror issue for diffblue/cbmc#7288 , will update this description with a reproducer once the author of the original issue gets back to us. The error is this one:

Unwinding loop _RNvNvMNtNtCs6ksVFr7TWxF_4core5alloc6layoutNtB4_6Layout5array5innerCs8UtVQrhG5Gl_7ask_cli.0 iteration 1 file /home/runner/.rustup/toolchains/nightly-2022-10-11-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/alloc/layout.rs line 438 column 16 function std::alloc::Layout::array::inner thread 0
aborting path on assume(false) at file /home/runner/.rustup/toolchains/nightly-2022-10-11-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/hint.rs line 105 column 9 function std::hint::unreachable_unchecked thread 0
aborting path on assume(false) at file /home/runner/.rustup/toolchains/nightly-2022-10-11-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs line 1536 column 32 function std::result::Result::<std::alloc::Layout, std::alloc::LayoutError>::unwrap_unchecked thread 0
aborting path on assume(false) at file /home/runner/.rustup/toolchains/nightly-2022-10-11-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs line 1533 column 15 function std::result::Result::<std::alloc::Layout, std::alloc::LayoutError>::unwrap_unchecked thread 0
Unwinding loop _ZN4core6result19Result$LT$T$C$E$GT$16unwrap_unchecked17hf3f4fa8b2792210eE.0 iteration 1 file /home/runner/.rustup/toolchains/nightly-2022-10-11-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs line 1538 column 5 function std::result::Result::<std::alloc::Layout, std::alloc::LayoutError>::unwrap_unchecked thread 0
Unwinding loop _ZN4core3ptr46drop_in_place$LT$alloc..vec..Vec$LT$u8$GT$$GT$17h42d65b399ad5abe9E.0 iteration 1 file /home/runner/.rustup/toolchains/nightly-2022-10-11-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs line 491 column 1 function std::ptr::drop_in_place::<std::vec::Vec<u8>> thread 0
Not unwinding loop _RINvCs8UtVQrhG5Gl_7ask_cli3askReRShNtNtNtCsb5NFf2JfBbd_3std2io4util4SinkEB2_.11 iteration 10 file /home/asaveau/IdeaProjects/ask-cli/src/lib.rs line 122 column 5 function ask::<&str, &[u8], std::io::Sink> thread 0
aborting path on assume(false) at file /home/runner/.rustup/toolchains/nightly-2022-10-11-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mut_ptr.rs line 38 column 15 function std::ptr::mut_ptr::<impl *mut u8>::is_null thread 0
Unwinding loop _RNvNvMNtNtCs6ksVFr7TWxF_4core5alloc6layoutNtB4_6Layout5array5innerCs8UtVQrhG5Gl_7ask_cli.0 iteration 1 file /home/runner/.rustup/toolchains/nightly-2022-10-11-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/alloc/layout.rs line 438 column 16 function std::alloc::Layout::array::inner thread 0
aborting path on assume(false) at file /home/runner/.rustup/toolchains/nightly-2022-10-11-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/hint.rs line 105 column 9 function std::hint::unreachable_unchecked thread 0
aborting path on assume(false) at file /home/runner/.rustup/toolchains/nightly-2022-10-11-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs line 1536 column 32 function std::result::Result::<std::alloc::Layout, std::alloc::LayoutError>::unwrap_unchecked thread 0
aborting path on assume(false) at file /home/runner/.rustup/toolchains/nightly-2022-10-11-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs line 1533 column 15 function std::result::Result::<std::alloc::Layout, std::alloc::LayoutError>::unwrap_unchecked thread 0
Unwinding loop _ZN4core6result19Result$LT$T$C$E$GT$16unwrap_unchecked17hf3f4fa8b2792210eE.0 iteration 1 file /home/runner/.rustup/toolchains/nightly-2022-10-11-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs line 1538 column 5 function std::result::Result::<std::alloc::Layout, std::alloc::LayoutError>::unwrap_unchecked thread 0
Unwinding loop _ZN4core3ptr46drop_in_place$LT$alloc..vec..Vec$LT$u8$GT$$GT$17h42d65b399ad5abe9E.0 iteration 1 file /home/runner/.rustup/toolchains/nightly-2022-10-11-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs line 491 column 1 function std::ptr::drop_in_place::<std::vec::Vec<u8>> thread 0
Runtime Symex: 41.282s
size of program expression: 476615 steps
slicing removed 348050 assignments
Generated 25977 VCC(s), 12350 remaining after simplification
Runtime Postprocess Equation: 0.941078s
--- begin invariant violation report ---
Invariant check failed
File: ../src/util/bitvector_types.h:42 function: to_bitvector_type
Condition: can_cast_type<bitvector_typet>(type)
Reason: Precondition
Backtrace:
cbmc(print_backtrace(std::ostream&)+0x4e) [0x55faafc8115e]
cbmc(get_backtrace[abi:cxx11]()+0x16a) [0x55faafc820ea]
cbmc(std::enable_if<std::is_base_of<invariant_failedt, invariant_failedt>::value, void>::type invariant_violated_structured<invariant_failedt, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)+0x4f) [0x55faaf3ce7ff]
cbmc(lower_byte_extract(byte_extract_exprt const&, namespacet const&)+0x29c9) [0x55faafa33ee9]
cbmc(lower_byte_operators(exprt const&, namespacet const&)+0x150) [0x55faafa3c310]
cbmc(lower_byte_operators(exprt const&, namespacet const&)+0x8b) [0x55faafa3c24b]
cbmc(lower_byte_operators(exprt const&, namespacet const&)+0x8b) [0x55faafa3c24b]
cbmc(boolbvt::convert_equality(equal_exprt const&)+0x189) [0x55faaf9d7fb9]
cbmc(boolbvt::convert_rest(exprt const&)+0x20e) [0x55faaf9c256e]
cbmc(bv_pointerst::convert_rest(exprt const&)+0xab) [0x55faafa0c1bb]
cbmc(prop_conv_solvert::convert_bool(exprt const&)+0x5aa) [0x55faafa4fd6a]
cbmc(prop_conv_solvert::convert(exprt const&)+0x13f) [0x55faafa52e4f]
cbmc(prop_conv_solvert::add_constraints_to_prop(exprt const&, bool)+0x16d) [0x55faafa4d94d]
cbmc(prop_conv_solvert::set_to(exprt const&, bool)+0x912) [0x55faafa510c2]
cbmc(boolbvt::set_to(exprt const&, bool)+0x64) [0x55faaf9c0c84]
cbmc(symex_target_equationt::convert_assignments(decision_proceduret&)+0xd1) [0x55faaf715051]
cbmc(symex_target_equationt::convert_without_assertions(decision_proceduret&)+0xd7) [0x55faaf71cad7]
cbmc(symex_target_equationt::convert(decision_proceduret&)+0x21) [0x55faaf71d821]
cbmc(convert_symex_target_equation(symex_target_equationt&, decision_proceduret&, message_handlert&)+0x3de) [0x55faaf50d47e]
cbmc(prepare_property_decider(std::map<dstringt, property_infot, std::less<dstringt>, std::allocator<std::pair<dstringt const, property_infot> > >&, symex_target_equationt&, goto_symex_property_decidert&, ui_message_handlert&)+0x466) [0x55faaf50db46]
cbmc(multi_path_symex_checkert::operator()(std::map<dstringt, property_infot, std::less<dstringt>, std::allocator<std::pair<dstringt const, property_infot> > >&)+0x16c) [0x55faaf52847c]
cbmc(all_properties_verifier_with_trace_storaget<multi_path_symex_checkert>::operator()()+0x70) [0x55faaf3d7000]
cbmc(cbmc_parse_optionst::doit()+0x1118) [0x55faaf3d4bf8]
cbmc(parse_options_baset::main()+0xa8) [0x55faaf3cc848]
cbmc(main+0x34) [0x55faaf3b8984]
/lib/x86_64-linux-gnu/libc.so.6(+0x29d90) [0x7fdf48429d90]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80) [0x7fdf48429e40]
cbmc(_start+0x2a) [0x55faaf3ce43a]


--- end invariant violation report ---
Passing problem to propositional reduction

CBMC failed with status 134
VERIFICATION:- FAILED

Activity

  1. SUPERCILEX commented on Nov 2, 2022

    @SUPERCILEX

    Sure, it's pretty easy to reproduce: SUPERCILEX/ask-cli@8b8837f

    Also forgot to note that this warning shows up at the beginning:

    warning: Found the following unsupported constructs:
                 - caller_location (1)
             
             Verification will fail if one or more of these constructs is reachable.
             See https://model-checking.github.io/kani/rust-feature-support.html for more details.
    

    But the link doesn't mention the word "caller" or "location" anywhere.

  2. adpaco commented on Nov 2, 2022

    @adpaco
    ContributorAuthor

    Thanks for the example!

    About the warning, caller_location is an intrinsic. We have a special table for intrinsics (similar to the one you've seen) in the subsection here.

  3. added
    [C] Bug
    on Nov 2, 2022
  4. SUPERCILEX commented on Nov 3, 2022

    @SUPERCILEX

    Oops, updated the commit to include a #[kani::unwind(5)] that makes kani actually terminate.

  5. added
    T-User
    on Nov 14, 2022
  6. moved this to In Progress in Kani 0.17on Dec 6, 2022
  7. adpaco commented on Dec 8, 2022

    @adpaco
    ContributorAuthor

    Hey @SUPERCILEX , sorry for the late reply and thanks for updating your branch!

    I wanted to give an update: we are able to reproduce this bug in the latest Kani version, and we believe this is triggering a bug in CBMC. @tautschnig has been able to write a reduced C example that triggers the same bug, but it's unclear if there are more bugs down the line related to it. Because of that, we've re-opened the original CBMC issue (diffblue/cbmc#7288), and I'll monitor progress there and provide updates here.

  8. SUPERCILEX commented on Dec 8, 2022

    @SUPERCILEX

    Thanks for the update!

  9. added
    T-CBMC
    on Dec 8, 2022
  10. tautschnig commented on Dec 8, 2022

    @tautschnig
    Member

    diffblue/cbmc#7420 now fixes this issue on the CBMC side, and I have confirmed the fix with the provided code example (thanks @SUPERCILEX!).

  11. SUPERCILEX commented on Dec 15, 2022

    @SUPERCILEX

    Any idea when this will be released? Doesn't appear to be in 0.17.

  12. zhassan-aws commented on Dec 15, 2022

    @zhassan-aws
    Contributor

    The fix has been merged in CBMC a few days ago, and should be released with CBMC 5.73.0 (scheduled to be released on Dec 22), which will be included in Kani 0.18.0 (scheduled to be released on Dec 27).

    A workaround in the meantime is to clone the CBMC and Kani repos and build them from source.

  13. 1 remaining item

  14. moved this to In Progress in Kani 0.18on Dec 16, 2022
  15. SUPERCILEX commented on Dec 28, 2022

    @SUPERCILEX

    Should this have been fixed? I just tried 0.18 and I'm still getting typecast errors:

    warning: ignoring typecast
      * type: union_tag
          * identifier: tag-_1860050554328771774
      0: typecast
          * type: bv
              * width: 8
          0: index
              * type: signedbv
                  * width: 8
              0: symbol
                  * type: array
                      * #source_location: 
                        * file: <builtin-library-memcpy>
                        * line: 44
                        * function: memcpy
                        * working_directory: /home/asaveau/IdeaProjects/ask-cli
                      * #index_type: signedbv
                          * width: 64
                          * #c_type: signed_long_int
                      * size: symbol
                          * type: unsignedbv
                              * #source_location: 
                                * file: <built-in-additions>
                                * line: 1
                                * working_directory: /home/asaveau/IdeaProjects/ask-cli
                              * width: 64
                              * #typedef: __CPROVER_size_t
                              * #c_type: unsigned_long_int
                          * identifier: memcpy::1::1::src_n$array_size::src_n$array_size!0@5#2
                          * expression: symbol
                              * type: unsignedbv
                                  * #source_location: 
                                    * file: <built-in-additions>
                                    * line: 1
                                    * working_directory: /home/asaveau/IdeaProjects/ask-cli
                                  * width: 64
                                  * #typedef: __CPROVER_size_t
                                  * #c_type: unsigned_long_int
                              * identifier: memcpy::1::1::src_n$array_size::src_n$array_size
                          * #SSA_symbol: 1
                          * L0: 0
                          * L1: 5
                          * L2: 2
                          * L1_object_identifier: memcpy::1::1::src_n$array_size::src_n$array_size!0@5
                      0: signedbv
                          * width: 8
                  * identifier: memcpy::1::1::src_n!0@5#2
                  * expression: symbol
                      * type: array
                          * #source_location: 
                            * file: <builtin-library-memcpy>
                            * line: 44
                            * function: memcpy
                            * working_directory: /home/asaveau/IdeaProjects/ask-cli
                          * #index_type: signedbv
                              * width: 64
                              * #c_type: signed_long_int
                          * size: symbol
                              * type: unsignedbv
                                  * #source_location: 
                                    * file: <built-in-additions>
                                    * line: 1
                                    * working_directory: /home/asaveau/IdeaProjects/ask-cli
                                  * width: 64
                                  * #typedef: __CPROVER_size_t
                                  * #c_type: unsigned_long_int
                              * identifier: memcpy::1::1::src_n$array_size::src_n$array_size!0@5#2
                              * expression: symbol
                                  * type: unsignedbv
                                      * #source_location: 
                                        * file: <built-in-additions>
                                        * line: 1
                                        * working_directory: /home/asaveau/IdeaProjects/ask-cli
                                      * width: 64
                                      * #typedef: __CPROVER_size_t
                                      * #c_type: unsigned_long_int
                                  * identifier: memcpy::1::1::src_n$array_size::src_n$array_size
                              * #SSA_symbol: 1
                              * L0: 0
                              * L1: 5
                              * L2: 2
                              * L1_object_identifier: memcpy::1::1::src_n$array_size::src_n$array_size!0@5
                          0: signedbv
                              * width: 8
                      * #source_location: 
                        * file: <builtin-library-memcpy>
                        * line: 44
                        * function: memcpy
                        * working_directory: /home/asaveau/IdeaProjects/ask-cli
                      * identifier: memcpy::1::1::src_n
                  * #SSA_symbol: 1
                  * L0: 0
                  * L1: 5
                  * L2: 2
                  * L1_object_identifier: memcpy::1::1::src_n!0@5
              1: +
                  * type: signedbv
                      * width: 64
                      * #c_type: signed_long_int
                  0: constant
                      * type: signedbv
                          * width: 64
                          * #c_type: signed_long_int
                      * value: 0
                  1: unary-
                      * type: signedbv
                          * width: 64
                          * #c_type: signed_long_int
                      0: pointer_offset
                          * type: signedbv
                              * width: 64
                              * #c_type: signed_long_int
                          0: symbol
                              * type: pointer
                                  * #source_location: 
                                    * file: <built-in-additions>
                                    * line: 19
                                    * function: 
                                    * working_directory: /home/asaveau/IdeaProjects/ask-cli
                                  * width: 64
                                  0: empty
                                      * #source_location: 
                                        * file: <built-in-additions>
                                        * line: 19
                                        * function: 
                                        * working_directory: /home/asaveau/IdeaProjects/ask-cli
                                      * #constant: 1
                              * identifier: memcpy::dst!0@5#1
                              * expression: symbol
                                  * type: pointer
                                      * #source_location: 
                                        * file: <built-in-additions>
                                        * line: 19
                                        * function: 
                                        * working_directory: /home/asaveau/IdeaProjects/ask-cli
                                      * width: 64
                                      0: empty
                                          * #source_location: 
                                            * file: <built-in-additions>
                                            * line: 19
                                            * function: 
                                            * working_directory: /home/asaveau/IdeaProjects/ask-cli
                                          * #constant: 1
                                  * identifier: memcpy::dst
                              * #SSA_symbol: 1
                              * L0: 0
                              * L1: 5
                              * L2: 1
                              * L1_object_identifier: memcpy::dst!0@5
    warning: ignoring typecast
      * type: union_tag
          * identifier: tag-_1860050554328771774
      0: typecast
          * type: bv
              * width: 8
          0: index
              * type: signedbv
                  * width: 8
              0: symbol
                  * type: array
                      * #source_location: 
                        * file: <builtin-library-memcpy>
                        * line: 44
                        * function: memcpy
                        * working_directory: /home/asaveau/IdeaProjects/ask-cli
                      * #index_type: signedbv
                          * width: 64
                          * #c_type: signed_long_int
                      * size: symbol
                          * type: unsignedbv
                              * #source_location: 
                                * file: <built-in-additions>
                                * line: 1
                                * working_directory: /home/asaveau/IdeaProjects/ask-cli
                              * width: 64
                              * #typedef: __CPROVER_size_t
                              * #c_type: unsigned_long_int
                          * identifier: memcpy::1::1::src_n$array_size::src_n$array_size!0@5#2
                          * expression: symbol
                              * type: unsignedbv
                                  * #source_location: 
                                    * file: <built-in-additions>
                                    * line: 1
                                    * working_directory: /home/asaveau/IdeaProjects/ask-cli
                                  * width: 64
                                  * #typedef: __CPROVER_size_t
                                  * #c_type: unsigned_long_int
                              * identifier: memcpy::1::1::src_n$array_size::src_n$array_size
                          * #SSA_symbol: 1
                          * L0: 0
                          * L1: 5
                          * L2: 2
                          * L1_object_identifier: memcpy::1::1::src_n$array_size::src_n$array_size!0@5
                      0: signedbv
                          * width: 8
                  * identifier: memcpy::1::1::src_n!0@5#2
                  * expression: symbol
                      * type: array
                          * #source_location: 
                            * file: <builtin-library-memcpy>
                            * line: 44
                            * function: memcpy
                            * working_directory: /home/asaveau/IdeaProjects/ask-cli
                          * #index_type: signedbv
                              * width: 64
                              * #c_type: signed_long_int
                          * size: symbol
                              * type: unsignedbv
                                  * #source_location: 
                                    * file: <built-in-additions>
                                    * line: 1
                                    * working_directory: /home/asaveau/IdeaProjects/ask-cli
                                  * width: 64
                                  * #typedef: __CPROVER_size_t
                                  * #c_type: unsigned_long_int
                              * identifier: memcpy::1::1::src_n$array_size::src_n$array_size!0@5#2
                              * expression: symbol
                                  * type: unsignedbv
                                      * #source_location: 
                                        * file: <built-in-additions>
                                        * line: 1
                                        * working_directory: /home/asaveau/IdeaProjects/ask-cli
                                      * width: 64
                                      * #typedef: __CPROVER_size_t
                                      * #c_type: unsigned_long_int
                                  * identifier: memcpy::1::1::src_n$array_size::src_n$array_size
                              * #SSA_symbol: 1
                              * L0: 0
                              * L1: 5
                              * L2: 2
                              * L1_object_identifier: memcpy::1::1::src_n$array_size::src_n$array_size!0@5
                          0: signedbv
                              * width: 8
                      * #source_location: 
                        * file: <builtin-library-memcpy>
                        * line: 44
                        * function: memcpy
                        * working_directory: /home/asaveau/IdeaProjects/ask-cli
                      * identifier: memcpy::1::1::src_n
                  * #SSA_symbol: 1
                  * L0: 0
                  * L1: 5
                  * L2: 2
                  * L1_object_identifier: memcpy::1::1::src_n!0@5
              1: +
                  * type: signedbv
                      * width: 64
                      * #c_type: signed_long_int
                  0: constant
                      * type: signedbv
                          * width: 64
                          * #c_type: signed_long_int
                      * value: 1
                  1: unary-
                      * type: signedbv
                          * width: 64
                          * #c_type: signed_long_int
                      0: pointer_offset
                          * type: signedbv
                              * width: 64
                              * #c_type: signed_long_int
                          0: symbol
                              * type: pointer
                                  * #source_location: 
                                    * file: <built-in-additions>
                                    * line: 19
                                    * function: 
                                    * working_directory: /home/asaveau/IdeaProjects/ask-cli
                                  * width: 64
                                  0: empty
                                      * #source_location: 
                                        * file: <built-in-additions>
                                        * line: 19
                                        * function: 
                                        * working_directory: /home/asaveau/IdeaProjects/ask-cli
                                      * #constant: 1
                              * identifier: memcpy::dst!0@5#1
                              * expression: symbol
                                  * type: pointer
                                      * #source_location: 
                                        * file: <built-in-additions>
                                        * line: 19
                                        * function: 
                                        * working_directory: /home/asaveau/IdeaProjects/ask-cli
                                      * width: 64
                                      0: empty
                                          * #source_location: 
                                            * file: <built-in-additions>
                                            * line: 19
                                            * function: 
                                            * working_directory: /home/asaveau/IdeaProjects/ask-cli
                                          * #constant: 1
                                  * identifier: memcpy::dst
                              * #SSA_symbol: 1
                              * L0: 0
                              * L1: 5
                              * L2: 1
                              * L1_object_identifier: memcpy::dst!0@5
    warning: ignoring typecast
      * type: union_tag
          * identifier: tag-_1860050554328771774
      0: typecast
          * type: bv
              * width: 8
          0: index
              * type: signedbv
                  * width: 8
              0: symbol
                  * type: array
                      * #source_location: 
                        * file: <builtin-library-memcpy>
                        * line: 44
                        * function: memcpy
                        * working_directory: /home/asaveau/IdeaProjects/ask-cli
                      * #index_type: signedbv
                          * width: 64
                          * #c_type: signed_long_int
                      * size: symbol
                          * type: unsignedbv
                              * #source_location: 
                                * file: <built-in-additions>
                                * line: 1
                                * working_directory: /home/asaveau/IdeaProjects/ask-cli
                              * width: 64
                              * #typedef: __CPROVER_size_t
                              * #c_type: unsigned_long_int
                          * identifier: memcpy::1::1::src_n$array_size::src_n$array_size!0@5#2
                          * expression: symbol
                              * type: unsignedbv
                                  * #source_location: 
                                    * file: <built-in-additions>
                                    * line: 1
                                    * working_directory: /home/asaveau/IdeaProjects/ask-cli
                                  * width: 64
                                  * #typedef: __CPROVER_size_t
                                  * #c_type: unsigned_long_int
                              * identifier: memcpy::1::1::src_n$array_size::src_n$array_size
                          * #SSA_symbol: 1
                          * L0: 0
                          * L1: 5
                          * L2: 2
                          * L1_object_identifier: memcpy::1::1::src_n$array_size::src_n$array_size!0@5
                      0: signedbv
                          * width: 8
                  * identifier: memcpy::1::1::src_n!0@5#2
                  * expression: symbol
                      * type: array
                          * #source_location: 
                            * file: <builtin-library-memcpy>
                            * line: 44
                            * function: memcpy
                            * working_directory: /home/asaveau/IdeaProjects/ask-cli
                          * #index_type: signedbv
                              * width: 64
                              * #c_type: signed_long_int
                          * size: symbol
                              * type: unsignedbv
                                  * #source_location: 
                                    * file: <built-in-additions>
                                    * line: 1
                                    * working_directory: /home/asaveau/IdeaProjects/ask-cli
                                  * width: 64
                                  * #typedef: __CPROVER_size_t
                                  * #c_type: unsigned_long_int
                              * identifier: memcpy::1::1::src_n$array_size::src_n$array_size!0@5#2
                              * expression: symbol
                                  * type: unsignedbv
                                      * #source_location: 
                                        * file: <built-in-additions>
                                        * line: 1
                                        * working_directory: /home/asaveau/IdeaProjects/ask-cli
                                      * width: 64
                                      * #typedef: __CPROVER_size_t
                                      * #c_type: unsigned_long_int
                                  * identifier: memcpy::1::1::src_n$array_size::src_n$array_size
                              * #SSA_symbol: 1
                              * L0: 0
                              * L1: 5
                              * L2: 2
                              * L1_object_identifier: memcpy::1::1::src_n$array_size::src_n$array_size!0@5
                          0: signedbv
                              * width: 8
                      * #source_location: 
                        * file: <builtin-library-memcpy>
                        * line: 44
                        * function: memcpy
                        * working_directory: /home/asaveau/IdeaProjects/ask-cli
                      * identifier: memcpy::1::1::src_n
                  * #SSA_symbol: 1
                  * L0: 0
                  * L1: 5
                  * L2: 2
                  * L1_object_identifier: memcpy::1::1::src_n!0@5
              1: +
                  * type: signedbv
                      * width: 64
                      * #c_type: signed_long_int
                  0: constant
                      * type: signedbv
                          * width: 64
                          * #c_type: signed_long_int
                      * value: 2
                  1: unary-
                      * type: signedbv
                          * width: 64
                          * #c_type: signed_long_int
                      0: pointer_offset
                          * type: signedbv
                              * width: 64
                              * #c_type: signed_long_int
                          0: symbol
                              * type: pointer
                                  * #source_location: 
                                    * file: <built-in-additions>
                                    * line: 19
                                    * function: 
                                    * working_directory: /home/asaveau/IdeaProjects/ask-cli
                                  * width: 64
                                  0: empty
                                      * #source_location: 
                                        * file: <built-in-additions>
                                        * line: 19
                                        * function: 
                                        * working_directory: /home/asaveau/IdeaProjects/ask-cli
                                      * #constant: 1
                              * identifier: memcpy::dst!0@5#1
                              * expression: symbol
                                  * type: pointer
                                      * #source_location: 
                                        * file: <built-in-additions>
                                        * line: 19
                                        * function: 
                                        * working_directory: /home/asaveau/IdeaProjects/ask-cli
                                      * width: 64
                                      0: empty
                                          * #source_location: 
                                            * file: <built-in-additions>
                                            * line: 19
                                            * function: 
                                            * working_directory: /home/asaveau/IdeaProjects/ask-cli
                                          * #constant: 1
                                  * identifier: memcpy::dst
                              * #SSA_symbol: 1
                              * L0: 0
                              * L1: 5
                              * L2: 1
                              * L1_object_identifier: memcpy::dst!0@5
    --- begin invariant violation report ---
    Invariant check failed
    File: ../src/util/bitvector_types.h:42 function: to_bitvector_type
    Condition: can_cast_type<bitvector_typet>(type)
    Reason: Precondition
    Backtrace:
    cbmc(+0x9203ae) [0x55ef815203ae]
    cbmc(+0x92133a) [0x55ef8152133a]
    cbmc(+0x6656f) [0x55ef80c6656f]
    cbmc(+0x940381) [0x55ef81540381]
    cbmc(+0x94e270) [0x55ef8154e270]
    cbmc(+0x94e1ab) [0x55ef8154e1ab]
    cbmc(+0x689959) [0x55ef81289959]
    cbmc(+0x67499e) [0x55ef8127499e]
    cbmc(+0x6be11b) [0x55ef812be11b]
    cbmc(+0x6e5b4a) [0x55ef812e5b4a]
    cbmc(+0x6e8c2f) [0x55ef812e8c2f]
    cbmc(+0x6e372d) [0x55ef812e372d]
    cbmc(+0x6e6ea2) [0x55ef812e6ea2]
    cbmc(+0x6730b4) [0x55ef812730b4]
    cbmc(+0x3b9951) [0x55ef80fb9951]
    cbmc(+0x3c13e7) [0x55ef80fc13e7]
    cbmc(+0x3c2111) [0x55ef80fc2111]
    cbmc(+0x1a7a5e) [0x55ef80da7a5e]
    cbmc(+0x1a8126) [0x55ef80da8126]
    cbmc(+0x1c2ccc) [0x55ef80dc2ccc]
    cbmc(+0x6ee70) [0x55ef80c6ee70]
    cbmc(+0x6c9d8) [0x55ef80c6c9d8]
    cbmc(+0x64538) [0x55ef80c64538]
    cbmc(+0x50694) [0x55ef80c50694]
    /lib/x86_64-linux-gnu/libc.so.6(+0x29d90) [0x7f39e8a29d90]
    /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80) [0x7f39e8a29e40]
    cbmc(+0x661aa) [0x55ef80c661aa]
    
    
    --- end invariant violation report ---
    warning: ignoring typecast
      * type: union_tag
          * identifier: tag-_1860050554328771774
      0: typecast
          * type: bv
              * width: 8
          0: index
              * type: signedbv
                  * width: 8
              0: symbol
                  * type: array
                      * #source_location: 
                        * file: <builtin-library-memcpy>
                        * line: 44
                        * function: memcpy
                        * working_directory: /home/asaveau/IdeaProjects/ask-cli
                      * #index_type: signedbv
                          * width: 64
                          * #c_type: signed_long_int
                      * size: symbol
                          * type: unsignedbv
                              * #source_location: 
                                * file: <built-in-additions>
                                * line: 1
                                * working_directory: /home/asaveau/IdeaProjects/ask-cli
                              * width: 64
                              * #typedef: __CPROVER_size_t
                              * #c_type: unsigned_long_int
                          * identifier: memcpy::1::1::src_n$array_size::src_n$array_size!0@5#2
                          * expression: symbol
                              * type: unsignedbv
                                  * #source_location: 
                                    * file: <built-in-additions>
                                    * line: 1
                                    * working_directory: /home/asaveau/IdeaProjects/ask-cli
                                  * width: 64
                                  * #typedef: __CPROVER_size_t
                                  * #c_type: unsigned_long_int
                              * identifier: memcpy::1::1::src_n$array_size::src_n$array_size
                          * #SSA_symbol: 1
                          * L0: 0
                          * L1: 5
                          * L2: 2
                          * L1_object_identifier: memcpy::1::1::src_n$array_size::src_n$array_size!0@5
                      0: signedbv
                          * width: 8
                  * identifier: memcpy::1::1::src_n!0@5#2
                  * expression: symbol
                      * type: array
                          * #source_location: 
                            * file: <builtin-library-memcpy>
                            * line: 44
                            * function: memcpy
                            * working_directory: /home/asaveau/IdeaProjects/ask-cli
                          * #index_type: signedbv
                              * width: 64
                              * #c_type: signed_long_int
                          * size: symbol
                              * type: unsignedbv
                                  * #source_location: 
                                    * file: <built-in-additions>
                                    * line: 1
                                    * working_directory: /home/asaveau/IdeaProjects/ask-cli
                                  * width: 64
                                  * #typedef: __CPROVER_size_t
                                  * #c_type: unsigned_long_int
                              * identifier: memcpy::1::1::src_n$array_size::src_n$array_size!0@5#2
                              * expression: symbol
                                  * type: unsignedbv
                                      * #source_location: 
                                        * file: <built-in-additions>
                                        * line: 1
                                        * working_directory: /home/asaveau/IdeaProjects/ask-cli
                                      * width: 64
                                      * #typedef: __CPROVER_size_t
                                      * #c_type: unsigned_long_int
                                  * identifier: memcpy::1::1::src_n$array_size::src_n$array_size
                              * #SSA_symbol: 1
                              * L0: 0
                              * L1: 5
                              * L2: 2
                              * L1_object_identifier: memcpy::1::1::src_n$array_size::src_n$array_size!0@5
                          0: signedbv
                              * width: 8
                      * #source_location: 
                        * file: <builtin-library-memcpy>
                        * line: 44
                        * function: memcpy
                        * working_directory: /home/asaveau/IdeaProjects/ask-cli
                      * identifier: memcpy::1::1::src_n
                  * #SSA_symbol: 1
                  * L0: 0
                  * L1: 5
                  * L2: 2
                  * L1_object_identifier: memcpy::1::1::src_n!0@5
              1: +
                  * type: signedbv
                      * width: 64
                      * #c_type: signed_long_int
                  0: constant
                      * type: signedbv
                          * width: 64
                          * #c_type: signed_long_int
                      * value: 3
                  1: unary-
                      * type: signedbv
                          * width: 64
                          * #c_type: signed_long_int
                      0: pointer_offset
                          * type: signedbv
                              * width: 64
                              * #c_type: signed_long_int
                          0: symbol
                              * type: pointer
                                  * #source_location: 
                                    * file: <built-in-additions>
                                    * line: 19
                                    * function: 
                                    * working_directory: /home/asaveau/IdeaProjects/ask-cli
                                  * width: 64
                                  0: empty
                                      * #source_location: 
                                        * file: <built-in-additions>
                                        * line: 19
                                        * function: 
                                        * working_directory: /home/asaveau/IdeaProjects/ask-cli
                                      * #constant: 1
                              * identifier: memcpy::dst!0@5#1
                              * expression: symbol
                                  * type: pointer
                                      * #source_location: 
                                        * file: <built-in-additions>
                                        * line: 19
                                        * function: 
                                        * working_directory: /home/asaveau/IdeaProjects/ask-cli
                                      * width: 64
                                      0: empty
                                          * #source_location: 
                                            * file: <built-in-additions>
                                            * line: 19
                                            * function: 
                                            * working_directory: /home/asaveau/IdeaProjects/ask-cli
                                          * #constant: 1
                                  * identifier: memcpy::dst
                              * #SSA_symbol: 1
                              * L0: 0
                              * L1: 5
                              * L2: 1
                              * L1_object_identifier: memcpy::dst!0@5
    
    CBMC failed with status 134
    VERIFICATION:- FAILED
    
  16. zhassan-aws commented on Dec 28, 2022

    @zhassan-aws
    Contributor

    Unfortunately, we could not integrate the newer CBMC version (5.73.0) in Kani 0.18.0 due to a bug that was introduced in CBMC (#2020). This bug has been fixed, so we're waiting for a new CBMC version to be released.

  17. SUPERCILEX commented on Dec 29, 2022

    @SUPERCILEX

    Sounds good, thanks for letting me know. BTW, will you guys close this issue once the fix has been released in Kani? That way I can stop bugging you for status updates. :)

  18. zhassan-aws commented on Dec 29, 2022

    @zhassan-aws
    Contributor

    Apologies for the delay. Yes, that's the plan :)

  19. moved this to In Progress in Kani 2023-01-23on Jan 3, 2023
  20. added this to the Maintenance milestone on Jan 5, 2023
  21. moved this from In Progress to Done in Kani 0.18on Jan 20, 2023
  22. moved this from In Progress to Done in Kani 0.17on Jan 20, 2023
  23. moved this from In Progress to Done in Kani 2023-01-23on Jan 20, 2023
  24. adpaco commented on Jan 22, 2023

    @adpaco
    ContributorAuthor

    @SUPERCILEX we were able to upgrade to a newer version of CBMC (5.75.0) in #2067, which includes the fix for this invariant. You should be able to test it by building Kani from source, or alternatively wait a couple days (Tue 24) for the newest Kani release.

  25. SUPERCILEX commented on Jan 24, 2023

    @SUPERCILEX

    It works! Thanks everybody

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

T-CBMCT-User[C] Bug[F] Crash

Type

No type

Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions