Skip to content

Slice comparison/loop unwinding causing extensive kani runtime #125

Answered by zhassan-aws
QinyuanWu asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @QinyuanWu. When the array length is constrained via an assumption, i.e.

        let slice_len: usize = kani::any(); // if set to 3 kani finishes in 1.3s
        kani::assume(slice_len <= arr_len);

CBMC is unable to determine if the unwinding is sufficient during symbolic execution, hence it keeps unwinding. In this case, an unwind attribute must be specified, e.g.

    #[kani::proof_for_contract(NonNull::slice_from_raw_parts)]
    #[kani::unwind(11)]
    pub fn non_null_check_slice_from_raw_parts() {

Specifying an unwind value should resolve the issue.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by QinyuanWu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants