Commit Graph

6437 Commits

Author SHA1 Message Date
Ben Kimock
6cd74ee9c7 Pass --color=always through cargo-miri 2022-06-20 11:02:56 -04:00
David Tolnay
ee132c8d07
Bless stderr files after rustfmt 2022-06-20 02:23:53 -07:00
David Tolnay
66e8751afc
Format tests and benches with rustfmt (1-50 of 300) 2022-06-20 02:23:53 -07:00
bors
fe04faf0ce Auto merge of #2242 - dtolnay-contrib:rustfmtskip, r=RalfJung
Add rustfmt::skip to some files

Extracted from https://github.com/rust-lang/miri/pull/2097.

Five of the files being skipped here are because rustfmt is buggy (https://github.com/rust-lang/rustfmt/issues/5391; see the error messages below). The other two have clearly preferable manual formatting.

```console
error[internal]: left behind trailing whitespace
  --> tests/fail/validity/transmute_through_ptr.rs:18:18:1
   |
18 |
   | ^^^^
   |

warning: rustfmt has failed to format. See previous 1 errors.

error[internal]: left behind trailing whitespace
  --> tests/fail/stacked_borrows/illegal_read2.rs:10:10:1
   |
10 |
   | ^^^^
   |

warning: rustfmt has failed to format. See previous 1 errors.

error[internal]: left behind trailing whitespace
  --> tests/fail/stacked_borrows/illegal_read5.rs:15:15:1
   |
15 |
   | ^^^^
   |

warning: rustfmt has failed to format. See previous 1 errors.

error[internal]: left behind trailing whitespace
  --> tests/fail/stacked_borrows/illegal_read1.rs:10:10:1
   |
10 |
   | ^^^^
   |

warning: rustfmt has failed to format. See previous 1 errors.

error[internal]: left behind trailing whitespace
 --> /git/miri/tests/fail/erroneous_const2.rs:9:9:1
  |
9 |
  | ^^^^
  |

warning: rustfmt has failed to format. See previous 1 errors.
```
2022-06-20 05:23:46 +00:00
David Tolnay
817adda794
Add rustfmt::skip to some files
Five of the files being skipped here are because rustfmt is buggy (see
the error messages below). The others have clearly preferable manual
formatting.

    error[internal]: left behind trailing whitespace
      --> tests/fail/validity/transmute_through_ptr.rs:18:18:1
       |
    18 |
       | ^^^^
       |

    warning: rustfmt has failed to format. See previous 1 errors.

    error[internal]: left behind trailing whitespace
      --> tests/fail/stacked_borrows/illegal_read2.rs:10:10:1
       |
    10 |
       | ^^^^
       |

    warning: rustfmt has failed to format. See previous 1 errors.

    error[internal]: left behind trailing whitespace
      --> tests/fail/stacked_borrows/illegal_read5.rs:15:15:1
       |
    15 |
       | ^^^^
       |

    warning: rustfmt has failed to format. See previous 1 errors.

    error[internal]: left behind trailing whitespace
      --> tests/fail/stacked_borrows/illegal_read1.rs:10:10:1
       |
    10 |
       | ^^^^
       |

    warning: rustfmt has failed to format. See previous 1 errors.

    error[internal]: left behind trailing whitespace
     --> tests/fail/erroneous_const2.rs:9:9:1
      |
    9 |
      | ^^^^
      |

    warning: rustfmt has failed to format. See previous 1 errors.
2022-06-19 17:21:57 -07:00
bors
2baabf796c Auto merge of #2240 - RalfJung:readme, r=RalfJung
readme

Emulation of weak memory effects is not a kind of UB, so put it into a separate paragraph. Also remove the note about incomplete threading support. :)
2022-06-19 16:19:48 +00:00
Ralf Jung
3f9414565d readme 2022-06-19 09:18:16 -07:00
bors
c4dd3f4ef9 Auto merge of #2228 - cbeuw:futex-fix, r=RalfJung
Prevent futex_wait from actually waiting if a concurrent waker was executed before us

Fixes #2223

Two SC fences were placed in `futex_wake` (after the caller has changed `addr`), and in `futex_wait` (before we read `addr`). This guarantees that `futex_wait` sees the value written to `addr` before the last `futex_wake` call, should one exists, and avoid going into sleep with no one else to wake us up.
ada7b72a87/src/concurrency/weak_memory.rs (L324-L326)

Earlier I proposed to use `fetch_add(0)` to read the latest value in MO, though this isn't the proper way to do it and breaks aliasing: syscall caller may pass in a `*const` from a `&` and Miri complains about write to a `SharedReadOnly` location, causing this test to fail.
ada7b72a87/tests/pass/concurrency/linux-futex.rs (L56-L68)
2022-06-18 15:10:56 +00:00
Ralf Jung
737a5b3b98
tweak correctness comment 2022-06-18 07:59:46 -07:00
bors
c3a58f1a2d Auto merge of #2239 - RalfJung:rustup, r=RalfJung
rustup

Cc https://github.com/rust-lang/rust/issues/98107
2022-06-18 14:50:15 +00:00
Ralf Jung
735e953853 rustup 2022-06-18 07:49:40 -07:00
bors
fa4e77c9fd Auto merge of #2237 - RalfJung:ice, r=oli-obk
add ICE error level

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

But I am not sure if anything else should be adjusted when adding a new error level...
2022-06-16 20:26:12 +00:00
bors
ab6f509ba7 Auto merge of #2236 - RalfJung:rustup, r=RalfJung
rustup

I feel like tests became a *lot* slower. I am not sure what is going on and don't have time to debug right now.
2022-06-16 18:18:39 +00:00
Ralf Jung
d194e9823c rustup 2022-06-16 11:18:09 -07:00
Ralf Jung
e70c631a3b add ICE error level 2022-06-16 11:03:39 -07:00
Andy Wang
807a19a50a
Elaborate correctness comments 2022-06-15 01:44:32 +01:00
Andy Wang
56a4c132b6
Reduce the number of iterations 2022-06-13 18:24:19 +01:00
bors
e7507d6720 Auto merge of #2207 - RalfJung:ui_test_parallelism, r=oli-obk
ui_test: ensure all worker threads stay around

Also organize files such that the by far slowest test (weak_memory/consistency) always starts first. It still finishes last on my system... even after I halved the iteration count.

Fixes https://github.com/rust-lang/miri/issues/2204
2022-06-13 16:08:54 +00:00
Oli Scherer
c16c45362c Document file sorting 2022-06-13 09:08:14 -07:00
Ralf Jung
8ebdad0615 organize more files into folders, and run the weak-mem consistency test as the very first since it is so slow 2022-06-13 09:08:14 -07:00
Ralf Jung
a2cc014231 test files in a deterministic order 2022-06-13 09:07:02 -07:00
Ralf Jung
0648f03133 ensure all worker threads stay around 2022-06-13 09:07:02 -07:00
bors
4c1f50bf2b Auto merge of #2232 - rust-lang:gesundheit, r=oli-obk
Always show stderr on test failure.

fixes #2224

I overengineered the original thing to the point where it became fragile. Let's just always print stderr, unless it was already printed
2022-06-13 13:44:16 +00:00
bors
9642534a33 Auto merge of #2179 - RalfJung:rustc, r=oli-obk
test ui output also in rustc test suite

`@oli-obk` when I just tried this locally (`./x.py test src/tools/miri --stage 0`), it worked fine. What differences had you seen before?
2022-06-13 13:13:29 +00:00
bors
2bbb70f584 Auto merge of #2203 - RalfJung:deprecate, r=oli-obk
deprecate -Zmiri-allow-uninit-numbers and -Zmiri-allow-ptr-int-transmute

Cc https://github.com/rust-lang/miri/issues/2187 https://github.com/rust-lang/miri/issues/2188
2022-06-13 10:23:42 +00:00
Oli Scherer
0689f36a55 Always show stderr on test failure. 2022-06-13 08:55:34 +00:00
bors
0a2a4b3742 Auto merge of #2230 - scottmcm:master, r=RalfJung
Add `#![feature(yeet_expr)]`

Hopefully enough for https://github.com/rust-lang/rust/issues/98036
2022-06-13 04:43:28 +00:00
Scott McMurray
238bbd63ab Add #![feature(yeet_expr)] 2022-06-12 18:39:44 -07:00
bors
21399ff065 Auto merge of #2229 - DrMeepster:patch-1, r=RalfJung
Add cache location on windows to documentation
2022-06-13 01:06:22 +00:00
DrMeepster
286a30fb1d
correct the path 2022-06-12 12:10:13 -07:00
bors
03a05ae211 Auto merge of #2195 - RalfJung:vtable-validation, r=RalfJung
test for Stacked Borrows error during vtable validation

Fixes https://github.com/rust-lang/miri/issues/2123
Needs https://github.com/rust-lang/rust/pull/97761
2022-06-12 05:34:22 +00:00
Ralf Jung
6ed05d976e bless 2022-06-11 22:34:01 -07:00
Ralf Jung
4ccd3f860a
tweak punctuation 2022-06-11 17:45:33 -07:00
Ralf Jung
d9f8312d9a rustup 2022-06-11 17:42:53 -07:00
Ralf Jung
c3b8509654 rename ExperimentalUb → StackedBorrowsUb 2022-06-11 17:42:23 -07:00
Ralf Jung
069d8fdb71 test for Stacked Borrows error during vtable validation 2022-06-11 17:42:23 -07:00
bors
96ee9a0f52 Auto merge of #2226 - InfRandomness:unix-helpers, r=RalfJung
Add unix helpers

This creates unix helper(s)
2022-06-12 00:08:38 +00:00
DrMeepster
681cb88804
Add cache location on windows to documentation 2022-06-11 16:41:32 -07:00
Andy Wang
b6bcbf76fd
Prevent futex_wait from reading outdated value 2022-06-11 20:45:45 +01:00
infrandomness
bc27fbb2f7 Add assert_target_os_is_unix function 2022-06-11 18:50:36 +02:00
infrandomness
58d00aa642 Add target_os_is_unix helper 2022-06-11 18:45:53 +02:00
bors
ada7b72a87 Auto merge of #2227 - RalfJung:doc, r=RalfJung
make some rustdoc comments more readable
2022-06-11 15:50:11 +00:00
bors
c5f7a7d27a Auto merge of #2215 - InfRandomness:getpid_shim, r=RalfJung
Getpid shim
2022-06-11 15:25:26 +00:00
Ralf Jung
5f1ba4432b make some rustdoc comments more readable 2022-06-11 08:03:54 -07:00
bors
7656fc45cf Auto merge of #2222 - InfRandomness:cargo-docs, r=RalfJung
Add mandatory cargo_doc
2022-06-11 15:02:55 +00:00
InfRandomness
3e03054ef0 Add getpid shim 2022-06-11 11:28:50 +02:00
infrandomness
eaa1e444eb Add mandatory cargo_doc
Co-authored-by: Joshua Nelson <github@jyn.dev>
2022-06-11 10:59:57 +02:00
bors
31da2d9f61 Auto merge of #2225 - RalfJung:frame-in-std-inlined, r=RalfJung
make frame_in_std check work with inlining

`@InfRandomness` this should help with your trouble in https://github.com/rust-lang/miri/pull/2215
2022-06-11 03:27:13 +00:00
Ralf Jung
4da48e06c7 make frame_in_std check work with inlining 2022-06-10 20:25:58 -07:00
bors
32a7580b05 Auto merge of #2219 - saethlin:more-benchmarks, r=RalfJung
Add more bench-cargo-miri programs

These example programs are derived from long-running (>15 minutes) tests in the test suites of highly-downloaded crates (if I have my way, that runtime will not be correct for long). They should serve as realistic but also somewhat pathological workloads for the interpreter.

The unicode program stresses the code which looks for adjacent and equal stacks to merge them.
The backtraces program has an uncommonly large working set of borrow tags per borrow stack.

This also updates the .gitignore to ignore files commonly emitted in the course of using these benchmark programs.

---

The benchmark programs are so-named to avoid confusingly duplicating the names of the crates they are benchmarking. Is that a good idea? I started doing this so that I could use `cargo add` but now I'm not entirely sold on the names.
2022-06-09 14:20:42 +00:00