-
Notifications
You must be signed in to change notification settings - Fork 97
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
Bad pointer deref in SizeAndAlignOfDst/main_fail.rs
#87
Comments
The cast now succeeds; but the test itself fails with a verification failure. Not sure if this is expected behavior because CBMC can't reason about locks. Will confirm and close issue if expected. Code in question: let s: Arc<Mutex<dyn Subscriber>> = Arc::new(Mutex::new(DummySubscriber::new()));
let mut data = s.lock().unwrap();
data.increment();
assert!(data.get() == 1); |
The test does also fail with invalid references when you pass |
SizeAndAlignOfDst/main_fail.rs
Add saturating abs/neg
This test (which was moved to
So it is related to #576 (comment). Removing "MLP - Must Have" label. |
The issue described here seems to be fixed, but we can't fully validate this until we fix the issue with linking std library. |
Linking the standard library is no longer an issue here, but it looks like we are still incorrectly generating code for this. I added a new simple harness to this tests that should succeed but it still fails: #[kani::proof]
#[kani::unwind(2)]
fn simplified() {
let s: Arc<Mutex<dyn Subscriber>> = Arc::new(Mutex::new(DummySubscriber::new()));
let data = s.lock().unwrap();
assert!(data.get() == 0);
} |
Upgrade toolchain to 2024-02-17. Relevant PR: - rust-lang/rust#120500 - rust-lang/rust#100603 Fixes #87 Fixes #3034 Fixes #3037
RMC fails to cast a "mutable raw pointer to a trait object" to a "mutable raw pointer to a unit" that arises in the regression test
rust-tests/cbmc-reg/SizeAndAlignOfDst/main_fail.rs
described in issue #33 that was used initially to illustrate an issue with the unsized pointer cast.The mir generated by rustc on the test includes
where you can see that the pointer to the trait object (a fat pointer) is being cast to a pointer to a unit (thin pointer), and
codegen_misc_cast
fails because thecast_to
predicate says you can't cast a goto struct to a goto pointer.The text was updated successfully, but these errors were encountered: