Commit Graph

3066 Commits

Author SHA1 Message Date
Ralf Jung
12e3f75fd4 don't make it qutie so easy to get Miri to panic 2022-08-08 11:32:31 -04:00
bors
654e15b51c Auto merge of #2471 - RalfJung:term, r=RalfJung
stop excluding TERM env var on Unix

Effectively reverts https://github.com/rust-lang/miri/pull/2018.
Needs https://github.com/rust-lang/rust/pull/100206 to not be terribly slow.
Fixes https://github.com/rust-lang/miri/issues/2292.
2022-08-08 00:38:17 +00:00
Ralf Jung
b36b5e38b7 fix rustc lints in Miri 2022-08-07 10:17:02 -04:00
bors
aa53f3f77f Auto merge of #2472 - RalfJung:backtrace, r=RalfJung
fix RUSTC_BACKTRACE always being set

I kept wondering why Miri programs, whenever isolation is disabled, behave as if RUSTC_BACKTRACE was set. Finally I realized it's because some early rustc setup code sets that env var, and that is then propagated to the interpreted program.

So fix that by taking a copy of the environment before any rustc setup, and use that copy as the basis for what is provided to the interpreted program.
2022-08-06 19:30:50 +00:00
Ralf Jung
d2ba40e9e1 make tests pass again 2022-08-06 15:29:43 -04:00
Ralf Jung
76d99c37c9 fix RUSTC_BACKTRACE always being set 2022-08-06 15:21:08 -04:00
Ralf Jung
79d147edb7 make home_dir work on macOS 2022-08-06 14:38:17 -04:00
Ralf Jung
f8449c2c78 stop excluding TERM env var on Unix 2022-08-06 14:31:26 -04:00
Ralf Jung
61be3bae40 support current_exe on macOS, and fix write_os_str length logic 2022-08-06 12:40:34 -04:00
bors
f633537f3e Auto merge of #2469 - RalfJung:math, r=RalfJung
implement some missing float functions

With this we support the entire float API surface of the standard library. :)

Also fixes https://github.com/rust-lang/miri/issues/2468 by using host floats to implement FMA.
2022-08-06 15:01:44 +00:00
Ralf Jung
b1316eca92 support and test some more math functions 2022-08-06 11:01:19 -04:00
Ralf Jung
5a4ac1ebf0 work around apfloat bug in FMA by using host floats instead 2022-08-06 11:01:19 -04:00
Ralf Jung
889c073aa6 really, clippy?!? 2022-08-06 09:03:33 -04:00
Ralf Jung
d61e55a1d4 add support for env::home_dir
and a bit of cleanup
2022-08-06 08:29:00 -04:00
bors
42087647d6 Auto merge of #2466 - RalfJung:longsleep, r=RalfJung
fix an ICE in nanosleep()
2022-08-06 00:52:42 +00:00
Ralf Jung
d7875ea530 fix an ICE in nanosleep() 2022-08-05 20:44:54 -04:00
Ralf Jung
6d14a5e2a7 avoid strerror_r failure on unknown errnum 2022-08-05 20:18:37 -04:00
Ralf Jung
e1e1f42f39 make errno table syntactically more similar to rustc library code 2022-08-03 11:51:39 -04:00
Christian Legnitto
9154f8b22c Add additional raw error mappings for the nightly io_error_more feature
Some crates are using nightly and failing when mapping these errors,
for example <https://miri.saethlin.dev/?crate=remove_dir_all&version=0.7.0>:

```
error: unsupported operation: io error NotADirectory cannot be translated into a raw os error
    --> /root/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/sys/unix/fs.rs:1203:19
```
2022-08-03 11:23:15 -04:00
Christian Legnitto
b29e7b8e4e Add mkstemp shim for unix
Co-authored-by: Ralf Jung <post@ralfj.de>
2022-08-02 19:56:05 -04:00
Ralf Jung
8356f4cc23 output realpath as a path, and remove a bogus test 2022-08-02 18:08:43 -04:00
Christian Legnitto
b43bede938 Add shim for realpath on unix 2022-08-02 17:27:11 -04:00
Ralf Jung
9ffea913b8 clippy 2022-08-01 09:27:56 -04:00
Hiroki6
66f6fa68fa Fix typo in eval.rs 2022-07-31 16:15:11 +02:00
Oli Scherer
cd6b723bb6 Add default impls for FileDescriptor methods 2022-07-25 17:57:56 +00:00
bors
6227e1e3a8 Auto merge of #2422 - RalfJung:integers, r=oli-obk
enable clippy lints against integer casts

Cc https://github.com/rust-lang/miri/issues/1236
2022-07-25 11:46:55 +00:00
bors
3d237be15c Auto merge of #2436 - RalfJung:lib-crates, r=oli-obk
fix build.rs invoking RUSTC to do check builds

This makes the Miri driver, when invokved via the RUSTC env var from inside a build script, behave almost entirely like rustc. I had to redo how we propagate sysroot information for this (which is actually back to how we used to do sysroot propagation many years ago).

Fixes https://github.com/rust-lang/miri/issues/2431
2022-07-25 10:39:02 +00:00
Ralf Jung
cbff63a694 rustup 2022-07-24 17:51:39 -04:00
Ralf Jung
d905901d65 make miri a better RUSTC by default inside cargo-miri
this requires a change in sysroot handling: miri driver now requires
MIRI_SYSROOT to be set when it is in 'target' mode, rather than relying on
`--sysroot` always being present.
2022-07-24 13:30:32 -04:00
bors
62efc6201b Auto merge of #2427 - Nilstrieb:doc-fix, r=saethlin
Fix outdated docs in sb stack cache

Since `Item` is bitpacked now, the full `Item` is stored in the cache.
2022-07-23 23:21:26 +00:00
Nilstrieb
8b643809cc Fix outdated docs in sb stack cache
Since `Item` is bitpacked now, the full `Item` is stored in the cache.
2022-07-24 00:35:02 +02:00
Ralf Jung
b08e51d79a refactor away some 'else { None }' 2022-07-23 12:30:48 -04:00
Ralf Jung
649b216482 add a flag to print a diagnostic when an outdated value is returned from an atomic load 2022-07-23 09:39:02 -04:00
Ralf Jung
7f6034862d pass clippy::cast_possible_truncation 2022-07-23 09:14:13 -04:00
Ralf Jung
b67a6ff099 pass clippy::cast_sign_loss and clippy::cast_possible_wrap 2022-07-23 09:13:38 -04:00
Ralf Jung
3f0fdf290f pass clippy::cast_lossless 2022-07-23 09:13:38 -04:00
Ralf Jung
a6b35412d8 adjust for symbolic vtables 2022-07-22 07:18:34 -04:00
Ralf Jung
7cd1d78a47 only complain about runtime toolchain mismatch when there actually is a runtime toolchain 2022-07-21 09:30:09 -04:00
Ralf Jung
9f99d10689 some stray tag → prov renames 2022-07-20 18:32:03 -04:00
Ralf Jung
e649a9acfb check for extern static size mismatches 2022-07-20 18:32:03 -04:00
Ralf Jung
59f9a918ed handle get_alloc_extra the same throughout Stacked Borrows 2022-07-20 17:57:31 -04:00
Ralf Jung
ff4666f39c rustup 2022-07-20 16:02:06 -04:00
bors
ebda1deb7b Auto merge of #2397 - RalfJung:cleanup, r=RalfJung
only do env var cleanup if all threads have stopped

Hopefully fixes https://github.com/rust-lang/miri/issues/2396
2022-07-20 02:12:09 +00:00
Ralf Jung
5fbf036670 only do env var cleanup if all threads have stopped 2022-07-19 21:44:45 -04:00
Ben Kimock
4268918a50 Clarify implementation a bit 2022-07-19 20:53:48 -04:00
Ben Kimock
db93abe823 Fix bugs where unique_range became invalid
And also expand the cache integrity checks to cover this case, and
generally assert a lot more about the unique_range, then tighten up
sloppy implementation scenarios that this uncovered.
2022-07-19 20:02:20 -04:00
Ralf Jung
5721927afe rustup 2022-07-19 15:44:47 -04:00
bors
e8095d0af4 Auto merge of #2390 - RalfJung:debug, r=RalfJung
fix some debugging papercuts

- detect when Miri got locally installed and is being run with the wrong toolchain
- when an ICE occurs, print a backtrace of where the interpreter was at the time
2022-07-19 18:15:05 +00:00
Ralf Jung
5cf7ed1e04 show where the interpreter was interpreting when an ICE occurs 2022-07-19 14:14:20 -04:00
Ralf Jung
9dba78a76b show a better error when running Miri with the wrong sysroot 2022-07-19 14:14:20 -04:00