]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoUse a 'flags' parameter instead of 'version'
Aaron Hill [Thu, 24 Sep 2020 18:18:47 +0000 (14:18 -0400)]
Use a 'flags' parameter instead of 'version'

3 years agoNormalize line and column numbers from the sysroot
Aaron Hill [Tue, 22 Sep 2020 14:58:18 +0000 (10:58 -0400)]
Normalize line and column numbers from the sysroot

3 years agoAdd API for capturing backtrace
Aaron Hill [Tue, 3 Dec 2019 02:15:58 +0000 (21:15 -0500)]
Add API for capturing backtrace

This PR adds two new Miri-defined extern functions:
`miri_get_backtrace` and `miri_resolve_frame`, which are documented in
the README. Together, they allow obtaining a backtrace for the currently
executing program.

I've added a test showing how these APIs are used. I've also prepared a
companion PR `backtrace-rs`, which will allow
`backtrace::Backtrace::new()` to work automatically under Miri.

Once these two PRs are merged, we will be able to print backtraces from
the normal Rust panic hook (since libstd is now using backtrace-rs).

A few notes:
* Resolving the backtrace frames is *very* slow - you can actually see
  each line being printed out one at a time. Some local testing showed
  that this is not (primrary) caused by resolving a `Span` - it seems
  to be just Miri being slow.
* For the first time, we now interact directly with a user-defined
  struct (instead of just executing the user-provided MIR that
  manipulates the struct). To allow for future changes, I've added
  a 'version' parameter (currently required to be 0). This should allow
  us to change the `MiriFrame` struct should the need ever arise.
* I used the approach suggested by @oli-obk - a returned backtrace
  pointer consists of a base function allocation, with the 'offset'
  used to encode the `Span.lo`. This allows losslessly reconstructing
  the location information in `miri_resolve_frame`.
* There are a few quirks on the `backtrace-rs` side:
  * `backtrace-rs` calls `getcwd()` by default to try to simplify
    the filename. This results in an isolation error by default,
    which could be annoying when printing a backtrace from libstd.
  * `backtrace-rs` tries to remove 'internal' frames (everything between
     the call to `Backtrace::new()` and the internal API call made by
     backtrace-rs) by comparing the returned frame pointer value to
     a Rust function pointer. This doesn't work due to the way we
     construct the frame pointers passed to the caller. We could
     attempt to support this kind of comparison, or just add a
    `#[cfg(miri)]` and ignore the frames ourselves.

3 years agoAuto merge of #1555 - lzutao:upstream-assume-const, r=RalfJung
bors [Sun, 27 Sep 2020 08:31:09 +0000 (08:31 +0000)]
Auto merge of #1555 - lzutao:upstream-assume-const, r=RalfJung

Remove assume intrinsic from EvalContextExt

Waiting for https://github.com/rust-lang/rust/pull/76973 merged.

3 years agoRemove assume intrinsic from EvalContextExt
Lzu Tao [Sun, 27 Sep 2020 03:00:06 +0000 (10:00 +0700)]
Remove assume intrinsic from EvalContextExt

It has been moved to rustc_mir.

3 years agoAuto merge of #1561 - RalfJung:rustup, r=RalfJung
bors [Thu, 24 Sep 2020 07:19:39 +0000 (07:19 +0000)]
Auto merge of #1561 - RalfJung:rustup, r=RalfJung

rustup; fix tests

3 years agorustup; fix tests
Ralf Jung [Thu, 24 Sep 2020 07:19:03 +0000 (09:19 +0200)]
rustup; fix tests

3 years agoAuto merge of #1560 - RalfJung:rustup, r=RalfJung
bors [Wed, 23 Sep 2020 20:13:59 +0000 (20:13 +0000)]
Auto merge of #1560 - RalfJung:rustup, r=RalfJung

opt-level 3 is clean again :)

3 years agoopt-level 3 is clean again :)
Ralf Jung [Wed, 23 Sep 2020 20:13:13 +0000 (22:13 +0200)]
opt-level 3 is clean again :)

3 years agoAuto merge of #1558 - RalfJung:serde_derive, r=RalfJung
bors [Mon, 21 Sep 2020 13:48:15 +0000 (13:48 +0000)]
Auto merge of #1558 - RalfJung:serde_derive, r=RalfJung

test formerly broken serde_derive dependency

Adds a test for the issue fixed in https://github.com/rust-lang/miri/pull/1557

3 years agotest formerly broken serde_derive dependency
Ralf Jung [Mon, 21 Sep 2020 13:47:09 +0000 (15:47 +0200)]
test formerly broken serde_derive dependency

3 years agoAuto merge of #1557 - RalfJung:cargo-miri, r=RalfJung
bors [Mon, 21 Sep 2020 10:47:26 +0000 (10:47 +0000)]
Auto merge of #1557 - RalfJung:cargo-miri, r=RalfJung

support non-rlib extern files

This came up in https://github.com/hsivonen/encoding_rs/pull/57.

3 years agosupport non-rlib extern files
Ralf Jung [Mon, 21 Sep 2020 10:46:18 +0000 (12:46 +0200)]
support non-rlib extern files

3 years agoAuto merge of #1556 - RalfJung:compat, r=RalfJung
bors [Mon, 21 Sep 2020 07:11:37 +0000 (07:11 +0000)]
Auto merge of #1556 - RalfJung:compat, r=RalfJung

also support old 'cargo miri run -- -- args' style

I forgot this in https://github.com/rust-lang/miri/pull/1540. Again this is just temporary, for backwards compatibility.

3 years agoalso support old 'cargo miri run -- -- args' style
Ralf Jung [Mon, 21 Sep 2020 07:10:04 +0000 (09:10 +0200)]
also support old 'cargo miri run -- -- args' style

3 years agoAuto merge of #1554 - RalfJung:rustup, r=RalfJung
bors [Sun, 20 Sep 2020 13:56:59 +0000 (13:56 +0000)]
Auto merge of #1554 - RalfJung:rustup, r=RalfJung

rustup; support panic=abort on Windows

Fixes https://github.com/rust-lang/miri/issues/1058

3 years agorustup; support panic=abort on Windows
Ralf Jung [Sun, 20 Sep 2020 13:55:36 +0000 (15:55 +0200)]
rustup; support panic=abort on Windows

3 years agoAuto merge of #1553 - RalfJung:rustup, r=RalfJung
bors [Sun, 20 Sep 2020 11:14:29 +0000 (11:14 +0000)]
Auto merge of #1553 - RalfJung:rustup, r=RalfJung

rustup

Cc `@oli-obk`

3 years agorustup
Ralf Jung [Sun, 20 Sep 2020 11:13:57 +0000 (13:13 +0200)]
rustup

3 years agoAuto merge of #1552 - RalfJung:rustup, r=RalfJung
bors [Sun, 20 Sep 2020 10:18:29 +0000 (10:18 +0000)]
Auto merge of #1552 - RalfJung:rustup, r=RalfJung

rustup; make sure the generator moves even with smarter optimizations

3 years agoaccount for mir-opts masking more errors
Ralf Jung [Sun, 20 Sep 2020 10:02:04 +0000 (12:02 +0200)]
account for mir-opts masking more errors

3 years agorustup; make sure the iterator moves even with smarter optimizations
Ralf Jung [Sun, 20 Sep 2020 08:26:22 +0000 (10:26 +0200)]
rustup; make sure the iterator moves even with smarter optimizations

3 years agoAuto merge of #1551 - RalfJung:readme, r=RalfJung
bors [Sat, 19 Sep 2020 09:40:24 +0000 (09:40 +0000)]
Auto merge of #1551 - RalfJung:readme, r=RalfJung

list two more aliasing problems we found in BTreeMap and VecDeque

3 years agolist two more aliasing problems we found in BTreeMap and VecDeque
Ralf Jung [Sat, 19 Sep 2020 09:37:56 +0000 (11:37 +0200)]
list two more aliasing problems we found in BTreeMap and VecDeque

3 years agoAuto merge of #1549 - RalfJung:panic-abort, r=oli-obk
bors [Fri, 18 Sep 2020 11:41:04 +0000 (11:41 +0000)]
Auto merge of #1549 - RalfJung:panic-abort, r=oli-obk

support panic=abort

This adds support for abort-on-panic (https://github.com/rust-lang/miri/issues/1058). To achieve this, we insert `cargo-miri` as `RUSTC` when building the standard library, and patch the rustc flags in a way similar to what bootstrap does.

However, this is currently not supported on Windows as the Windows code uses inline assembly to cause an abort (?!?). I'll submit a rustc PR with some `cffg(miri)` to make that work. (EDIT: that would be https://github.com/rust-lang/rust/pull/76871)

Cc `@Aaron1011` r? `@oli-obk`

3 years agofmt
Ralf Jung [Fri, 18 Sep 2020 11:34:25 +0000 (13:34 +0200)]
fmt

Co-authored-by: Oli Scherer <github35764891676564198441@oli-obk.de>
3 years agosupport panic=abort
Ralf Jung [Fri, 18 Sep 2020 11:10:18 +0000 (13:10 +0200)]
support panic=abort

3 years agoAuto merge of #1548 - RalfJung:update, r=RalfJung
bors [Fri, 18 Sep 2020 10:19:04 +0000 (10:19 +0000)]
Auto merge of #1548 - RalfJung:update, r=RalfJung

Update dependencies

3 years agoupdate for major version bumps
Ralf Jung [Fri, 18 Sep 2020 10:17:09 +0000 (12:17 +0200)]
update for major version bumps

3 years ago'cargo update' test-cargo-miri
Ralf Jung [Fri, 18 Sep 2020 10:12:02 +0000 (12:12 +0200)]
'cargo update' test-cargo-miri

3 years agocargo update main crates
Ralf Jung [Thu, 17 Sep 2020 18:08:18 +0000 (20:08 +0200)]
cargo update main crates

3 years agoAuto merge of #1540 - RalfJung:cargo-miri-redone, r=oli-obk
bors [Thu, 17 Sep 2020 16:52:23 +0000 (16:52 +0000)]
Auto merge of #1540 - RalfJung:cargo-miri-redone, r=oli-obk

Redo cargo-miri logic

This rewrite the cargo-miri logic for running the requested crate(s) following what we outlined in https://github.com/rust-lang/miri/issues/739: `cargo miri run/test $FLAGS` (almost) literally invokes `cargo run/test $FLAGS` but with some environment variables set so that we can control what happens:
* `RUSTC_WRAPPER` is set so that we get invoked instead of `rustc`. We use that power to mess with the flags being used for the build (things to be interpreted by Miri use a different sysroot), and when we are detecting a binary crate meant to be run by Miri, we grab the info we care about and put it into a JSON file for later use.
* `CARGO_TARGET_$TARGET_RUNNER` is set so what we get invoked when cargo wants to run a binary. At that point we take that JSON info from before and use it to invoke Miri.

Overall this works great! We get all sorts of cargo magic for free, and do not even need `cargo-metadata` any more. There's one annoying point though, which I have not managed to entirely work around yet: this means we are doing a full build, not just a check-build. Given that our sysroot is MIR-only, I was surprised that this even worked, but still -- this means we are doing more work than we should. So I also added some patching of arguments to make sure `--emit` does not contain `link`, and then more patching was required of the `--extern` flags for the binary because those referenced the `.rlib` files but now only `.rmeta` exists, and that is still not fully working because cargo seems to expect those `.rmeta` files and now triggers a rebuild each time as those files are still missing. My current plan is to make our wrapper create some empty dummy files with the right names, but the amount of hacks we are stacking on top of each other here is getting worrysome.^^ `@ehuss` your input would be welcome on this issue.

Due to re-using cargo more literally, this also changes flag parsing to match `cargo`. So `-Zmiri` flags now have to be passed via an environment variable (Cc https://github.com/rust-lang/miri/issues/1416).

This PR is not ready yet, but the parts that are there I think can be reviewed already. TODO:
* [x] [Fix Windows](https://github.com/rust-lang/miri/pull/1540#issuecomment-688733741).
* [x] Figure out how we can do check-only builds without the rebuild problem above. ~~I am also worried about cases where `build.rs` script might detect check-only builds and then do less work; I think some crates in rustc are doing that and if this is a thing in the wider ecosystem we need to find a way to support this as well.~~ (postponed that until we have a concrete example)
* [x] Currently cargo runs doctests as well, and they are not run in Miri. We should at least figure out a way to not run them at all (resolving https://github.com/rust-lang/miri/issues/584 is left for a future PR).
* [x] For some time, detect the old way of passing `-Zmiri` flags and warn that this will need updating. For some simple situations we can probably make it still support the old way, but I plan to remove those hacks after a bit. This is just to give people and me time to go around and send PRs to all projects that use Miri on CI, and update their use of the flags.
* [x] Add a test for stdin handling (https://github.com/rust-lang/miri/issues/1505). This should work now but we should be sure.
* [x] Add a test for cargo env vars (https://github.com/rust-lang/miri/issues/1515).
* [x] Check if https://github.com/rust-lang/miri/issues/1516 is resolved.
* [x] Check if https://github.com/rust-lang/miri/issues/1001 and https://github.com/rust-lang/miri/issues/1514 are resolved.
* [x] Check if https://github.com/rust-lang/miri/issues/1312 is resolved (not sure if it is wort adding a test).
* [x] Check if https://github.com/rust-lang/miri/issues/1512 is resolved (not sure if it is wort adding a test).

Fixes https://github.com/rust-lang/miri/issues/700.
Fixes https://github.com/rust-lang/miri/issues/739.
Fixes https://github.com/rust-lang/miri/issues/1001.
Fixes https://github.com/rust-lang/miri/issues/1312 (without a test, as we run without cargo's stdin/stdout wrapping now, as the test for stdin confirms).
Fixes https://github.com/rust-lang/miri/issues/1416.
Fixes https://github.com/rust-lang/miri/issues/1505.
Fixes https://github.com/rust-lang/miri/issues/1512 (without a test, as cargo now does all that handling anyway, which various other tests confirm).
Fixes https://github.com/rust-lang/miri/issues/1514.
Fixes https://github.com/rust-lang/miri/issues/1516.

Cc `@alecmocatta` who reported many of the bugs above; would be great if you could help with the tests e.g. by providing some small examples I could try.
r? `@oli-obk`

3 years agoAuto merge of #1547 - RalfJung:rustup, r=RalfJung
bors [Thu, 17 Sep 2020 15:43:29 +0000 (15:43 +0000)]
Auto merge of #1547 - RalfJung:rustup, r=RalfJung

rustup; no need to special-case the guaranteed_eq/ne intrinsics any more

3 years agorustup; no need to special-case the guaranteed_eq/ne intrinsics any more
Ralf Jung [Thu, 17 Sep 2020 15:42:52 +0000 (17:42 +0200)]
rustup; no need to special-case the guaranteed_eq/ne intrinsics any more

3 years agoadd comment mentioning alternative approach
Ralf Jung [Wed, 16 Sep 2020 17:54:52 +0000 (19:54 +0200)]
add comment mentioning alternative approach

3 years agotest-cargo-miri: normalize slashes before comparing paths
Ralf Jung [Sat, 12 Sep 2020 14:01:33 +0000 (16:01 +0200)]
test-cargo-miri: normalize slashes before comparing paths

3 years agomake sure tests pass even with RUST_TEST_NOCAPTURE set
Ralf Jung [Sat, 12 Sep 2020 12:24:56 +0000 (14:24 +0200)]
make sure tests pass even with RUST_TEST_NOCAPTURE set

3 years agomake (not yet actually used) doctest actually use the crate, and fix a comment
Ralf Jung [Sat, 12 Sep 2020 12:09:43 +0000 (14:09 +0200)]
make (not yet actually used) doctest actually use the crate, and fix a comment

3 years agomore consistent error capitalization
Ralf Jung [Sat, 12 Sep 2020 12:02:08 +0000 (14:02 +0200)]
more consistent error capitalization

3 years agocleaner output for cargo-miri-test harness
Ralf Jung [Sat, 12 Sep 2020 11:57:49 +0000 (13:57 +0200)]
cleaner output for cargo-miri-test harness

3 years agomake sure subcrate tests have the right cwd
Ralf Jung [Sat, 12 Sep 2020 11:52:05 +0000 (13:52 +0200)]
make sure subcrate tests have the right cwd

3 years agotest 'cargo miri run' CWD, also for subcrate in a workspace
Ralf Jung [Sat, 12 Sep 2020 11:33:30 +0000 (13:33 +0200)]
test 'cargo miri run' CWD, also for subcrate in a workspace

3 years agotest propagating env vars from build.rs to binary
Ralf Jung [Sat, 12 Sep 2020 11:10:23 +0000 (13:10 +0200)]
test propagating env vars from build.rs to binary

3 years agotest 'harness=false' tests
Ralf Jung [Sat, 12 Sep 2020 10:52:14 +0000 (12:52 +0200)]
test 'harness=false' tests

3 years agodetect when the user passes Miri's flags the old way, and support this for now
Ralf Jung [Sat, 12 Sep 2020 10:41:23 +0000 (12:41 +0200)]
detect when the user passes Miri's flags the old way, and support this for now

3 years agofix cargo-miri-test for cross-runs
Ralf Jung [Fri, 11 Sep 2020 16:20:41 +0000 (18:20 +0200)]
fix cargo-miri-test for cross-runs

3 years agoshow proper warning about not running doctests
Ralf Jung [Fri, 11 Sep 2020 13:05:05 +0000 (15:05 +0200)]
show proper warning about not running doctests

3 years agoupdate comment
Ralf Jung [Wed, 9 Sep 2020 09:48:44 +0000 (11:48 +0200)]
update comment

Co-authored-by: Oli Scherer <github35764891676564198441@oli-obk.de>
3 years agotest reading from stdin
Ralf Jung [Wed, 9 Sep 2020 07:18:10 +0000 (09:18 +0200)]
test reading from stdin

3 years agopatch away --error-format and --json so that errors are rendered properly
Ralf Jung [Wed, 9 Sep 2020 07:12:26 +0000 (09:12 +0200)]
patch away --error-format and --json so that errors are rendered properly

3 years agoforward build-time env vars to binary, and test that we do
Ralf Jung [Wed, 9 Sep 2020 06:51:41 +0000 (08:51 +0200)]
forward build-time env vars to binary, and test that we do

3 years agofix Miri script on macOS
Ralf Jung [Wed, 9 Sep 2020 06:40:06 +0000 (08:40 +0200)]
fix Miri script on macOS

3 years agohandle binary suffices (for Windows); stop deleting fake binary
Ralf Jung [Tue, 8 Sep 2020 23:00:09 +0000 (01:00 +0200)]
handle binary suffices (for Windows); stop deleting fake binary

3 years agomake our filename handling work better across platforms
Ralf Jung [Tue, 8 Sep 2020 18:18:08 +0000 (20:18 +0200)]
make our filename handling work better across platforms

3 years agoeven when not linking, create stub .rlib files to fool cargo
Ralf Jung [Tue, 8 Sep 2020 18:08:11 +0000 (20:08 +0200)]
even when not linking, create stub .rlib files to fool cargo

3 years agofix typo
Ralf Jung [Tue, 8 Sep 2020 09:08:46 +0000 (11:08 +0200)]
fix typo

Co-authored-by: Oli Scherer <github35764891676564198441@oli-obk.de>
3 years agoupdate docs, and also use MIRIFLAGS for the test suite
Ralf Jung [Tue, 8 Sep 2020 08:01:18 +0000 (10:01 +0200)]
update docs, and also use MIRIFLAGS for the test suite

3 years agotest respecting 'test=false', and what happens with doctests
Ralf Jung [Tue, 8 Sep 2020 07:56:21 +0000 (09:56 +0200)]
test respecting 'test=false', and what happens with doctests

3 years agopatch --extern and --emit; test suite passes now!
Ralf Jung [Wed, 9 Sep 2020 06:58:29 +0000 (08:58 +0200)]
patch --extern and --emit; test suite passes now!

3 years agoit actually runs tests now!
Ralf Jung [Mon, 7 Sep 2020 19:12:51 +0000 (21:12 +0200)]
it actually runs tests now!

3 years agostub JSON information flow from cargo-build-time to run-time
Ralf Jung [Mon, 7 Sep 2020 18:19:45 +0000 (20:19 +0200)]
stub JSON information flow from cargo-build-time to run-time

3 years agotowards letting cargo do binary selection: wrappers and runners set up
Ralf Jung [Sun, 6 Sep 2020 17:28:58 +0000 (19:28 +0200)]
towards letting cargo do binary selection: wrappers and runners set up

3 years agocanonicalize miri's directory
Ralf Jung [Sun, 6 Sep 2020 17:28:29 +0000 (19:28 +0200)]
canonicalize miri's directory

3 years agoAuto merge of #1546 - Aaron1011:fix/windows-panic, r=RalfJung
bors [Thu, 17 Sep 2020 13:49:44 +0000 (13:49 +0000)]
Auto merge of #1546 - Aaron1011:fix/windows-panic, r=RalfJung

Enable some panic tests on Windows

3 years agoEnable some panic tests on Windows
Aaron Hill [Thu, 17 Sep 2020 13:39:52 +0000 (09:39 -0400)]
Enable some panic tests on Windows

3 years agoAuto merge of #1545 - RalfJung:azure-ci, r=RalfJung
bors [Sun, 13 Sep 2020 19:59:14 +0000 (19:59 +0000)]
Auto merge of #1545 - RalfJung:azure-ci, r=RalfJung

also detect Azure CI environments

Cc `@sunjay`

3 years agoalso detect Azure CI environments
Ralf Jung [Sun, 13 Sep 2020 19:10:29 +0000 (21:10 +0200)]
also detect Azure CI environments

3 years agoAuto merge of #1543 - RalfJung:btree, r=RalfJung
bors [Fri, 11 Sep 2020 10:20:52 +0000 (10:20 +0000)]
Auto merge of #1543 - RalfJung:btree, r=RalfJung

test BTreeMap::drain_filter for leaks

3 years agotest BTreeMap::drain_filter for leaks
Ralf Jung [Fri, 11 Sep 2020 10:20:08 +0000 (12:20 +0200)]
test BTreeMap::drain_filter for leaks

3 years agoAuto merge of #1541 - RalfJung:rustup, r=RalfJung
bors [Thu, 10 Sep 2020 06:45:44 +0000 (06:45 +0000)]
Auto merge of #1541 - RalfJung:rustup, r=RalfJung

Rustup, expand collection tests

3 years agoexpand collection tests
Ralf Jung [Thu, 10 Sep 2020 06:38:43 +0000 (08:38 +0200)]
expand collection tests

3 years agorustup
Ralf Jung [Thu, 10 Sep 2020 06:38:30 +0000 (08:38 +0200)]
rustup

3 years agoAuto merge of #1511 - samrat:more-fd-trait-ops, r=RalfJung
bors [Wed, 9 Sep 2020 17:58:08 +0000 (17:58 +0000)]
Auto merge of #1511 - samrat:more-fd-trait-ops, r=RalfJung

Implement dup and close for stdin/stdout/stderr

Implements some of the operations for stdin/out/err, towards #1499

3 years agoImplement dup and close for stdin/stdout/stderr
Samrat Man Singh [Sat, 15 Aug 2020 08:45:31 +0000 (14:15 +0530)]
Implement dup and close for stdin/stdout/stderr

Support F_DUPFD on stdin/stdout/stderr

Enable `close`-ing stdin/stdout/stderr

For `dup`, check if FD is `File` first

If not, clone the appropriate standard IO stream

Merge POSIX `close` and `dup` tests into same module

Also, add assertion that `write` on a closed FD returns an error.

Add `dup` as FileDescriptor trait fn

Also:
- Fix `close` so it drops `self` instead of reference to it
- Remove FD clamping in insert_fd_with_min_fd, since FDs 0-2 can be
closed

Fix fs_libc tests

Make error message when closing stdin/out/err more specific

Return io::Result from `FileDescriptor::dup`

Change error message when closing stdin/out/err

Refactor `FileDescriptor::dup` impl for `FileHandle`

Remove empty line

3 years agoAuto merge of #1536 - divergentdave:nanosleep, r=RalfJung
bors [Tue, 8 Sep 2020 08:26:33 +0000 (08:26 +0000)]
Auto merge of #1536 - divergentdave:nanosleep, r=RalfJung

Nanosleep

This PR adds a shim for `libc::nanosleep`, (available under -Zmiri-disable-isolation only) which backs `thread::sleep` on Linux and macOS. I started off by extracting the `timespec` parsing from the `pthread_cond_timedwait` shim into a helper method, and adding checks for invalid values. The second commit adds the new shim and a small test. The shim blocks the current thread, and registers a timeout callback to unblock the thread again, using the same method as `pthread_cond_timedwait` does.

3 years agoUse try block instead of closure
David Cook [Mon, 7 Sep 2020 20:09:34 +0000 (15:09 -0500)]
Use try block instead of closure

3 years agoUpdate comment
David Cook [Mon, 7 Sep 2020 20:05:26 +0000 (15:05 -0500)]
Update comment

3 years agoSimplify read_timespec error handling
David Cook [Mon, 7 Sep 2020 16:31:28 +0000 (11:31 -0500)]
Simplify read_timespec error handling

3 years agoReview comments
David Cook [Mon, 7 Sep 2020 15:54:39 +0000 (10:54 -0500)]
Review comments

3 years agoAuto merge of #1539 - RalfJung:issue, r=RalfJung
bors [Mon, 7 Sep 2020 11:11:03 +0000 (11:11 +0000)]
Auto merge of #1539 - RalfJung:issue, r=RalfJung

float test case: fix referenced issue

3 years agofix referenced issue
Ralf Jung [Mon, 7 Sep 2020 11:10:31 +0000 (13:10 +0200)]
fix referenced issue

3 years agoAuto merge of #1538 - RalfJung:rustup, r=RalfJung
bors [Mon, 7 Sep 2020 09:30:11 +0000 (09:30 +0000)]
Auto merge of #1538 - RalfJung:rustup, r=RalfJung

rustup: work around rustc optimizations becoming too smart

3 years agouse standard black_box function
Ralf Jung [Mon, 7 Sep 2020 09:26:24 +0000 (11:26 +0200)]
use standard black_box function

3 years agoanother optimization work-around
Ralf Jung [Mon, 7 Sep 2020 09:22:49 +0000 (11:22 +0200)]
another optimization work-around

3 years agobetter optimization suppression
Ralf Jung [Mon, 7 Sep 2020 09:16:16 +0000 (11:16 +0200)]
better optimization suppression

Co-authored-by: bjorn3 <bjorn3@users.noreply.github.com>
3 years agotest opt-level 2
Ralf Jung [Mon, 7 Sep 2020 08:35:39 +0000 (10:35 +0200)]
test opt-level 2

3 years agowork around rustc optimizations becoming too smart
Ralf Jung [Mon, 7 Sep 2020 08:24:04 +0000 (10:24 +0200)]
work around rustc optimizations becoming too smart

3 years agoImplement libc::nanosleep shim
David Cook [Sun, 6 Sep 2020 22:09:24 +0000 (17:09 -0500)]
Implement libc::nanosleep shim

3 years agoRefactor timespec parsing, improve error handling
David Cook [Sun, 6 Sep 2020 22:08:41 +0000 (17:08 -0500)]
Refactor timespec parsing, improve error handling

3 years agoAuto merge of #1534 - LeSeulArtichaut:tys-kind, r=RalfJung
bors [Fri, 4 Sep 2020 22:58:34 +0000 (22:58 +0000)]
Auto merge of #1534 - LeSeulArtichaut:tys-kind, r=RalfJung

Change `ty.kind` -> `ty.kind()`

This fixes build failure due to rust-lang/rust#75077, cc rust-lang/rust#76337.
(This is my first PR here, please tell me if anything's wrong)

3 years agoChange `ty.kind` -> `ty.kind()`
LeSeulArtichaut [Fri, 4 Sep 2020 20:03:45 +0000 (22:03 +0200)]
Change `ty.kind` -> `ty.kind()`

3 years agoAuto merge of #1532 - divergentdave:thread-panic-payload, r=RalfJung
bors [Thu, 3 Sep 2020 10:09:34 +0000 (10:09 +0000)]
Auto merge of #1532 - divergentdave:thread-panic-payload, r=RalfJung

Move panic payload state from Machine to Thread

This PR moves the panic payload storage from the `Machine` state to per-thread state. Prior to this change, if one thread panicked while another was still unwinding, Miri would fail with `thread 'rustc' panicked at 'the panic runtime should avoid double-panics', src/shims/panic.rs:51:9`. I ran into this issue while prototyping a round-robin scheduler, but it's also reachable with the current scheduler and contrived programs that use blocking API calls to cause thread switching during unwinding. I wrote a test case along those lines for this change.

3 years agoAdd comment
David Cook [Thu, 3 Sep 2020 01:58:41 +0000 (20:58 -0500)]
Add comment

3 years agoPer-thread errno storage
David Cook [Tue, 1 Sep 2020 02:29:09 +0000 (21:29 -0500)]
Per-thread errno storage

3 years agoAuto merge of #1533 - RalfJung:rustup, r=RalfJung
bors [Tue, 1 Sep 2020 08:58:35 +0000 (08:58 +0000)]
Auto merge of #1533 - RalfJung:rustup, r=RalfJung

rustup, fix test

Cc https://github.com/rust-lang/rust/issues/76190

3 years agorustup, fix test
Ralf Jung [Tue, 1 Sep 2020 08:55:09 +0000 (10:55 +0200)]
rustup, fix test

3 years agoReview comments
David Cook [Tue, 1 Sep 2020 00:32:14 +0000 (19:32 -0500)]
Review comments

3 years agoMove panic payload state from Machine to Thread
David Cook [Sun, 30 Aug 2020 02:38:37 +0000 (21:38 -0500)]
Move panic payload state from Machine to Thread

3 years agoAuto merge of #1531 - divergentdave:cargo-miri-targets-test, r=RalfJung
bors [Sat, 29 Aug 2020 11:22:05 +0000 (11:22 +0000)]
Auto merge of #1531 - divergentdave:cargo-miri-targets-test, r=RalfJung

Test cargo miri target selection

This is a followup to #1525, adding a few test invocations with targets specified in the cargo arguments.

3 years agoTest cargo miri target selection
David Cook [Sat, 29 Aug 2020 04:12:11 +0000 (23:12 -0500)]
Test cargo miri target selection