about summary refs log tree commit diff
path: root/src/tools/miri/tests
AgeCommit message (Collapse)AuthorLines
2024-12-12Merge from rustcRalf Jung-92/+0
2024-12-12Merge pull request #4069 from shamb0/string_deduplication_for_localtime_rRalf Jung-16/+219
localtime_r: deduplicate timezone name allocation
2024-12-12Improve timezone handling in 'localtime_r()' using 'allocate_bytes()'shamb0-16/+219
Signed-off-by: shamb0 <r.raajey@gmail.com>
2024-12-12solarish stat following-up, supports for readdir.David Carlier-6/+8
2024-12-11Merge pull request #4008 from JoJoDeveloping/tb-access-state-based-skippingRalf Jung-0/+60
[TB Optimization] Skip subtrees based on the subtree's root node's permissions
2024-12-10TB: optimize accesses on large trees by ignoring subtrees if the access ↵Johannes Hostert-6/+6
would mostly be a NOP
2024-12-09Rollup merge of #134055 - RalfJung:interpret-alloc-dedup, r=oli-obkLeón Orell Valerian Liehr-92/+0
interpret: clean up deduplicating allocation functions The "align" and "kind" arguments would be largely ignored in the "dedup" case, so let's move that to entirely separate function. Let's also remove support for old-style miri_resolve_frame while we are at it. The docs have already said for a while that this must be set to 1.
2024-12-09interpret: clean up deduplicating allocation functionsRalf Jung-92/+0
2024-12-07add weak memory consistency test for mixing SC accesses and fencesRalf Jung-0/+30
2024-12-07fmtThe Miri Cronjob Bot-9/+3
2024-12-07Merge from rustcThe Miri Cronjob Bot-29/+319
2024-12-06remove a no-longer-needed work-aroundRalf Jung-6/+2
2024-12-06add testRalf Jung-1/+41
2024-12-06Auto merge of #133089 - eholk:stabilize-noop-waker, r=dtolnaybors-10/+4
Stabilize noop_waker Tracking Issue: #98286 This is a handy feature that's been used widely in tests and example async code and it'd be nice to make it available to users. cc `@rust-lang/wg-async`
2024-12-06Rollup merge of #133211 - Strophox:miri-correct-state-update-ffi, r=RalfJungMatthias Krüger-19/+315
Extend Miri to correctly pass mutable pointers through FFI Based off of https://github.com/rust-lang/rust/pull/129684, this PR further extends Miri to execute native calls that make use of pointers to *mutable* memory. We adapt Miri's bookkeeping of internal state upon any FFI call that gives external code permission to mutate memory. Native code may now possibly write and therefore initialize and change the pointer provenance of bytes it has access to: Such memory is assumed to be *initialized* afterwards and bytes are given *arbitrary (wildcard) provenance*. This enables programs that correctly use mutating FFI calls to run Miri without errors, at the cost of possibly missing Undefined Behaviour caused by incorrect usage of mutating FFI. > <details> > > <summary> Simple example </summary> > > ```rust > extern "C" { > fn init_int(ptr: *mut i32); > } > > fn main() { > let mut x = std::mem::MaybeUninit::<i32>::uninit(); > let x = unsafe { > init_int(x.as_mut_ptr()); > x.assume_init() > }; > > println!("C initialized my memory to: {x}"); > } > ``` > ```c > void init_int(int *ptr) { > *ptr = 42; > } > ``` > should now show `C initialized my memory to: 42`. > > </details> r? ``@RalfJung``
2024-12-06Merge pull request #4057 from RalfJung/scfixRalf Jung-117/+87
Fix weak memory emulation to avoid generating behaviors that are forbidden under C++ 20
2024-12-06Merge from rustcThe Miri Cronjob Bot-0/+4
2024-12-05Stabilize noop_wakerEric Holk-10/+4
Co-authored-by: zachs18 <8355914+zachs18@users.noreply.github.com>
2024-12-05extend Miri to correctly pass mutable pointers through FFIStrophox-19/+315
Co-authored-by: Ralf Jung <post@ralfj.de>
2024-12-05make SC fences stronger, to be correct wrt C++20Ralf Jung-117/+87
2024-12-05Rollup merge of #118833 - Urgau:lint_function_pointer_comparisons, r=cjgillotLeón Orell Valerian Liehr-0/+4
Add lint against function pointer comparisons This is kind of a follow-up to https://github.com/rust-lang/rust/pull/117758 where we added a lint against wide pointer comparisons for being ambiguous and unreliable; well function pointer comparisons are also unreliable. We should IMO follow a similar logic and warn people about it. ----- ## `unpredictable_function_pointer_comparisons` *warn-by-default* The `unpredictable_function_pointer_comparisons` lint checks comparison of function pointer as the operands. ### Example ```rust fn foo() {} let a = foo as fn(); let _ = a == foo; ``` ### Explanation Function pointers comparisons do not produce meaningful result since they are never guaranteed to be unique and could vary between different code generation units. Furthermore different function could have the same address after being merged together. ---- This PR also uplift the very similar `clippy::fn_address_comparisons` lint, which only linted on if one of the operand was an `ty::FnDef` while this PR lints proposes to lint on all `ty::FnPtr` and `ty::FnDef`. ```@rustbot``` labels +I-lang-nominated ~~Edit: Blocked on https://github.com/rust-lang/libs-team/issues/323 being accepted and it's follow-up pr~~
2024-12-04add test to demonstrate the effect of #4008Johannes Hostert-0/+60
2024-12-04implement simd_relaxed_fmaRalf Jung-30/+83
2024-12-04fmtThe Miri Cronjob Bot-1/+5
2024-12-04Merge from rustcThe Miri Cronjob Bot-17/+54
2024-12-04Auto merge of #133818 - matthiaskrgr:rollup-iav1wq7, r=matthiaskrgrbors-5/+45
Rollup of 7 pull requests Successful merges: - #132937 (a release operation synchronizes with an acquire operation) - #133681 (improve TagEncoding::Niche docs, sanity check, and UB checks) - #133726 (Add `core::arch::breakpoint` and test) - #133768 (Remove `generic_associated_types_extended` feature gate) - #133811 ([AIX] change AIX default codemodel=large) - #133812 (Update wasm-component-ld to 0.5.11) - #133813 (compiletest: explain that UI tests are expected not to compile by default) r? `@ghost` `@rustbot` modify labels: rollup
2024-12-03Rollup merge of #133726 - joshtriplett:breakpoint, r=oli-obkMatthias Krüger-5/+3
Add `core::arch::breakpoint` and test Approved in [ACP 491](https://github.com/rust-lang/libs-team/issues/491).
2024-12-03Rollup merge of #133681 - RalfJung:niches, r=wesleywiserMatthias Krüger-0/+42
improve TagEncoding::Niche docs, sanity check, and UB checks Turns out the `niche_variants` range can actually contain the `untagged_variant`. We should report this as UB in Miri, so this PR implements that. Also rename `partially_check_layout` to `layout_sanity_check` for better consistency with how similar functions are called in other parts of the compiler. Turns out my adjustments to the transmutation logic also fix https://github.com/rust-lang/rust/issues/126267.
2024-12-03Rollup merge of #132612 - compiler-errors:async-trait-bounds, r=lcnrMatthias Krüger-2/+2
Gate async fn trait bound modifier on `async_trait_bounds` This PR moves `async Fn()` trait bounds into a new feature gate: `feature(async_trait_bounds)`. The general vibe is that we will most likely stabilize the `feature(async_closure)` *without* the `async Fn()` trait bound modifier, so we need to gate that separately. We're trying to work on the general vision of `async` trait bound modifier general in: https://github.com/rust-lang/rfcs/pull/3710, however that RFC still needs more time for consensus to converge, and we've decided that the value that users get from calling the bound `async Fn()` is *not really* worth blocking landing async closures in general.
2024-12-03miri: Adapt for `breakpoint` becoming safeJosh Triplett-5/+3
2024-12-02Use c"lit" for CStrings without unwrapKornel-10/+7
2024-12-02Allow fn pointers comparisons lint in UI testsUrgau-0/+4
2024-12-02Gate async fn trait bound modifier on async_trait_boundsMichael Goulet-2/+2
2024-11-30improve TagEncoding::Niche docs and sanity checkRalf Jung-0/+42
2024-11-28Merge from rustcThe Miri Cronjob Bot-0/+18
2024-11-26Merge pull request #4031 from devnexen/solarish_statRalf Jung-2/+5
filesystem support for solarish: stat
2024-11-26filesystem support for solarish.David Carlier-2/+5
close #3890
2024-11-26Merge pull request #4059 from tiif/fixtestOli Scherer-49/+18
Simplify thread blocking tests
2024-11-26Simplify thread blocking teststiif-49/+18
2024-11-25Fix the rest of the testsYoh Deadfall-6/+3
2024-11-25Fixed test targetYoh Deadfall-2/+1
Co-authored-by: Ralf Jung <post@ralfj.de>
2024-11-25Added epoll and eventfd for AndroidYoh Deadfall-0/+4
2024-11-25miri: implement `TlsFree`joboet-0/+18
If the variable does not need a destructor, `std` uses racy initialization for creating TLS keys on Windows. With just the right timing, this can lead to `TlsFree` being called. Unfortunately, with #132654 this is hit quite often, so miri should definitely support `TlsFree` ([documentation](https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-tlsfree)). I'm filing this here instead of in the miri repo so that #132654 isn't blocked for so long.
2024-11-24sysconf: add _SC_OPEN_MAXDavid Carlier-0/+2
2024-11-24follow-up on #4052, making a miri evaluation context fn for strerror_r.David Carlier-0/+16
2024-11-23Merge pull request #4052 from devnexen/gh4050Ralf Jung-0/+17
sysconf interception fix for solarish systems.
2024-11-23sysconf interception fix for solarish systems.David Carlier-0/+17
also adding the `_SC_PAGESIZE` alias `_SC_PAGE_SIZE` supported by Linux, macOS and FreeBSD. close #4050
2024-11-22epoll: fix comment typoRalf Jung-1/+1
2024-11-21eventfd: comment tweaksRalf Jung-2/+2
2024-11-20Merge pull request #4026 from eduardosm/soft-sqrtRalf Jung-2/+12
miri: implement square root without relying on host floats