about summary refs log tree commit diff
path: root/src/tools/miri
AgeCommit message (Collapse)AuthorLines
2023-03-31Auto merge of #98112 - saethlin:mir-alignment-checks, r=oli-obkbors-11/+53
Insert alignment checks for pointer dereferences when debug assertions are enabled Closes https://github.com/rust-lang/rust/issues/54915 - [x] Jake tells me this sounds like a place to use `MirPatch`, but I can't figure out how to insert a new basic block with a new terminator in the middle of an existing basic block, using `MirPatch`. (if nobody else backs up this point I'm checking this as "not actually a good idea" because the code looks pretty clean to me after rearranging it a bit) - [x] Using `CastKind::PointerExposeAddress` is definitely wrong, we don't want to expose. Calling a function to get the pointer address seems quite excessive. ~I'll see if I can add a new `CastKind`.~ `CastKind::Transmute` to the rescue! - [x] Implement a more helpful panic message like slice bounds checking. r? `@oli-obk`
2023-03-24miri: fix raw pointer dyn receiversRalf Jung-0/+27
2023-03-23A MIR transform that checks pointers are alignedBen Kimock-11/+53
2023-03-22Add `CastKind::Transmute` to MIRScott McMurray-5/+7
Updates `interpret`, `codegen_ssa`, and `codegen_cranelift` to consume the new cast instead of the intrinsic. Includes `CastTransmute` for custom MIR building, to be able to test the extra UB.
2023-03-23Rollup merge of #109435 - oli-obk:🇨🇭🥚_copy_op, r=RalfJungDylan DPC-1/+1
Detect uninhabited types early in const eval r? `@RalfJung` implements https://github.com/rust-lang/rust/pull/108442#discussion_r1143003840 this is a breaking change, as some UB during const eval is now detected instead of silently being ignored. Users can see this and other UB that may cause future breakage with `-Zextra-const-ub-checks` or just by running miri on their code, which sets that flag by default.
2023-03-21LocalCrate keyMichael Goulet-1/+2
2023-03-21Use local key in providersMichael Goulet-3/+2
2023-03-21Add a layout argument to `enforce_validity`.Oli Scherer-1/+1
This is in preparation of checking the validity only of certain types.
2023-03-21Auto merge of #108262 - ChrisDenton:libntdll, r=Mark-Simulacrumbors-69/+68
Distribute libntdll.a with windows-gnu toolchains This allows the OS loader to load essential functions (e.g. read/write file) at load time instead of lazily doing so at runtime. r? libs
2023-03-18Rollup merge of #109234 - tmiasko:overflow-checks, r=cjgillotMatthias Krüger-1/+1
Tweak implementation of overflow checking assertions Extract and reuse logic controlling behaviour of overflow checking assertions instead of duplicating it three times. r? `@cjgillot`
2023-03-16Auto merge of #2817 - saethlin:rustup, r=saethlinbors-1/+1
rustup Doing a sync just before I do a rustc-push
2023-03-16Preparing for merge from rustcBen Kimock-1/+1
2023-03-16Tweak implementation of overflow checking assertionsTomasz MiÄ…sko-1/+1
Extract and reuse logic controlling behaviour of overflow checking assertions instead of duplicating it three times.
2023-03-16TB: select tests to run both TB and SBNeven Villani-5/+116
2023-03-16TB: new testsNeven Villani-0/+888
2023-03-16TB: document TB changes in READMENeven Villani-118/+218
2023-03-16TB: integrationNeven Villani-16/+54
2023-03-16TB: Reborrow policy and connection to the main machineNeven Villani-1/+608
2023-03-16TB: error and tree formattingNeven Villani-0/+592
2023-03-16TB: tree traversalNeven Villani-0/+339
2023-03-16TB: public interface to permissionsNeven Villani-0/+93
2023-03-16TB: Tree structureNeven Villani-0/+215
2023-03-16TB: Util: an efficient mapping for permissionsNeven Villani-0/+304
2023-03-16TB: encoding of the underlying state machineNeven Villani-0/+214
+ properties about the transitions
2023-03-15Auto merge of #2806 - saethlin:better-install, r=RalfJungbors-17/+15
Install binaries to the miri toolchain's sysroot The default install produces this behavior: ``` $ cargo +miri miri --version miri 0.1.0 (0ba1f4a0 2023-03-05) $ cargo +nightly miri --version miri 0.1.0 (0ba1f4a0 2023-03-05) ``` Which is not good. We've effectively erased the toolchain selection, and users may reasonably conclude that their rustup install is broken. After this change, we now get this: ``` $ cargo +miri miri --version miri 0.1.0 (0ba1f4a0 2023-03-05) $ cargo +nightly miri --version miri 0.1.0 (f63ccaf 2023-03-06) ``` Thanks `@jyn514` who all but wrote this for me.
2023-03-15use date-based cache keyRalf Jung-4/+4
2023-03-14Merge from rustcBen Kimock-74/+23
2023-03-14Preparing for merge from rustcBen Kimock-1/+1
2023-03-14Don't use CI caches from before this branchBen Kimock-4/+4
2023-03-14Update docs to matchBen Kimock-10/+7
Co-authored-by: Ralf Jung <post@ralfj.de>
2023-03-12Auto merge of #2811 - saethlin:readme-nextest, r=RalfJungbors-0/+20
Add a section on using nextest Inspired by this question: https://github.com/rust-lang/miri/issues/2805
2023-03-12tweak readmeRalf Jung-3/+3
2023-03-12Add a section on using nextestBen Kimock-0/+20
2023-03-12Remove uses of `box_syntax` in rustc and toolsclubby789-38/+15
2023-03-11Implement intrinsics for round_ties_evenBen Kimock-0/+35
2023-03-10Merge from rustcBen Kimock-1/+4
2023-03-10Preparing for merge from rustcBen Kimock-1/+1
2023-03-09Install binaries to the miri toolchain's sysrootBen Kimock-4/+5
2023-03-09replace legacy copyright annotations in submodulesPietro Albini-36/+8
2023-03-08Auto merge of #108312 - michaelwoerister:hash-set-not-hash-stable, r=eholkbors-1/+4
Do not implement HashStable for HashSet (MCP 533) This PR removes all occurrences of `HashSet` in query results, replacing it either with `FxIndexSet` or with `UnordSet`, and then removes the `HashStable` implementation of `HashSet`. This is part of implementing [MCP 533](https://github.com/rust-lang/compiler-team/issues/533), that is, removing the `HashStable` implementations of all collection types with unstable iteration order. The changes are mostly mechanical. The only place where additional sorting is happening is in Miri's override implementation of the `exported_symbols` query.
2023-03-05Merge from rustcBen Kimock-1/+2
2023-03-05Preparing for merge from rustcBen Kimock-1/+1
2023-03-02Rollup merge of #108022 - CraftSpider:align-bytes, r=oli-obkMatthias Krüger-1/+2
Support allocations with non-Box<[u8]> bytes This is prep work for allowing miri to support passing pointers to C code, which will require `Allocation`s to be correctly aligned. Currently, it just makes `Allocation` generic and plumbs the necessary changes through the right places. The follow-up to this will be adding a type in the miri interpreter which correctly aligns the bytes, using that for the Miri engine, then allowing Miri to pass pointers into these allocations to C calls. Based off of #100467, credit to ```@emarteca``` for the code
2023-03-01Use LocalDefIdSet instead of FxHashSet for reachable_set query.Michael Woerister-1/+4
2023-02-26replace as_file_handle by as_anyRalf Jung-14/+38
2023-02-26a bit of FileDescriptor trait cleanupRalf Jung-31/+35
2023-02-26Merge from rustcRalf Jung-1/+1
2023-02-26Preparing for merge from rustcRalf Jung-1/+1
2023-02-25Auto merge of #2798 - LevitatingLion:master, r=oli-obkbors-17/+46
Get Miri working on ARM - Add a shim for `llvm.arm.hint`, which is required by `core::hint::spin_loop` on `arm` targets. The shim simply calls `yield_active_thread` on a YIELD hint, just like the shim for `llvm.aarch64.isb` that's already present. - Change the signature of `miri_host_to_target_path` to use `c_char` instead of `i8`, to make it compatible with `CStr` on targets where `c_char` is unsigned. The implementation of `miri_host_to_target_path` accesses the memory as bytes and does not need to be adjusted. - Enable ARM targets in CI. Specifically, `aarch64-unknown-linux-gnu` and `arm-unknown-linux-gnueabi` on the Linux host. Since all tests also pass for `aarch64-unknown-linux-gnu` I took the liberty of adding that target to CI as well. Fixes #2791
2023-02-24CI: Move `arm-unknown-linux-gnueabi` tests to Windows hostLevitatingLion-1/+1