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

Miri subtree update #129785

Merged
merged 55 commits into from
Aug 31, 2024
Merged

Miri subtree update #129785

merged 55 commits into from
Aug 31, 2024

Conversation

RalfJung
Copy link
Member

r? @ghost

RalfJung and others added 30 commits August 19, 2024 08:17
also move "is there a borrow tracker" check out of the loop
Fix a misleading comment in `tests/pass/tree_borrows/tree-borrows.rs`

The original comment is somewhat misleading.

Since we don't add a protector for `x` here, `f` should be allowed to deallocate `x`.
…r=RalfJung

Avoid extra copy by using `retain_mut` and moving the deletion into the closure

Fixes the FIXME introduced in rust-lang#3833. Thanks to `@dmitrii-ubskii` for the idea 🙂
fix calling pipe, pipe2, socketpair with a pointer-to-array

Fixes rust-lang/miri#3839
epoll: Add a EINVAL case

In ``epoll_ctl`` documentation, it is mentioned that:
> EINVAL epfd is not an epoll file descriptor, or fd is the same as epfd, or the requested operation op is not supported by this interface.

So I added this EINVAL case for ``epfd == fd`` in ``epoll_ctl``
epoll: handle edge case for epoll_ctl

There is a test case that revealed that our implementation differs from the real system:
 - Set up an epoll watching the FD
- Call epoll_wait
- Set up another epoll watching the same FD
- Call epoll_wait on the first epoll. Nothing should be reported!

This happened because, in ``epoll_ctl``, we used ``check_and_update_readiness``, which is a function that would return notification for all epoll file description that registered a particular file description. But we shouldn't do that because no notification should be returned if there is no I/O activity between two ``epoll_wait`` (every first ``epoll_wait`` that happens after ``epoll_ctl`` is an exception, we should return notification that reflects the readiness of file description).

r? `@oli-obk`
Co-authored-by: Ralf Jung <[email protected]>
JoJoDeveloping and others added 10 commits August 28, 2024 12:21
…e-gc, r=RalfJung

Make Tree Borrows Provenance GC compact the tree

Follow-up on rust-lang#3833 and rust-lang#3835. In these PRs, the TB GC was fixed to no longer cause a stack overflow. One test that motivated it was the test `fill::horizontal_line` in [`tiny-skia`](https://github.com/RazrFalcon/tiny-skia). But not causing stack overflows was not a large improvents, since it did not fix the fundamental issue: The tree was too large. The test now ran, but it required gigabytes of memory and hours of time (only for it to be OOM-killed 🤬), whereas it finishes within 24 seconds in Stacked Borrows. With this merged, it finishes in about 40 seconds under TB.

The problem in that test was that it used [`slice::chunked`](https://doc.rust-lang.org/std/primitive.slice.html#method.chunks) to iterate a slice in chunks. That iterator is written to reborrow at each call to `next`, which creates a linear tree with a bunch of intermediary nodes, which also fragments the `RangeMap` for that allocation.

The solution is to now compact the tree, so that these interior nodes are removed. Care is taken to not remove nodes that are protected, or that otherwise restrict their children.

I am currently only 99% sure that this is sound, and I do also think that this could compact even more. So `@Vanille-N` please also have a look at whether I got the compacting logic right.

For a more visual comparison, [here is a gist](https://gist.github.com/JoJoDeveloping/ae4a7f7c29335a4c233ef42d2f267b01) of what the tree looks like at one point during that test, with and without compacting.

This new GC requires a different iteration order during accesses (since the current one can make the error messages non-deterministic), so it is rebased on top of rust-lang#3843 and requires that PR to be merged first.
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 30, 2024
@rustbot
Copy link
Collaborator

rustbot commented Aug 30, 2024

The Miri subtree was changed

cc @rust-lang/miri

@RalfJung
Copy link
Member Author

@bors r+ p=1

@bors
Copy link
Collaborator

bors commented Aug 30, 2024

📌 Commit f03c7b2 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 Aug 30, 2024
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Aug 31, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 31, 2024
…kingjubilee

Rollup of 3 pull requests

Successful merges:

 - rust-lang#129642 (Bump backtrace to 0.3.74~ish)
 - rust-lang#129733 (Subtree update of `rust-analyzer`)
 - rust-lang#129785 (Miri subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 31, 2024
…kingjubilee

Rollup of 3 pull requests

Successful merges:

 - rust-lang#129642 (Bump backtrace to 0.3.74~ish)
 - rust-lang#129733 (Subtree update of `rust-analyzer`)
 - rust-lang#129785 (Miri subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 31, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 31, 2024
…iaskrgr

Rollup of 11 pull requests

Successful merges:

 - rust-lang#129630 (Document the broken C ABI of `wasm32-unknown-unknown`)
 - rust-lang#129711 (Expand NLL MIR dumps)
 - rust-lang#129730 (f32 docs: define 'arithmetic' operations)
 - rust-lang#129733 (Subtree update of `rust-analyzer`)
 - rust-lang#129749 (llvm-wrapper: adapt for LLVM API changes)
 - rust-lang#129757 (Add a test for trait solver overflow in MIR inliner cycle detection)
 - rust-lang#129760 (Make the "detect-old-time" UI test more representative)
 - rust-lang#129767 (Remove `#[macro_use] extern crate tracing`, round 4)
 - rust-lang#129774 (Remove `#[macro_use] extern crate tracing` from rustdoc and rustfmt)
 - rust-lang#129785 (Miri subtree update)
 - rust-lang#129791 (mark joboet as on vacation)

Failed merges:

 - rust-lang#129777 (Add `unreachable_pub`, round 4)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 31, 2024
…iaskrgr

Rollup of 12 pull requests

Successful merges:

 - rust-lang#129659 (const fn stability checking: also check declared language features)
 - rust-lang#129711 (Expand NLL MIR dumps)
 - rust-lang#129730 (f32 docs: define 'arithmetic' operations)
 - rust-lang#129733 (Subtree update of `rust-analyzer`)
 - rust-lang#129749 (llvm-wrapper: adapt for LLVM API changes)
 - rust-lang#129757 (Add a test for trait solver overflow in MIR inliner cycle detection)
 - rust-lang#129760 (Make the "detect-old-time" UI test more representative)
 - rust-lang#129767 (Remove `#[macro_use] extern crate tracing`, round 4)
 - rust-lang#129774 (Remove `#[macro_use] extern crate tracing` from rustdoc and rustfmt)
 - rust-lang#129785 (Miri subtree update)
 - rust-lang#129791 (mark joboet as on vacation)
 - rust-lang#129812 (interpret, codegen: tweak some comments and checks regarding Box with custom allocator)

Failed merges:

 - rust-lang#129777 (Add `unreachable_pub`, round 4)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 31, 2024
…iaskrgr

Rollup of 12 pull requests

Successful merges:

 - rust-lang#129659 (const fn stability checking: also check declared language features)
 - rust-lang#129711 (Expand NLL MIR dumps)
 - rust-lang#129730 (f32 docs: define 'arithmetic' operations)
 - rust-lang#129733 (Subtree update of `rust-analyzer`)
 - rust-lang#129749 (llvm-wrapper: adapt for LLVM API changes)
 - rust-lang#129757 (Add a test for trait solver overflow in MIR inliner cycle detection)
 - rust-lang#129760 (Make the "detect-old-time" UI test more representative)
 - rust-lang#129767 (Remove `#[macro_use] extern crate tracing`, round 4)
 - rust-lang#129774 (Remove `#[macro_use] extern crate tracing` from rustdoc and rustfmt)
 - rust-lang#129785 (Miri subtree update)
 - rust-lang#129791 (mark joboet as on vacation)
 - rust-lang#129812 (interpret, codegen: tweak some comments and checks regarding Box with custom allocator)

Failed merges:

 - rust-lang#129777 (Add `unreachable_pub`, round 4)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 2e624ff into rust-lang:master Aug 31, 2024
6 checks passed
@rustbot rustbot added this to the 1.82.0 milestone Aug 31, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Aug 31, 2024
Rollup merge of rust-lang#129785 - RalfJung:miri-sync, r=RalfJung

Miri subtree update

r? ```@ghost```
@RalfJung RalfJung deleted the miri-sync branch August 31, 2024 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

6 participants