Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update Miri #106121

Merged
merged 45 commits into from
Dec 25, 2022
Merged

update Miri #106121

merged 45 commits into from
Dec 25, 2022

Conversation

Pointerbender and others added 30 commits December 8, 2022 20:56
add graceful shim for the custom `O_TMPFILE` file opening flag plus test case

I'm trying if I can get the [`tempfile`](https://crates.io/crates/tempfile) crate to work nicely with miri. Right now miri errors out due to an unsupported flag `O_TMPFILE` (= `0x410000`) passed to [`OpenOptions::custom_flags`](https://github.com/Stebalien/tempfile/blob/92ae3e9d6e82bdcfcf114be459d234d3602be2d4/src/file/imp/unix.rs#L71-L86). Interestingly, `tempfile` has a fallback in case the underlying file system does not support the `O_TMPFILE` flag, in which case `open`/`open64` is expected to return the error code `EOPNOTSUPP` (= `95`). This PR adds support for this scenario and also includes a test case (relevant [zulip](https://rust-lang.zulipchat.com/#narrow/stream/269128-miri/topic/miri.20and.20the.20.60tempfile.60.20crate) discussion).
Allow configurable and platform-specific page sizes

This fixes rust-lang#2644 by setting platform-default page sizes along with a command line flag to override size to a specific value (e.g. in the case of aarch64 Linux on M1 silicon). There's still some code cleanup to be done and tests need to be added but I'm opening this for now.
add provenance-related test

One of the cases in rust-lang/miri#2182 actually works as intended since rust-lang#104054 (or maybe even earlier); make sure we test that.
make flag checks reobust against multi-bit flags

and make eval_libc functions ICE on any problem
- test that the tmpdir Miri tests see is absolute and a directory
- test that current_dir returns an absolute path
make unix path handling on Windows hosts (and vice versa) preserve absoluteness

Also adds a magic Miri extern function so this conversion can be invoked by the program. That avoids having to duplicate that logic.
implement minimal epoll_create1 shim

Implements minimal shim for rust-lang#602
saethlin and others added 6 commits December 23, 2022 13:45
Data race spans

Fixes rust-lang/miri#2205

This adds output to data race errors very similar to the spans we emit for Stacked Borrows errors. For example, from our test suite:
```
help: The Atomic Load on thread `<unnamed>` is here
  --> tests/fail/data_race/atomic_read_na_write_race1.rs:23:13
   |
23 | ...   (&*c.0).load(Ordering::SeqCst) //~ ERROR: Data race detected between Atomic Load on thread `<unnamed>` and Write o...
   |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: The Write on thread `<unnamed>` is here
  --> tests/fail/data_race/atomic_read_na_write_race1.rs:19:13
   |
19 |             *(c.0 as *mut usize) = 32;
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^```
```

Because of rust-lang/miri#2647 this comes without a perf regression, according to our benchmarks.
@rustbot
Copy link
Collaborator

rustbot commented Dec 24, 2022

r? @Mark-Simulacrum

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 24, 2022
@rustbot
Copy link
Collaborator

rustbot commented Dec 24, 2022

The Miri subtree was changed

cc @rust-lang/miri

@RalfJung
Copy link
Member Author

Strange, we have -D warnings in the Miri build but that lint did not fire...

 error: lifetime parameter `'tcx` never used
  --> src/tools/miri/src/shims/unix/linux/fd/socketpair.rs:18:12
   |
18 |     fn dup<'tcx>(&mut self) -> io::Result<Box<dyn FileDescriptor>> {
   |           -^^^^- help: elide the unused lifetime

@gimbling-away
Copy link
Contributor

image
Is it just mine or does the Rustbot message not seem to actually ping rust-lang/miri? usually it's in bold

@Mark-Simulacrum
Copy link
Member

Strange, we have -D warnings in the Miri build but that lint did not fire...

 error: lifetime parameter `'tcx` never used
  --> src/tools/miri/src/shims/unix/linux/fd/socketpair.rs:18:12
   |
18 |     fn dup<'tcx>(&mut self) -> io::Result<Box<dyn FileDescriptor>> {
   |           -^^^^- help: elide the unused lifetime

I don't think the lint is on by default, perhaps? rustbuild turns it on for in-tree things here: https://github.com/rust-lang/rust/blob/master/src/bootstrap/builder.rs#L1666

@RalfJung
Copy link
Member Author

RalfJung commented Dec 24, 2022 via email

RalfJung and others added 3 commits December 25, 2022 14:16
enable some warnings that rustc bootstrap enables

also use cargo-install to install josh-proxy, since the docker version cannot access SSH keys (needed for pushing)
@RalfJung
Copy link
Member Author

Is it just mine or does the Rustbot message not seem to actually ping rust-lang/miri? usually it's in bold

It is bold here. 🤷

@RalfJung
Copy link
Member Author

@bors r+ p=1

@bors
Copy link
Contributor

bors commented Dec 25, 2022

📌 Commit d8b48d4 has been approved by RalfJung

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 25, 2022
@bors
Copy link
Contributor

bors commented Dec 25, 2022

⌛ Testing commit d8b48d4 with merge 298d763...

@bors
Copy link
Contributor

bors commented Dec 25, 2022

☀️ Test successful - checks-actions
Approved by: RalfJung
Pushing 298d763 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 25, 2022
@bors bors merged commit 298d763 into rust-lang:master Dec 25, 2022
@rustbot rustbot added this to the 1.68.0 milestone Dec 25, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (298d763): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.5% [-1.5%, -1.5%] 1
All ❌✅ (primary) - - 0

Cycles

This benchmark run did not return any relevant results for this metric.

@RalfJung RalfJung deleted the miri branch December 27, 2022 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants