-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Difference in size of generators between rustc (with panic=unwind!) and Kani #1395
Comments
@fzaiser I was taking a look at this issue, and I bumped into the following rust issue: rust-lang/rust#59123. It seems that the panic strategy can impact the generator size. If I run the example you pasted above with the following command:
The assertion fails because the size is now 1025:
|
Why would you write that specific test though? Isn't it actually a good thing that Kani differs from LLVM? The size of a generator is a property the developer should never rely on |
@giltho Kani is supposed to be bit-precise model checker, so we should get the sizes right. It's not something the user should rely on, but internally, Kani should compute the right sizes for offsets etc. |
I agree, but what is the "right" size? If WASM and LLVM disagree, why would LLVM be "right" and WASM be "wrong"? |
The test has been disabled for WASM, I don't think it's a bad thing to disable it for Kani too |
@giltho It looks like the actual difference is not LLVM vs WASM but "panic=unwind" vs "panic=abort". So we may have to update the tests. I'll update the title when I know for sure what the reason is. |
Update: the discrepancy is in fact due to Kani assuming
panic=abort
, but the Rust compiler assumingpanic=unwind
by default.In #1378 (comment), it was observed that Kani sometimes reports a different size of a generator than the LLVM backend of rustc. Interestingly, the WASM backend seems to disagree with LLVM as well (see rust-lang/rust#62807).
The example code is the following:
The text was updated successfully, but these errors were encountered: