Comments (7)
You'll want kani --verbose --keep-temps
-- the latter keeps the temporary files, and the --verbose
will tell you the exact commands that were invoked on those files.
from kani.
Hi @nishanthkarthik , just wanted to let you know that @celinval and @tautschnig have been trying to get some clarity on guarantees over ZST pointers in rust-lang/unsafe-code-guidelines#503 . Please feel free to join the discussion if you have more questions yourself.
from kani.
Thank you very much for your report. We will investigate how to fix this in Kani (CBMC as the underlying verification engine assumes that each object has a unique address), but ZST objects are a Rust peculiarity.
from kani.
Thank you. Is there an easy way to see how a rust snippet is converted to a CBMC input file? I looked for something like kani --keep-temporary-files
but I did not find any.
from kani.
Hi @nishanthkarthik, I am not sure this assumption holds, do you have any reference on this?
AFAIK, a pointer to a ZST is still a thin pointer (at least for now, there has been discussions to change that). So I believe thin pointer comparison rules still apply to them (which are also not well defined).
The main difference when it comes to ZST pointers is that a ZST access is valid even for dangling points (rust-lang/unsafe-code-guidelines#472).
There is one interesting thing though that it is worth mentioning, you do have to be careful when it comes to relying on address values in Kani. They do translate to concrete values, and each allocation will always have its unique value, even if their lifetime do not overlap.
from kani.
BTW, I ran your test case, and it also succeeds in MIRI, since there is no UB and each local variable is considered a different allocation.
from kani.
I did not find a source that said pointers to different ZST objects are guaranteed to be distinct, so I assumed they would be havoc'd by default and consequently a program trace may set ptr
to null.
Is comparing pointers of ZSTs UB (or just valid but unspecified behavior)?
from kani.
Related Issues (20)
- Enums that are #[repr(u8)] are slower than u8 HOT 2
- Stacked Borrows In Kani -- Extend Feature to handle more code HOT 2
- Toolchain upgrade to nightly-2024-08-31 failed HOT 2
- Toolchain upgrade to nightly-2024-08-31 failed
- Upgrade upload-artifact and download-artifact actions
- ICE: `failed to resolve instance for <dyn ThriftService as ThriftService>::foo` HOT 1
- Emit annotated item in error message HOT 1
- CI fails with latest CBMC HOT 1
- Kani does not detect UB when generating an invalid slice reference from an invalid slice pointer HOT 2
- Toolchain upgrade to nightly-2024-09-07 failed
- CBMC upgrade to 6.2.0 failed
- Toolchain upgrade to nightly-2024-09-09 failed
- Toolchain upgrade to nightly-2024-09-12 failed HOT 1
- Toolchain upgrade to nightly-2024-09-13 failed HOT 1
- Toolchain upgrade to nightly-2024-09-15 failed
- Toolchain upgrade to nightly-2024-09-18 failed
- CBMC upgrade to 6.3.1 failed HOT 1
- Check structures and other code is duplicated in `kani-cov`
- Filenames stored in raw coverage results should be absolute
- Some coverage results need to be filtered out because they point to non-existing regions HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kani.