You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cargo clean required between cargo kani invocations #1591
I often run into issues when rerunning cargo kani without doing cargo clean in between.
One of the issues is the Error: Conflicting proof harnesses named ... error. I could reproduce through updating the dependencies or through adding a lib crate to a bin crate.
For example:
cargo new --lib foo
cd foo
Replace the contents of src/lib.rs with:
#[kani::proof]fncheck(){assert!(1 + 1 == 2);}
Run cargo kani --harness check
Add a dependency to Cargo.toml, e.g.:
[dependencies]
bitflags = "1.3.2"
Rerun cargo kani --harness check
This produces:
Compiling bitflags v1.3.2
Compiling foo v0.1.0 (/home/ubuntu/examples/conflicting/tmp/foo)
Finished dev [unoptimized + debuginfo] target(s) in 0.17s
Error: Conflicting proof harnesses named check:
check
check
The same error can be reproduced through creating a binary crate, runing cargo kani --harness check, adding a src/lib.rs file, and rerunning cargo kani --harness check.
This error does not occur if I cargo clean in between the two cargo kani invocations.
Apparently, the modification (adding a dependency or adding a module) results in changing the checksum, so the metadata files do not get overwritten. With both metadata files lying around, the Kani driver thinks that there are duplicate harnesses.
Activity
zhassan-aws commentedon Aug 26, 2022
If I invoke
cargo kaniwithout--harnessbut edit the harness body in between invocations, I get an error in CBMC instead (the same error in #1448).zhassan-aws commentedon Aug 26, 2022
The root cause of both issues is that the Kani driver collects the symtab and metadata files through a * glob.
[-]cargo clean required between cargo kani invokations[/-][+]cargo clean required between cargo kani invocations[/+]tedinski commentedon Aug 29, 2022
jaisnan commentedon Aug 29, 2022
Also another side effect of this issue, the output from
cargo kanirepeats itself withoutcargo cleanbefore invocations.tedinski commentedon Oct 13, 2022
Upped priority. Customers seem to hit this often...
celinval commentedon Nov 9, 2022
This has been fixed by #1847