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
$ cargo new exr-test
Created binary (application) `exr-test` package
$ cd exr-test/
$ cargo add exr
Updating crates.io index
Adding exr v1.5.0 to dependencies.
$ cargo kani
[..SNIP..]
thread 'rustc' panicked at 'assertion failed: `(left == right)`
left: `40`,
right: `33`', kani-compiler/src/codegen_cprover_gotoc/codegen/rvalue.rs:883: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: <meta::header::LayerAttributes as std::fmt::Debug>::fmt
_RNvXs2_NtNtCs6ehrxsMMmGu_3exr4meta6headerNtB5_15LayerAttributesNtNtCs2ybv9YpAGK_4core3fmt5Debug3fmt
[Kani] current codegen location: Loc { file: "/home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/exr-1.5.0/src/meta/header.rs", function: None, start_line: 1150, start_col: Some(5), end_line: 1150, end_col: Some(79) }
error: could not compile `exr`
Error: cargo exited with status exit status: 101
thread 'rustc' panicked at 'assertion failed: `(left == right)`
left: `920`,
right: `1831`', kani-compiler/src/codegen_cprover_gotoc/codegen/rvalue.rs:883: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: prepare::prepare_rec
_RNvNtCsbtOfR33BsoT_14tokio_postgres7prepare11prepare_rec
[Kani] current codegen location: Loc { file: "/home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-postgres-0.7.7/src/prepare.rs", function: None, start_line: 106, start_col: Some(1), end_line: 110, end_col: Some(73) }
And in threadpool
thread 'rustc' panicked at 'assertion failed: `(left == right)`
left: `4400`,
right: `4106`', kani-compiler/src/codegen_cprover_gotoc/codegen/rvalue.rs:883: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: threadpool::ThreadPool::execute::<[closure@exr::block::writer::ParallelBlocksCompressor<exr::block::writer::OnProgressChunkWriter<exr::block::writer::ChunkWriter<&mut &mut std::io::BufWriter<std::fs::File>>, fn(f64)>>::add_block_to_compression_queue::{closure#0}]>
_RINvMs3_CsfmIsuIbxhid_10threadpoolNtB6_10ThreadPool7executeNCNvMs3_NtNtCs7iMfnwNXZd0_3exr5block6writerINtB13_24ParallelBlocksCompressorINtB13_21OnProgressChunkWriterINtB13_11ChunkWriterQQINtNtNtNtCslqDs7LX7IdZ_3std2io8buffered9bufwriter9BufWriterNtNtB38_2fs4FileEEFdEuEE30add_block_to_compression_queue0ECskB3hp221BIC_5image
[Kani] current codegen location: Loc { file: "/home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/threadpool-1.8.1/src/lib.rs", function: None, start_line: 427, start_col: Some(5), end_line: 429, end_col: Some(38) }
I believe this issue has similar root cause as #1395. The failure is triggered while trying to create a vtable for a generator wrapper:
let _7: std::pin::Pin<std::boxed::Box<dyn std::future::Future<Output = ()>>>
let _8: std::pin::Pin<std::boxed::Box<std::future::from_generator::GenFuture<[static [email protected]:123:20: 126:10]>>>
...
_7 = move _8 as std::pin::Pin<std::boxed::Box<dyn std::future::Future<Output = ()>>> (Pointer(Unsize))
I.e.: This code is converting std::future::from_generator::GenFuture<[static [[email protected]](mailto:[email protected]):123:20: 126:10]> into dyn std::future::Future<Output = ()>.
We fail because the size of std::future::from_generator::GenFuture<[static [[email protected]](mailto:[email protected]):123:20: 126:10]> computed using layout_of differs from getting the size of the type we have generated.
Activity
tedinski commentedon Aug 26, 2022
This also occurs in
tokio-postgresAnd in
threadpoolfzaiser commentedon Aug 29, 2022
Example without dependencies (~130 lines) that I hit while working on #1504:
Details
Run it like this:
RUSTFLAGS="--edition 2021" kani test.rsResult:
celinval commentedon Aug 29, 2022
I believe this issue has similar root cause as #1395. The failure is triggered while trying to create a vtable for a generator wrapper:
I.e.: This code is converting
std::future::from_generator::GenFuture<[static [[email protected]](mailto:[email protected]):123:20: 126:10]>intodyn std::future::Future<Output = ()>.We fail because the size of
std::future::from_generator::GenFuture<[static [[email protected]](mailto:[email protected]):123:20: 126:10]>computed usinglayout_ofdiffers from getting the size of the type we have generated.