about summary refs log tree commit diff
path: root/src/tools/miri
AgeCommit message (Collapse)AuthorLines
2025-07-07Rollup merge of #143528 - RalfJung:stack-pop-cleanup, r=oli-obk许杰友 Jieyou Xu (Joe)-16/+16
interpret: rename StackPopCleanup The name `StackPopCleanup` stopped making sense a long time ago IMO -- in the common case, it has nothing to do with "cleanup", and everything with where the program should jump next. If we didn't have unwinding this would be just the return block, but given that we do have unwinding I figured maybe "continuation" would be a good name. This comes up in [continuation-passing style](https://en.wikipedia.org/wiki/Continuation-passing_style) and refers to where the program will *continue* when a function is done. So from a PL perspective it is the most fitting term I think -- but it may be too jargony. r? `@oli-obk` what do you think?
2025-07-06Auto merge of #141829 - dvdsk:sleep_until_linux, r=cuviper,RalfJungbors-0/+192
Specialize sleep_until implementation for unix (except mac) related tracking issue: https://github.com/rust-lang/rust/issues/113752 Supersedes https://github.com/rust-lang/rust/pull/118480 for the reasons see: https://github.com/rust-lang/rust/issues/113752#issuecomment-2902594469 Replaces the generic catch all implementation with target_os specific ones for: linux/netbsd/freebsd/android/solaris/illumos etc. Other platforms like wasi, macos/ios/tvos/watchos and windows will follow in later separate PR's (once this is merged).
2025-07-06sleep_until: add clock_nanosleep support to Miridvdsk-0/+192
The clock_nanosleep support is there to allow code using `sleep_until` to run under Miri. Therefore the implementation is minimal. - Only the clocks REALTIME and MONOTONIC are supported. The first is supported simply because it was trivial to add not because it was needed for sleep_until. - The only supported flag combinations are no flags or TIMER_ABSTIME only. If an unsupported flag combination or clock is passed in this throws unsupported.
2025-07-06interpret: rename StackPopCleanupRalf Jung-16/+16
2025-07-05fmtRalf Jung-1/+3
2025-07-05Merge from rustcRalf Jung-13/+8
2025-07-05Preparing for merge from rustcRalf Jung-1/+1
2025-07-04Rollup merge of #143387 - dpaoliello:shouldpanicfn, r=bjorn3Matthias Krüger-13/+8
Make __rust_alloc_error_handler_should_panic a function Fixes rust-lang/rust#143253 `__rust_alloc_error_handler_should_panic` is a static but was being exported as a function. For most targets this doesn't matter, but Arm64EC Windows uses different decorations for exported variables vs functions, hence it fails to link when `-Z oom=abort` is enabled. We've had issues in the past with statics like this (see rust-lang/rust#141061) but the tldr; is that Arm64EC needs symbols correctly exported as either a function or data, and data MUST and MUST ONLY be marked `dllimport` when the symbol is being imported from another binary, which is non-trivial to calculate for these compiler-generated statics. So, instead, the easiest thing to do is to make `__rust_alloc_error_handler_should_panic` a function instead. Since `__rust_alloc_error_handler_should_panic` isn't involved in any linking shenanigans, I've marked it as `AlwaysInline` with the hopes that the various backends will see that it is just returning a constant and perform the same optimizations as the previous implementation. r? `@bjorn3`
2025-07-04declare data race and weak memory support as non-experimentalRalf Jung-2/+2
2025-07-04Merge from rustcThe Miri Cronjob Bot-1/+1
2025-07-04Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2025-07-03Make __rust_alloc_error_handler_should_panic a functionDaniel Paoliello-13/+8
2025-07-03nanosleep: fix argument name and add a missing argument readRalf Jung-9/+6
2025-07-03Rollup merge of #134006 - klensy:typos, r=nnethercoteJana Dönszelmann-1/+1
setup typos check in CI This allows to check typos in CI, currently for compiler only (to reduce commit size with fixes). With current setup, exclude list is quite short, so it worth trying? Also includes commits with actual typo fixes. MCP: https://github.com/rust-lang/compiler-team/issues/817 typos check currently turned for: * ./compiler * ./library * ./src/bootstrap * ./src/librustdoc After merging, PRs which enables checks for other crates (tools) can be implemented too. Found typos will **not break** other jobs immediately: (tests, building compiler for perf run). Job will be marked as red on completion in ~ 20 secs, so you will not forget to fix it whenever you want, before merging pr. Check typos: `python x.py test tidy --extra-checks=spellcheck` Apply typo fixes: `python x.py test tidy --extra-checks=spellcheck:fix` (in case if there only 1 suggestion of each typo) Current fail in this pr is expected and shows how typo errors emitted. Commit with error will be removed after r+.
2025-07-03Merge from rustcRalf Jung-80/+65
2025-07-03Preparing for merge from rustcRalf Jung-1/+1
2025-07-03setup CI and tidy to use typos for spellchecking and fix few typosklensy-1/+1
2025-07-03only set host-specific CC; improve and de-duplicate native libs testing logicRalf Jung-25/+18
2025-07-03Rollup merge of #143327 - RalfJung:miri-type-validity-error, r=oli-obkMatthias Krüger-62/+27
miri: improve errors for type validity assertion failures Miri has pretty nice errors for type validity violations, printing which field in the type the problem occurs at and so on. However, we don't see these errors when using e.g. `mem::zeroed` as that uses `assert_zero_valid` to bail out before Miri can detect the UB. Similar to what we did with `@saethlin's` UB checks, I think we should disable such language UB checks in Miri so that we can get better error messages. If we go for this we should probably say this in the intrinsic docs as well so that people don't think they can rely on these intrinsics catching anything. Furthermore, I slightly changed `MaybeUninit::assume_init` so that the `.value` field does not show up in error messages any more. `@rust-lang/miri` what do you think?
2025-07-02miri: improve errors for type validity assertion failuresRalf Jung-62/+27
2025-07-02use more clever approach for genmc conditional importRalf Jung-12/+3
2025-07-02interpret: move the native call preparation logic into MiriRalf Jung-18/+38
2025-07-02skip env var memory for leak checkRalf Jung-50/+9
2025-07-02Merge pull request #4406 from Stypox/tracingRalf Jung-102/+828
Add tracing_chrome under "tracing" feature
2025-07-02rename show_error -> fatal_errorRalf Jung-34/+34
2025-07-02Add tracing feature to enable tracing_chrome supportStypox-73/+799
2025-07-02Merge from rustcThe Miri Cronjob Bot-133/+6
2025-07-02Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2025-07-02Auto merge of #142974 - cuviper:stage0-bump, r=Mark-Simulacrumbors-22/+2
Update stage0 to 1.89.0-beta.1 - Update version placeholders - Update stage0 to 1.89.0-beta.1 - Update `STAGE0_MISSING_TARGETS` - Update `cfg(bootstrap)` r? `@Mark-Simulacrum` try-job: dist-i586-gnu-i586-i686-musl
2025-07-01Remove support for dyn*Michael Goulet-107/+0
2025-07-01Update `cfg(bootstrap)`Josh Stone-22/+2
2025-07-01Merge pull request #4411 from LorrensP-2158466/remove-leaky-syncobjRalf Jung-184/+148
Remove leaky synchronisation objects.
2025-07-01Remove leaky synchronisation objects.LorrensP-2158466-184/+148
2025-07-01Auto merge of #143013 - bjorn3:split_exported_symbols, r=oli-obkbors-4/+4
Split exported_symbols for generic and non-generic symbols This reduces metadata decoder overhead during the monomorphization collector.
2025-07-01Merge pull request #4433 from RalfJung/ci-balanceRalf Jung-4/+4
re-balance CI jobs
2025-07-01Merge pull request #4432 from RalfJung/no-metadataRalf Jung-5/+0
./miri toolchain: no need to run 'cargo metadata'
2025-07-01re-balance CI jobsRalf Jung-4/+4
2025-07-01./miri toolchain: no need to run 'cargo metadata'Ralf Jung-5/+0
2025-07-01fmtThe Miri Cronjob Bot-2/+0
2025-07-01Merge from rustcThe Miri Cronjob Bot-54/+117
2025-07-01Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2025-06-30Rollup merge of #143140 - RalfJung:ptr-into-parts, r=oli-obkMatthias Krüger-9/+7
give Pointer::into_parts a more scary name and offer a safer alternative `into_parts` is a bit too innocent of a name for a somewhat subtle operation. r? `@oli-obk`
2025-06-30Auto merge of #143233 - dianqk:rollup-lcx3278, r=dianqkbors-44/+109
Rollup of 14 pull requests Successful merges: - rust-lang/rust#142429 (`tests/ui`: A New Order [13/N]) - rust-lang/rust#142514 (Miri: handling of SNaN inputs in `f*::pow` operations) - rust-lang/rust#143066 (Use let chains in the new solver) - rust-lang/rust#143090 (Workaround for memory unsafety in third party DLLs) - rust-lang/rust#143118 (`tests/ui`: A New Order [15/N]) - rust-lang/rust#143159 (Do not freshen `ReError`) - rust-lang/rust#143168 (`tests/ui`: A New Order [16/N]) - rust-lang/rust#143176 (fix typos and improve clarity in documentation) - rust-lang/rust#143187 (Add my work email to mailmap) - rust-lang/rust#143190 (Use the `new` method for `BasicBlockData` and `Statement`) - rust-lang/rust#143195 (`tests/ui`: A New Order [17/N]) - rust-lang/rust#143196 (Port #[link_section] to the new attribute parsing infrastructure) - rust-lang/rust#143199 (Re-disable `tests/run-make/short-ice` on Windows MSVC again) - rust-lang/rust#143219 (Show auto trait and blanket impls for `!`) r? `@ghost` `@rustbot` modify labels: rollup
2025-06-30Rollup merge of #142514 - LorrensP-2158466:miri-float-nondet-pow, r=RalfJungdianqk-44/+109
Miri: handling of SNaN inputs in `f*::pow` operations fixes [miri/#4286](https://github.com/rust-lang/miri/issues/4286) and related to rust-lang/rust#138062 and [miri/#4208](https://github.com/rust-lang/miri/issues/4208#issue-2879058184). For the following cases of the powf or powi operations, Miri returns either `1.0` or an arbitrary `NaN`: - `powf(SNaN, 0.0)` - `powf(1.0, SNaN)` - `powi(SNaN, 0)` Also added a macro in `miri/tests/pass/float.rs` which conveniently checks if both are indeed returned from such an operation. Made these changes in the rust repo so I could test against stdlib, since these were impacted some time ago and were fixed in rust-lang/rust#138062. Tested with: ```fish env MIRIFLAGS=-Zmiri-many-seeds ./x miri --no-fail-fast std core coretests -- f32 f64 ``` This was successful. This does take a while, so I recommend using `--no-doc` and separate use of `f32` or `f64` The pr is somewhat split up into 3 main commits, which implement the cases described above. The first commit also introduces the macro, and the last commit is just a global refactor of some things. r? `@RalfJung`
2025-06-30Try increasing the repetition limitOli Scherer-1/+1
2025-06-30linux futex: fix for val > i32::MAXRalf Jung-3/+9
2025-06-29Merge pull request #4397 from tgross35/gettid-shimsRalf Jung-12/+312
Add shims for `gettid`-esque functions
2025-06-29Add shims for `gettid`-esque functionsTrevor Gross-12/+312
Various platforms provide a function to return the current OS thread ID, but they all use a slightly different name. Add shims for these functions for Apple, FreeBSD, and Windows, with tests to account for those and a few more platforms that are not yet supported by Miri. The syscall and extern symbol is included as well on Linux. These should be useful in general but will also help support printing the OS thread ID in panic messages [1]. [1]: https://github.com/rust-lang/rust/pull/115746 Squashed commit from Ralf: try_from_scalar: extend comment
2025-06-29add a riscv64 test jobRalf Jung-0/+5
2025-06-29remove duplicate clippy checkRalf Jung-4/+2