generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 141
Closed
Labels
T-CBMCIssue related to an existing CBMC issueIssue related to an existing CBMC issue[C] Feature / EnhancementA new feature request or enhancement to an existing feature.A new feature request or enhancement to an existing feature.[E] PerformanceTrack performance improvement (Time / Memory / CPU)Track performance improvement (Time / Memory / CPU)
Description
I tried this code:
use std::fmt::Display;
enum Foo {
A(String),
B(String),
}
impl Display for Foo {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let s = match self {
Foo::A(s) => format!("A.{s}"),
Foo::B(s) => format!("B.{s}"),
};
write!(f, "{s}")?;
Ok(())
}
}
#[kani::proof]
#[kani::unwind(6)]
fn fast() {
let a = Foo::A(String::from("foo"));
let s = match a {
Foo::A(s) => format!("A.{s}"),
Foo::B(s) => format!("B.{s}"),
};
assert_eq!(s, "A.foo");
}
#[kani::proof]
#[kani::unwind(6)]
fn slow() {
let a = Foo::A(String::from("foo"));
let s = a.to_string();
assert_eq!(s, "A.foo");
}using the following command line invocation:
kani str_from.rs --harness fast
kani str_from.rs --harness slow
with Kani version: 71b9d0e
I expected to see this happen: Verification time is about the same for the two harnesses.
Instead, this happened: The fast harness completes in less than 4 seconds, but the slow harness runs for over 60 minutes without terminating (and consumes close to 6 GB of memory).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
T-CBMCIssue related to an existing CBMC issueIssue related to an existing CBMC issue[C] Feature / EnhancementA new feature request or enhancement to an existing feature.A new feature request or enhancement to an existing feature.[E] PerformanceTrack performance improvement (Time / Memory / CPU)Track performance improvement (Time / Memory / CPU)