Skip to content

Assertion failure in struct_expr_from_values #1594

Closed

Description

@tedinski

Triggerable with xml5ever

$ cargo new xml5ever-test
     Created binary (application) `xml5ever-test` package
$ cd xml5ever-test/
$ cargo add xml5ever
    Updating crates.io index
      Adding xml5ever v0.17.0 to dependencies.
$ RUST_BACKTRACE=1 cargo kani
[..SNIP..]
thread 'rustc' panicked at 'assertion failed: `(left == right)`
  left: `2`,
 right: `1`: Error in struct_expr; mismatch in number of fields and values.
        StructTag("tag-_1798241384372282195")
        [Expr { value: Struct { values: [Expr { value: IntConstant(25769803778), typ: Unsignedbv { width: 64 }, location: None }] }, typ: StructTag("tag-_5949123235842902480"), location: None }]', cprover_bindings/src/goto_program/expr.rs:793:9
stack backtrace:
   4: cprover_bindings::goto_program::expr::Expr::struct_expr_from_values
             at /home/ubuntu/rmc/cprover_bindings/src/goto_program/expr.rs:793:9
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose 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: tokenizer::process_qname
_RNvNtCsgKJxp8YCIL8_8xml5ever9tokenizer13process_qname
[Kani] current codegen location: Loc { file: "/home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/xml5ever-0.17.0/src/tokenizer/mod.rs", function: None, start_line: 58, start_col: Some(1), end_line: 58, end_col: Some(51) }
error: could not compile `xml5ever`
Error: cargo exited with status exit status: 101

The assertion triggering:

        assert_eq!(
            non_padding_fields.len(),
            non_padding_values.len(),
            "Error in struct_expr; mismatch in number of fields and values.\n\t{:?}\n\t{:?}",
            typ,
            non_padding_values
        );

Activity

  1. added
    [C] Bug
    on Aug 26, 2022
  2. zhassan-aws commented on Jan 30, 2025

    @zhassan-aws
    Contributor

    This no longer crashes with 3e93311:

       Compiling xml5ever-test v0.1.0 (/home/ubuntu/examples/iss1594/xml5ever-test)
        Finished `dev` profile [unoptimized + debuginfo] target(s) in 6.99s
    No proof harnesses (functions with #[kani::proof]) were found to verify.
    

    Closing.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    [C] Bug[F] Crash

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions