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 #110953

Closed
wants to merge 54 commits into from
Closed

update Miri #110953

wants to merge 54 commits into from

Conversation

RalfJung
Copy link
Member

r? @ghost
Cc @rust-lang/miri

bors and others added 30 commits April 10, 2023 12:48
rustup

`@oli-obk` I think this is the resolution we agreed to on Zulip?
throw unsupported for `epoll_wait`

This PR throws unsupported to indicate miri doesn't yet return ready events. Previously it always returned 0, indicating no ready events, even if events for the epoll file descriptor may have been ready.
add memcpy/strcpy/strncpy shims

fix bug

add memcpy/strcpy/strncpy shims

add a test for strncpy

remove strncpy shim
compiletest: complain about unknown flags

This would have avoided rust-lang#110102
* additional
* addresses
* aggregates
* always
* around
* beginning
* behaviours
* borrows
* called
* canary
* deallocated
* determine
* division
* documentation
* empty
* endianness
* ensures
* existing
* github
* hygiene
* individual
* initialize
* instantiate
* library
* location
* miscellaneous
* mitigates
* needs
* nonexistent
* occurred
* occurring
* overridden
* parameter
* performable
* previous
* referential
* requires
* resolved
* scenarios
* semantics
* spurious
* structure
* subtracting
* suppress
* synchronization
* this
* timestamp
* to
* transferring
* unknown
* variable
* windows

Signed-off-by: Josh Soref <[email protected]>
Spelling

This PR corrects misspellings identified by the [check-spelling action](https://github.com/marketplace/actions/check-spelling).

The misspellings have been reported at https://github.com/jsoref/miri/actions/runs/4699927237#summary-12751183650

The action reports that the changes in this PR would make it happy: https://github.com/jsoref/miri/actions/runs/4699927572#summary-12751184493
Remove a test that wasn't carrying its weight

See rust-lang#110107 (comment) for discussion.

TLDR: it keeps breaking out of unrelated reasons and the real thing to check (early alloc ids can be tracked without ICEing miri) is hard to check otherwise.
disable preemption in tokio tests again

The comment even still says we need preemption disabled, but the flag got lost in rust-lang/miri#2764.
RalfJung and others added 13 commits April 26, 2023 11:44
fix endianess handling in eventfd::write

Fixes rust-lang/miri#2800
Bump libffi-sys to 2.3.0

Bump libffi-sys to 2.3.0 that includes LoongArch support.

Thanks
Tree Borrows: improved diagnostics

Better diagnostics for Tree Borrows violations.

- Shows where the conflicting tags (the one that was accessed and the one that had a permission or protector that caused UB) were reborrowed, which is more readable than only `<TAG>`
- Shows a small history of what happened for the faulty tag to get there (which lines caused it to lose read/write permissions)
- Explains permissions and transitions in natural language (e.g. "does not have read permissions" instead of "is Disabled")

Not perfect, but at least testing TB will be less confusing.

Lack of range information from `RangeMap` makes selection of relevant events nontrivial: we reconstruct history from knowledge of `(initial, final)` and `(offset, pi, p'i)` so that `initial -> final = p1 -> p1' = p2 -> p2' = p3 -> ... = final `
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 28, 2023
@rustbot
Copy link
Collaborator

rustbot commented Apr 28, 2023

These commits modify the Cargo.lock file. Random changes to Cargo.lock can be introduced when switching branches and rebasing PRs.
This was probably unintentional and should be reverted before this PR is merged.

If this was intentional then you can ignore this comment.

The Miri subtree was changed

cc @rust-lang/miri

@RalfJung
Copy link
Member Author

Unfortunately I had to use a hacked josh-proxy again for this update. This is probably related to the fact that the last rustc-pull in Miri came with some conflicts that had to be resolved by hand.

The new tree round-trips properly though and the diff looks good, so I think it should be fine.

@RalfJung
Copy link
Member Author

@bors r+

@bors
Copy link
Contributor

bors commented Apr 28, 2023

📌 Commit 33f4d92 has been approved by RalfJung

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Apr 28, 2023

🌲 The tree is currently closed for pull requests below priority 50. This pull request will be tested once the tree is reopened.

@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 Apr 28, 2023
@matthiaskrgr
Copy link
Member

@bors p=1

@bors
Copy link
Contributor

bors commented Apr 29, 2023

⌛ Testing commit 33f4d92 with merge 56fe046e4f41733864407cec15d2e1ba90afce77...

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-tools failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
tests/panic/overflowing-lsh-neg.rs ... ok
tests/panic/panic3.rs ... ok
tests/panic/overflowing-rsh-1.rs ... ok
tests/panic/overflowing-rsh-2.rs ... ok
tests/panic/oob_subslice.rs ... ok
tests/panic/transmute_fat2.rs ... ok
tests/panic/panic4.rs ... ok
tests/panic/unsupported_foreign_function.rs ... ok
tests/panic/function_calls/exported_symbol_good_unwind.rs ... ok
---
tests/fail/tree-borrows/reserved/int-protected-write.rs ... ok
tests/fail/panic/double_panic.rs ... ok

tests/fail/tree-borrows/fragile-data-race.rs FAILED:
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/miri" "--error-format=json" "-Astable-features" "-Aunused" "-Zui-testing" "--target" "x86_64-unknown-linux-gnu" "--extern" "getrandom=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/miri/x86_64-unknown-linux-gnu/debug/deps/libgetrandom-14b1aaee86e20c9a.rlib" "--extern" "getrandom=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/miri/x86_64-unknown-linux-gnu/debug/deps/libgetrandom-14b1aaee86e20c9a.rmeta" "--extern" "getrandom_1=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/miri/x86_64-unknown-linux-gnu/debug/deps/libgetrandom-522d1fe1f3fb1413.rlib" "--extern" "getrandom_1=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/miri/x86_64-unknown-linux-gnu/debug/deps/libgetrandom-522d1fe1f3fb1413.rmeta" "--extern" "libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/miri/x86_64-unknown-linux-gnu/debug/deps/liblibc-8df47f1ee3f80022.rlib" "--extern" "libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/miri/x86_64-unknown-linux-gnu/debug/deps/liblibc-8df47f1ee3f80022.rmeta" "--extern" "num_cpus=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/miri/x86_64-unknown-linux-gnu/debug/deps/libnum_cpus-b37fde289af25dca.rlib" "--extern" "num_cpus=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/miri/x86_64-unknown-linux-gnu/debug/deps/libnum_cpus-b37fde289af25dca.rmeta" "--extern" "rand=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/miri/x86_64-unknown-linux-gnu/debug/deps/librand-be16f3668653c591.rlib" "--extern" "rand=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/miri/x86_64-unknown-linux-gnu/debug/deps/librand-be16f3668653c591.rmeta" "--extern" "page_size=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/miri/x86_64-unknown-linux-gnu/debug/deps/libpage_size-2709be2ca9b220ed.rlib" "--extern" "page_size=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/miri/x86_64-unknown-linux-gnu/debug/deps/libpage_size-2709be2ca9b220ed.rmeta" "--extern" "tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/miri/x86_64-unknown-linux-gnu/debug/deps/libtokio-0f7911dcb05eb597.rlib" "--extern" "tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/miri/x86_64-unknown-linux-gnu/debug/deps/libtokio-0f7911dcb05eb597.rmeta" "--extern" "miri_test_deps=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/miri/x86_64-unknown-linux-gnu/debug/miri-test-deps" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/miri/debug/build/syn-83e38450697cf16b" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/miri/debug/build/getrandom-dd8529f5bb54559b" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/miri/x86_64-unknown-linux-gnu/debug" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/miri/debug/build/log-5da2e714312fda90" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/miri/debug/deps" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/miri/debug/build/tokio-bfd338245ca0e2e7" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/miri/debug/build/libc-023a677652b471f9" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/miri/debug/build/memchr-3aa21f28168e754b" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/miri/debug/build/proc-macro2-56af15a1a9078f46" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/miri/debug/build/quote-d339ad05ba9c2010" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/miri/x86_64-unknown-linux-gnu/debug/deps" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/miri/debug/build/parking_lot_core-ec0977e83bec4bbb" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/miri/debug/build/lock_api-2402edfbc2151f87" "tests/fail/tree-borrows/fragile-data-race.rs" "-Zmiri-tree-borrows" "-Zmiri-preemption-rate=0" "--edition" "2018"
actual output differed from expected
--- tests/fail/tree-borrows/fragile-data-race.stderr
+++ <stderr output>
... 20 lines skipped ...
---
... 7 lines skipped ...


full stderr:
error: Undefined Behavior: write access through <7901> is forbidden
   |
   |
LL |     unsafe { *p = 1 };
   |              ^^^^^^ write access through <7901> is forbidden
   = help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
   = help: the accessed tag <7901> is a child of the conflicting tag <7837>
   = help: the accessed tag <7901> is a child of the conflicting tag <7837>
   = help: the conflicting tag <7837> has state Frozen which forbids child write accesses
help: the accessed tag <7901> was created here
   |
   |
LL | fn thread_1(x: &mut u8) -> SendPtr {
help: the conflicting tag <7837> was created here, in the initial state Reserved
  --> /checkout/library/std/src/panic.rs:139:55
   |
   |
LL | pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
   |                                                       ^
help: the conflicting tag <7837> then transitioned from Reserved to Frozen due to a foreign read access at offsets [0x0..0x1]
   |
LL |         crate::intrinsics::read_via_copy(src)
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = help: this corresponds to a loss of write permissions

@bors
Copy link
Contributor

bors commented Apr 29, 2023

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 29, 2023
@RalfJung RalfJung closed this Apr 30, 2023
@RalfJung RalfJung deleted the miri branch April 30, 2023 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.