Closed matthiaskrgr closed 3 months ago
@adpaco-aws this is an issue with the CBMC output parser. Can you take a look?
Note that you need to use the attached tarball (I couldn't reproduce it by copying and pasting the code).
This is the raw output from CBMC:
kani 2.rs --output-format old
...
/home/ubuntu/examples/iss2261/2.rs function main
[main.assertion.1] line 3 [KANI_CHECK_ID_2.a89191b9::2_0] assertion failed: r"newline:'
', tab:' ', unicode:'β', null:''" ==
"newline:'\n', tab:'\t', unicode:'\u{25cf}', null:'\0'": SUCCESS
The failure corresponds to these lines (455-457) in parse_item
:
let complete_string = &self.input_so_far[0..self.input_so_far.len()];
let result_item: Result<ParserItem, _> = serde_json::from_str(complete_string);
result_item.unwrap()
serde_json
returns an error because it finds control characters in the JSON output, which aren't considered valid. There may be a way to disable this validation, but I'm not sure we want to do that π
I see this more as a limitation that the JSON format introduces because of our current approach to post-processing. I don't have a good solution for that at the moment.
this seems fixed with kani 0.40 \o/
This doesn't crash anymore as @matthiaskrgr pointed out. The assertion fails but that's also what happens in the Rust playground.
SUMMARY:
** 1 of 39 failed
Failed Checks: assertion failed: r"newline:'
', tab:' ', unicode:'β', null:''" ==
"newline:'\n', tab:'\t', unicode:'\u{25cf}', null:'\0'"
File: "src/main.rs", line 3, in main
VERIFICATION:- FAILED
Verification Time: 0.10546225s
I tried this code:
using the following command line invocation:
with Kani version: 0.22.0
I expected to see this happen: explanation
Instead, this happened: explanation
2.rs.tar.gz