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
CBMC version: HEAD (cbmc-5.36.0-72-gf917b98e8) and cbmc-5.30.1
Operating system: Ubuntu 20.04
Exact command line resulting in the issue:
build/bin/symtab2gb unsigned.json --out prog
build/bin/cbmc prog --function main
What behaviour did you expect: CBMC to successfully verify
What happened instead:
CBMC version 5.36.0 (cbmc-5.36.0-72-gf917b98e8) 64-bit x86_64 linux
Reading GOTO program from file
...SNIPPED...
converting SSA
--- begin invariant violation report ---
Invariant check failed
File: /home/ubuntu/cbmc/src/solvers/flattening/boolbv_mult.cpp:73 function: convert_mult
Condition: it->type() == expr.type()
Reason: multiplication operands should have same type as expression
I've attached two files: unsigned.json and signed.json. These files are generated by RMC (Rust Model Checker), which generates symbol tables to send as inputs to CBMC. The unsigned file exhibits this crash in CBMC, and signed shows the "fix" (or workaround?) that does not. The difference between these is simply choice of type for some values that are used as array/vector indexes. (i.e. one does a more complicated version of a[x] where x is unsigned, and the other a[x] but now x is signed. But I haven't been able to reproduce this from C code, so it must be more complicated than that, somehow.) I'm not skilled at debugging CBMC, so I'm asking for some help here.
It very well could be the error is on RMC's side (generating a bad symbol table), but I'm unable to figure out exactly what it might be. A multiply doesn't appear in our symbol table, I'm guessing it's generated as part of array/vector indexing. However:
I think there's at least an error message problem with CBMC. (It'd be nice if the invariant error were spotted earlier than this presumably generated code, since we don't emit any mult constructs.)
I think there's a bug with how the CBMC back-end is handling types, possibly one that is not even triggerable from the C front-end of CBMC. We should be able to index an array with an unsigned integer type, right?
I might be barking up the wrong tree thinking it's about array/vector indexing!
The original input Rust files were minimized before running them through RMC to generate the attached file, but it's still a large symbol table file. I'm hoping this bug will be easy to spot if someone skilled with debugging CBMC looks into this crash for me. But if it's necessary to try to minimize the generated symbol table file, let me know and I'll see what I can do.
When computing a new offset for a byte extract, do not implicitly assume
that byte-extract offsets and array index operations use exactly the
same type for we don't prescribe the type to use as a byte-extract
offset.
Fixes: diffblue#6298
CBMC version: HEAD (cbmc-5.36.0-72-gf917b98e8) and cbmc-5.30.1
Operating system: Ubuntu 20.04
Exact command line resulting in the issue:
What behaviour did you expect: CBMC to successfully verify
What happened instead:
Click to expand Backtrace:
I've attached two files:
unsigned.json
andsigned.json
. These files are generated by RMC (Rust Model Checker), which generates symbol tables to send as inputs to CBMC. The unsigned file exhibits this crash in CBMC, and signed shows the "fix" (or workaround?) that does not. The difference between these is simply choice of type for some values that are used as array/vector indexes. (i.e. one does a more complicated version ofa[x]
wherex
is unsigned, and the othera[x]
but nowx
is signed. But I haven't been able to reproduce this from C code, so it must be more complicated than that, somehow.) I'm not skilled at debugging CBMC, so I'm asking for some help here.The code in RMC that generates the constructs in question is in a pull request here if that's helpful in understanding what's going on:
https://github.com/model-checking/rmc/pull/417/files#diff-6d72a804aa90eefd32b74c247e51a3b501a686a3a2c137dbcfff59b932a209deR860-R862
It very well could be the error is on RMC's side (generating a bad symbol table), but I'm unable to figure out exactly what it might be. A multiply doesn't appear in our symbol table, I'm guessing it's generated as part of array/vector indexing. However:
mult
constructs.)The original input Rust files were minimized before running them through RMC to generate the attached file, but it's still a large symbol table file. I'm hoping this bug will be easy to spot if someone skilled with debugging CBMC looks into this crash for me. But if it's necessary to try to minimize the generated symbol table file, let me know and I'll see what I can do.
Files
The text was updated successfully, but these errors were encountered: