about summary refs log tree commit diff
path: root/src/tools/miri
AgeCommit message (Collapse)AuthorLines
2024-07-07add miri tests and a fixmeMaybe Waffle-0/+108
2024-07-07Stacked Borrows: fix PartialEq for StackRalf Jung-2/+10
We have to compare unknown_bottom as well, it is semantically relevant!
2024-07-06offset_from intrinsic: always allow pointers to point to the same addressRalf Jung-3/+0
2024-07-06Auto merge of #3698 - folkertdev:sched-setaffinity, r=RalfJungbors-37/+507
implement `libc::sched_setaffinity` on linux fixes https://github.com/rust-lang/miri/issues/2749 the implementation, like `libc::sched_getaffinity`, just always returns `EINVAL`, which kind of simulates a device with zero cpus. I believe the idea is that callers of this function always do it to optimize, so they are likely to gracefully recover from this function returning an error. based on the libc crate, these functions are also available on android and freebsd (but not on macos or windows). So should the implementation of the `sched_*` functions just be copied to the android and freebsd shims?
2024-07-06Mark format! with must_use hintlukas-8/+8
2024-07-06`sched_setaffinity`: adjust test on BE systemsFolkert-2/+7
2024-07-06`sched_setaffinity`: test `cpusetsize == 0`Folkert-1/+22
2024-07-06lookup c_ulong instead of hard-coding the chunk sizeRalf Jung-57/+58
2024-07-06Merge from rustcThe Miri Cronjob Bot-0/+16
2024-07-06Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2024-07-05implement `libc::sched_getaffinity` and `libc::sched_setaffinity`Folkert-14/+457
2024-07-05Rollup merge of #127214 - bjorn3:miri_native_unwind, r=oli-obkGuillaume Gomez-0/+16
Use the native unwind function in miri where possible Continuation of https://github.com/rust-lang/miri/pull/3319 cc `@RalfJung`
2024-07-05Merge from rustcThe Miri Cronjob Bot-2/+4
2024-07-05Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2024-07-04Auto merge of #123781 - RalfJung:miri-fn-identity, r=oli-obkbors-2/+4
Miri function identity hack: account for possible inlining Having a non-lifetime generic is not the only reason a function can be duplicated. Another possibility is that the function may be eligible for cross-crate inlining. So also take into account the inlining attribute in this Miri hack for function pointer identity. That said, `cross_crate_inlinable` will still sometimes return true even for `inline(never)` functions: - when they are `DefKind::Ctor(..) | DefKind::Closure` -- I assume those cannot be `InlineAttr::Never` anyway? - when `cross_crate_inline_threshold == InliningThreshold::Always` so maybe this is still not quite the right criterion to use for function pointer identity.
2024-07-04Auto merge of #3702 - Mandragorian:multiple_targets, r=RalfJungbors-11/+61
Run tests for all specified targets Currently cargo-miri uses the first target specified in the command line. However, when multiple targets are specified in a `cargo build` invocation, cargo will build for all of them. Miri should match this behaviour to reduce surprises. Fixes: #3460
2024-07-04Add casting tests for `f16` and `f128`Trevor Gross-2/+68
2024-07-04Refactor float casting testsTrevor Gross-186/+390
This is an attempt to remove the magic from a lot of the numbers tested, which should make things easier when it is time to add `f16` and `f128`. A nice side effect is that these tests now cover all int <-> float conversions with the same amount of tests. Co-authored-by: Ralf Jung <post@ralfj.de>
2024-07-04Run tests for all specified targetsKonstantinos Andrikopoulos-11/+61
Currently cargo-miri uses the first target specified in the command line. However, when multiple targets are specified in a `cargo build` invocation, cargo will build for all of them. Miri should match this behaviour to reduce surprises. Fixes: #3460
2024-07-04Auto merge of #3732 - JoJoDeveloping:tree-borrows-protector-end-write, ↵bors-36/+100
r=RalfJung TB: Refine protector end semantics Tree Borrows has protector end tag semantics, namely that protectors ending cause a [special implicit read](https://perso.crans.org/vanille/treebor/diff.0.html) on all locations protected by that protector that have actually been accessed. See also #3067. While this is enough for ensuring protectors allow adding/reordering reads, it does not prove that one can reorder writes. For this, we need to make this stronger, by making this implicit read be a write in cases when there was a write to the location protected by that protector, i.e. if the permission is `Active`. There is a test that shows why this behavior is necessary, see `tests/fail/tree_borrows/protector-write-lazy.rs`.
2024-07-04TB: protector end semantics never causes immediate UBJohannes Hostert-2/+5
2024-07-04Add UI test for protector end write semanticsJohannes Hostert-0/+62
2024-07-04TB: Make FnEntry access on protected locations be a write under certain ↵Johannes Hostert-36/+35
circumstances
2024-07-04Merge from rustcThe Miri Cronjob Bot-10/+19
2024-07-04Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2024-07-03Auto merge of #125507 - compiler-errors:type-length-limit, r=lcnrbors-1/+1
Re-implement a type-size based limit r? lcnr This PR reintroduces the type length limit added in #37789, which was accidentally made practically useless by the caching changes to `Ty::walk` in #72412, which caused the `walk` function to no longer walk over identical elements. Hitting this length limit is not fatal unless we are in codegen -- so it shouldn't affect passes like the mir inliner which creates potentially very large types (which we observed, for example, when the new trait solver compiles `itertools` in `--release` mode). This also increases the type length limit from `1048576 == 2 ** 20` to `2 ** 24`, which covers all of the code that can be reached with craterbot-check. Individual crates can increase the length limit further if desired. Perf regression is mild and I think we should accept it -- reinstating this limit is important for the new trait solver and to make sure we don't accidentally hit more type-size related regressions in the future. Fixes #125460
2024-07-03Auto merge of #3726 - TDecking:vzero, r=RalfJungbors-0/+16
Implement the `_mm256_zeroupper` and `_mm256_zeroall` intrinsics These two intrinsics were missing from the original implementation of the AVX intrinsics. Fortunately their implementation is trivial.
2024-07-03Implement the `_mm256_zeroupper` and `_mm256_zeroall` intrinsicsTobias Decking-0/+16
2024-07-02Instance::resolve -> Instance::try_resolve, and other nitsMichael Goulet-1/+1
2024-07-02Miri function identity hack: account for possible inliningRalf Jung-2/+4
2024-07-02Auto merge of #3707 - adwinwhite:dup, r=RalfJungbors-8/+72
Add syscall `dup()` for unix target Add support for `dup()` and `dup2()`. Fixes #3454
2024-07-02use let-else to avoid rightwards driftRalf Jung-24/+21
2024-07-02Auto merge of #3724 - bjorn3:use_symbol_name_query, r=RalfJungbors-26/+3
Use the symbol_name query instead of trying to infer from the link_name attribute This prevents the calculated name from going out of sync with exported_symbols. It also avoids having to special case the panic_impl lang item. It also makes it easier to fix miri with https://github.com/rust-lang/rust/pull/127173.
2024-07-02Allow _Unwind_RaiseException with MinGWbjorn3-0/+16
2024-07-02Preparing for merge from rustcRalf Jung-1/+1
2024-07-01Use the symbol_name query instead of trying to infer from the link_name ↵bjorn3-26/+3
attribute This prevents the calculated name from going out of sync with exported_symbols. It also avoids having to special case the panic_impl lang item.
2024-07-01add syscall `dup()`Adwin White-0/+67
2024-06-29Fix FnMut/Fn shim for coroutine-closures that capture referencesMichael Goulet-9/+18
2024-06-29iter_exported_symbols: also walk used statics in local crateRalf Jung-8/+43
2024-06-29Merge from rustcThe Miri Cronjob Bot-17/+0
2024-06-29Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2024-06-28Revert "Rollup merge of #126938 - RalfJung:link_section, r=compiler-errors"Rémy Rakic-17/+0
This reverts commit 5c4ede88c61e746ed5c852d7a7e38ab1a824ae52, reversing changes made to 95332b89187bb6a0c910574cfeff1933b619565a.
2024-06-28Auto merge of #3718 - RalfJung:readme, r=oli-obkbors-4/+6
readme: tweak wording around soundness Miri *can* tell you whether your code is sound when it finds UB -- it's not sound in that case. It can give negative answers, just not positive ones.
2024-06-28readme: tweak wording around soundnessRalf Jung-4/+6
2024-06-28Auto merge of #3717 - rust-lang:rustup-2024-06-28, r=oli-obkbors-7/+4
Automatic Rustup
2024-06-28Bless clippyOli Scherer-6/+3
2024-06-28Auto merge of #3715 - cgettys-microsoft:dev/cgettys/process_id_fixup-01, ↵bors-1/+1
r=RalfJung Fix miri.bat to not exit unconditionally #3703 has a small typo causing it to regress ./miri.bat to not working at all. This PR fixes it. Tested on Windows 11, with stable toolchain missing as well as installed. ```test ./miri toolchain error: toolchain 'stable-x86_64-pc-windows-msvc' is not installed Failed to build miri-script. Is the 'stable' toolchain installed? ``` Closes #3714
2024-06-28Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2024-06-27Switch to the explicit parens versionCharlie Gettys-1/+1
2024-06-27Relocate GetCurrentProcessId to Environment Related shims, remove ↵Charlie Gettys-5/+5
unnecessary std frame restriction