Skip to content

Commit

Permalink
unpin nightly and disable weak memory emulation (bevyengine#4988)
Browse files Browse the repository at this point in the history
# Objective

- Follow suggestion from bevyengine#4984 (comment)

## Solution

- Unpin nightly, disable weak memory emulation

---

This failed the miri job in my branch with the following error:
```
error: Undefined Behavior: attempting a read access using <untagged> at alloc198028[0x0], but that tag does not exist in the borrow stack for this location
   --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/once_cell-1.12.0/src/imp_std.rs:177:28
    |
177 |                 let next = (*waiter).next;
    |                            ^^^^^^^^^^^^^^
    |                            |
    |                            attempting a read access using <untagged> at alloc198028[0x0], but that tag does not exist in the borrow stack for this location
    |                            this error occurs as part of an access at alloc198028[0x0..0x8]
    |
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental
    = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
```

@BoxyUwU could you take a look? I guess it's related to the issue mentioned in rust-lang/miri#2223
  • Loading branch information
mockersf authored and inodentry committed Aug 8, 2022
1 parent 5dca00c commit 8f1f3bc
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,18 @@ jobs:
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
# TODO: re-enable cache once nightly is unpinned
# - uses: actions/cache@v3
# with:
# path: |
# ~/.cargo/bin/
# ~/.cargo/registry/index/
# ~/.cargo/registry/cache/
# ~/.cargo/git/db/
# target/
# key: ${{ runner.os }}-cargo-miri-${{ hashFiles('**/Cargo.toml') }}
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-miri-${{ hashFiles('**/Cargo.toml') }}
- uses: actions-rs/toolchain@v1
with:
# TODO: check again with nightly once https://github.com/rust-lang/miri/issues/2223 is fixed
toolchain: nightly-2022-06-08
toolchain: nightly
components: miri
override: true
- name: Install alsa and udev
Expand All @@ -99,12 +97,13 @@ jobs:
env:
# -Zrandomize-layout makes sure we dont rely on the layout of anything that might change
RUSTFLAGS: -Zrandomize-layout
# https://github.com/rust-lang/miri#miri--z-flags-and-environment-variables
# -Zmiri-disable-isolation is needed because our executor uses `fastrand` which accesses system time.
# -Zmiri-ignore-leaks is needed because running bevy_ecs tests finds a memory leak but its impossible
# to track down because allocids are nondeterministic.
# -Zmiri-tag-raw-pointers is not strictly "necessary" but enables a lot of extra UB checks relating
# to raw pointer aliasing rules that we should be trying to uphold.
MIRIFLAGS: -Zmiri-disable-isolation -Zmiri-ignore-leaks -Zmiri-tag-raw-pointers
# -Zmiri-permissive-provenance disables warnings against int2ptr casts (since those are used by once_cell)
# -Zmiri-disable-weak-memory-emulation works around https://github.com/bevyengine/bevy/issues/5164.
MIRIFLAGS: -Zmiri-disable-isolation -Zmiri-ignore-leaks -Zmiri-permissive-provenance -Zmiri-disable-weak-memory-emulation

check-compiles:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 8f1f3bc

Please sign in to comment.