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

[Merged by Bors] - unpin nightly and disable weak memory emulation #4988

Conversation

mockersf
Copy link
Member

@mockersf mockersf commented Jun 11, 2022

Objective

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

@RalfJung
Copy link
Contributor

attempting a read access using <untagged> when you have -Zmiri-tag-raw-pointers set indicates an integer-to-pointer cast was used, which is not supported with raw pointer tagging.

@RalfJung
Copy link
Contributor

RalfJung commented Jun 11, 2022

If this is a new problem that started when updating Miri, it is probably caused by rust-lang/rust#97684: Miri got better at detecting when provenance should be lost.

If this hypothesis is correct, you can add -Zmiri-allow-ptr-int-transmute to make things work again. However, I want to remove that flag sooner rather than later (Cc rust-lang/miri#2188).

EDIT: No the regression range doesn't work out here; see my next comment.

@RalfJung
Copy link
Contributor

RalfJung commented Jun 11, 2022

This looks very much like once_cell is relying on integer-to-pointer casts. Maybe it could use the strict provenance APIs instead. :) Then you can keep the tag-raw-pointers. But as-is, this code does not work with raw ptr tagging, and I am not sure how it ever worked... maybe it was pure luck that the non-preemptive scheduler in Miri made it never use that code path? rust-lang/rust#97684 landed June 6th so if the 2022-06-08 Miri works then it's not that change. Therefore it probably is this Miri update, which is where the scheduler became preemptive. You could try -Zmiri-preemption-rate=0.

In rust-lang/miri#2133 we are tracking the progress towards making raw ptr tagging the default and making it work with integer-pointer casts.

@mockersf
Copy link
Member Author

@alice-i-cecile alice-i-cecile added A-Build-System Related to build systems or continuous integration C-Code-Quality A section of code that is hard to understand or change labels Jun 11, 2022
@RalfJung
Copy link
Contributor

RalfJung commented Jun 13, 2022

You have isolation disabled, so factors like how many environment variables exist can affect Miri's RNG and therefore its scheduler. Not sure if that is the problem here but it's possible.

If this is the reason then running it multiple times with different seeds will lead to failure in both repos:

for seed in $({ echo obase=16; seq 255; } | bc); do
  MIRIFLAGS="$MIRIFLAGS -Zmiri-seed=$seed" cargo miri test world || { echo "Last seed: $seed"; break; };
done

@RalfJung
Copy link
Contributor

I tried running these tests locally to see if our recent improved support for permissive provenance helps, but it seems like the test src/world/mod.rs - world::World (line 56) (the one that caused the problems above) just keeps running forever. I don't know bevy so I have no idea what this test is even doing. Any idea what might be going on?

@RalfJung
Copy link
Contributor

RalfJung commented Jun 26, 2022

Interestingly, this seems to be non-deterministic -- running the exact same command again sometimes terminates quickly and sometimes doesn't.

Miri with -Zmiri-disable-isolation is non-deterministic, but that indicates some kind of non-termination that depends on when exactly which thread is being preempteed (or, less likely, on allocation base addresses or weak memory loads).

I made Miri print a stacktrace every now and then, and the infinite loop seems to be somewhere inside here:

    --> /home/r/src/rust/tmp/bevy/crates/bevy_tasks/src/task_pool.rs:159:9
     |
159  | /         TaskPool::LOCAL_EXECUTOR.with(|local_executor| {
160  | |             // SAFETY: This function blocks until all futures complete, so this future must return
161  | |             // before this function returns. However, rust has no way of knowing
162  | |             // this so we must convert to 'static here to appease the compiler as it is unable to
...    |
215  | |             }
216  | |         })
     | |__________^
note: inside `<bevy_ecs::schedule::ParallelExecutor as bevy_ecs::schedule::ParallelSystemExecutor>::run_systems` at /home/r/src/rust/tmp/bevy/crates/bevy_ecs/src/schedule/executor_parallel.rs:126:9
    --> /home/r/src/rust/tmp/bevy/crates/bevy_ecs/src/schedule/executor_parallel.rs:126:9
     |
126  | /         ComputeTaskPool::init(TaskPool::default).scope(|scope| {
127  | |             self.prepare_systems(scope, systems, world);
128  | |             let parallel_executor = async {
129  | |                 // All systems have been ran if there are no queued or running systems.
...    |
155  | |             scope.spawn(parallel_executor);
156  | |         });
     | |__________^
note: inside `<bevy_ecs::schedule::SystemStage as bevy_ecs::schedule::Stage>::run` at /home/r/src/rust/tmp/bevy/crates/bevy_ecs/src/schedule/stage.rs:860:17
    --> /home/r/src/rust/tmp/bevy/crates/bevy_ecs/src/schedule/stage.rs:860:17
     |
860  |                 self.executor.run_systems(&mut self.parallel, world);
     |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside `bevy_ecs::schedule::Schedule::run_once` at /home/r/src/rust/tmp/bevy/crates/bevy_ecs/src/schedule/mod.rs:339:13
    --> /home/r/src/rust/tmp/bevy/crates/bevy_ecs/src/schedule/mod.rs:339:13
     |
339  |             stage.run(world);
     |             ^^^^^^^^^^^^^^^^
note: inside `main::_doctest_main_src_world_mod_rs_56_0` at src/world/mod.rs:25:1
    --> src/world/mod.rs:78:1
     |
25   | schedule.run_once(&mut world);
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

It is mostly here

   --> /home/r/src/rust/tmp/bevy/crates/bevy_tasks/src/task_pool.rs:208:43
    |
208 |                     if let Some(result) = future::block_on(future::poll_once(&mut spawned)) {
    |                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

and sometimes here

    --> /home/r/src/rust/tmp/bevy/crates/bevy_tasks/src/task_pool.rs:212:21
     |
212  |                     self.executor.try_tick();
     |                     ^^^^^^^^^^^^^^^^^^^^^^^^

So, it is probably unable to leave this loop:

loop {
if let Some(result) = future::block_on(future::poll_once(&mut spawned)) {
break result;
};
self.executor.try_tick();
local_executor.try_tick();
}

@RalfJung
Copy link
Contributor

RalfJung commented Jun 26, 2022

Interestingly, the loop disappears with -Zmiri-disable-weak-memory-emulation. This indicates there is insufficient synchronization somewhere: an atomic load reads an outdated value (because nothing forces the latest value to be read), and then the program takes a wrong turn and ends up in an infinite loop.

I think this is a bug somewhere in bevy, but it might also be a bug in Miri. Anyway for now I would recommend passing -Zmiri-disable-weak-memory-emulation, even though rust-lang/miri#2223 is fixed.

@mockersf
Copy link
Member Author

mockersf commented Jun 26, 2022

It's still failing randomly for me, with yesterday's nightly, even with -Zmiri-disable-weak-memory-emulation

It's always failing with seed 1:

RUSTFLAGS="-Zrandomize-layout" MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-ignore-leaks -Zmiri-tag-raw-pointers -Zmiri-seed=1 -Zmiri-disable-weak-memory-emulation" cargo +nightly miri test -p bevy_ecs

It passes with -Zmiri-seed=6

@RalfJung
Copy link
Contributor

RalfJung commented Jun 26, 2022

Trying many different seeds, I do not get a hang that way.

I do get a failure in once_cell though, but that is another problem:

error: Undefined Behavior: attempting a read access using <untagged> at alloc48095[0x8], but that tag does not exist in the borrow stack for this location
   --> /home/r/.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 alloc48095[0x8], but that tag does not exist in the borrow stack for this location
    |                            this error occurs as part of an access at alloc48095[0x8..0x10]
    |
    = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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
            
    = note: inside `<once_cell::imp::Guard as std::ops::Drop>::drop` at /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/once_cell-1.12.0/src/imp_std.rs:177:28
    = note: inside `std::ptr::drop_in_place::<once_cell::imp::Guard> - shim(Some(once_cell::imp::Guard))` at /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:487:1
    = note: inside `once_cell::imp::initialize_or_wait` at /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/once_cell-1.12.0/src/imp_std.rs:217:13
    = note: inside `once_cell::imp::OnceCell::<std::sync::Arc<async_executor::State>>::initialize::<[closure@once_cell::sync::OnceCell<std::sync::Arc<async_executor::State>>::get_or_init<[closure@async_executor::Executor::state::{closure#0}]>::{closure#0}], once_cell::sync::OnceCell<T>::get_or_init::Void>` at /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/once_cell-1.12.0/src/imp_std.rs:81:9
    = note: inside `once_cell::sync::OnceCell::<std::sync::Arc<async_executor::State>>::get_or_try_init::<[closure@once_cell::sync::OnceCell<std::sync::Arc<async_executor::State>>::get_or_init<[closure@async_executor::Executor::state::{closure#0}]>::{closure#0}], once_cell::sync::OnceCell<T>::get_or_init::Void>` at /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/once_cell-1.12.0/src/lib.rs:1063:13
    = note: inside `once_cell::sync::OnceCell::<std::sync::Arc<async_executor::State>>::get_or_init::<[closure@async_executor::Executor::state::{closure#0}]>` at /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/once_cell-1.12.0/src/lib.rs:1023:19
    = note: inside `async_executor::Executor::state` at /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/async-executor-1.4.1/src/lib.rs:258:9
    = note: inside `async_executor::Executor::spawn::<(), std::future::from_generator::GenFuture<[static generator@bevy_ecs::schedule::ParallelExecutor::prepare_systems::{closure#0}]>>` at /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/async-executor-1.4.1/src/lib.rs:131:26
note: inside `bevy_tasks::task_pool::Scope::<()>::spawn::<std::future::from_generator::GenFuture<[static generator@bevy_ecs::schedule::ParallelExecutor::prepare_systems::{closure#0}]>>` at /home/r/src/rust/tmp/bevy/crates/bevy_tasks/src/task_pool.rs:273:20
   --> /home/r/src/rust/tmp/bevy/crates/bevy_tasks/src/task_pool.rs:273:20
    |
273 |         let task = self.executor.spawn(f);
    |                    ^^^^^^^^^^^^^^^^^^^^^^

That failure is expected since you are passing -Zmiri-tag-raw-pointers and once_cell uses int2ptr casts.

@RalfJung
Copy link
Contributor

RalfJung commented Jun 26, 2022

Starting with the next nightly (not released yet), you can pass -Zmiri-permissive-provenance instead, which is our new and shiny way to support int2ptr casts. (It will become the default soon.)

To summarize, there are two problems:

  • once_cell fails with raw pointer tagging. This only shows up when preemption is enabled, since otherwise those codepaths are simply not executed. That is expected since once_cell uses int2ptr casts, and should be fixed by either dropping -Zmiri-tag-raw-pointers, or (starting with the next nightly) using -Zmiri-permissive-provenance instead.
  • The world::World (line 56) doctest sometimes hangs. I think there is an actual bug here somewhere (75% confidence it's in bevy). This can be worked around by passing -Zmiri-disable-weak-memory-emulation.

@mockersf mockersf force-pushed the fix-miri-disable-weak-memory-emulation branch from ef74578 to 3a14a5c Compare June 27, 2022 19:08
.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
Co-authored-by: Ralf Jung <post@ralfj.de>
.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
Co-authored-by: Ralf Jung <post@ralfj.de>
@cbeuw
Copy link

cbeuw commented Jun 27, 2022

These are all the outdated atomic reads in an infinite loop run.

diagnostics

Finished dev [unoptimized + debuginfo] target(s) in 0.04s
Running `/Users/andy/.cargo/bin/cargo-miri target/miri/x86_64-unknown-linux-gnu/debug/bevy`
note: tracking was triggered
--> /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/once_cell-1.12.0/src/imp_std.rs:67:9
|
67 |         self.queue.load(Ordering::Acquire) == COMPLETE
|         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ read outdated atomic value 0x0000000000000001
|
= note: inside `once_cell::imp::OnceCell::>::is_initialized` at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/once_cell-1.12.0/src/imp_std.rs:67:9
= note: inside `once_cell::sync::OnceCell::>::get` at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/once_cell-1.12.0/src/lib.rs:870:16
= note: inside `once_cell::sync::OnceCell::>::get_or_try_init::<[closure@once_cell::sync::OnceCell>::get_or_init<[closure@async_executor::Executor::state::{closure#0}]>::{closure#0}], once_cell::sync::OnceCell::get_or_init::Void>` at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/once_cell-1.12.0/src/lib.rs:1060:34
= note: inside `once_cell::sync::OnceCell::>::get_or_init::<[closure@async_executor::Executor::state::{closure#0}]>` at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/once_cell-1.12.0/src/lib.rs:1023:19
= note: inside `async_executor::Executor::state` at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/async-executor-1.4.1/src/lib.rs:258:9
= note: inside `async_executor::Executor::spawn::<(), std::future::from_generator::GenFuture<[static generator@bevy_ecs::schedule::ParallelExecutor::prepare_systems::{closure#0}]>>` at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/async-executor-1.4.1/src/lib.rs:131:26
= note: inside `bevy_tasks::task_pool::Scope::<()>::spawn::>` at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_tasks-0.7.0/src/task_pool.rs:291:20
= note: inside `bevy_ecs::schedule::ParallelExecutor::prepare_systems` at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_ecs-0.7.0/src/schedule/executor_parallel.rs:208:21
= note: inside closure at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_ecs-0.7.0/src/schedule/executor_parallel.rs:130:13
= note: inside closure at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_tasks-0.7.0/src/task_pool.rs:195:13
= note: inside `std::thread::LocalKey::::try_with::<[closure@bevy_tasks::task_pool::TaskPool::scope<[closure@::run_systems::{closure#1}], ()>::{closure#0}], std::vec::Vec<()>>` at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/thread/local.rs:445:16
= note: inside `std::thread::LocalKey::::with::<[closure@bevy_tasks::task_pool::TaskPool::scope<[closure@::run_systems::{closure#1}], ()>::{closure#0}], std::vec::Vec<()>>` at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/thread/local.rs:421:9
= note: inside `bevy_tasks::task_pool::TaskPool::scope::<[closure@::run_systems::{closure#1}], ()>` at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_tasks-0.7.0/src/task_pool.rs:180:9
= note: inside `::run_systems` at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_ecs-0.7.0/src/schedule/executor_parallel.rs:129:9
= note: inside `::run` at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_ecs-0.7.0/src/schedule/stage.rs:852:17
= note: inside `bevy_ecs::schedule::Schedule::run_once` at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_ecs-0.7.0/src/schedule/mod.rs:341:13
note: inside `main` at src/main.rs:25:5
--> src/main.rs:25:5
|
25 |     schedule.run_once(&mut world);
|     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

note: tracking was triggered
--> /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/once_cell-1.12.0/src/imp_std.rs:195:26
|
195 | let mut curr_queue = queue.load(Ordering::Acquire);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ read outdated atomic value 0x0000000000000001
|
= note: inside once_cell::imp::initialize_or_wait at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/once_cell-1.12.0/src/imp_std.rs:195:26
= note: inside once_cell::imp::OnceCell::<std::sync::Arc<async_executor::State>>::initialize::<[closure@once_cell::sync::OnceCell<std::sync::Arc<async_executor::State>>::get_or_init<[closure@async_executor::Executor::state::{closure#0}]>::{closure#0}], once_cell::sync::OnceCell<T>::get_or_init::Void> at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/once_cell-1.12.0/src/imp_std.rs:81:9
= note: inside once_cell::sync::OnceCell::<std::sync::Arc<async_executor::State>>::get_or_try_init::<[closure@once_cell::sync::OnceCell<std::sync::Arc<async_executor::State>>::get_or_init<[closure@async_executor::Executor::state::{closure#0}]>::{closure#0}], once_cell::sync::OnceCell<T>::get_or_init::Void> at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/once_cell-1.12.0/src/lib.rs:1063:13
= note: inside once_cell::sync::OnceCell::<std::sync::Arc<async_executor::State>>::get_or_init::<[closure@async_executor::Executor::state::{closure#0}]> at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/once_cell-1.12.0/src/lib.rs:1023:19
= note: inside async_executor::Executor::state at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/async-executor-1.4.1/src/lib.rs:258:9
= note: inside async_executor::Executor::spawn::<(), std::future::from_generator::GenFuture<[static generator@bevy_ecs::schedule::ParallelExecutor::prepare_systems::{closure#0}]>> at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/async-executor-1.4.1/src/lib.rs:131:26
= note: inside bevy_tasks::task_pool::Scope::<()>::spawn::<std::future::from_generator::GenFuture<[static generator@bevy_ecs::schedule::ParallelExecutor::prepare_systems::{closure#0}]>> at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_tasks-0.7.0/src/task_pool.rs:291:20
= note: inside bevy_ecs::schedule::ParallelExecutor::prepare_systems at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_ecs-0.7.0/src/schedule/executor_parallel.rs:208:21
= note: inside closure at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_ecs-0.7.0/src/schedule/executor_parallel.rs:130:13
= note: inside closure at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_tasks-0.7.0/src/task_pool.rs:195:13
= note: inside std::thread::LocalKey::<async_executor::LocalExecutor>::try_with::<[closure@bevy_tasks::task_pool::TaskPool::scope<[closure@<bevy_ecs::schedule::ParallelExecutor as bevy_ecs::schedule::ParallelSystemExecutor>::run_systems::{closure#1}], ()>::{closure#0}], std::vec::Vec<()>> at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/thread/local.rs:445:16
= note: inside std::thread::LocalKey::<async_executor::LocalExecutor>::with::<[closure@bevy_tasks::task_pool::TaskPool::scope<[closure@<bevy_ecs::schedule::ParallelExecutor as bevy_ecs::schedule::ParallelSystemExecutor>::run_systems::{closure#1}], ()>::{closure#0}], std::vec::Vec<()>> at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/thread/local.rs:421:9
= note: inside bevy_tasks::task_pool::TaskPool::scope::<[closure@<bevy_ecs::schedule::ParallelExecutor as bevy_ecs::schedule::ParallelSystemExecutor>::run_systems::{closure#1}], ()> at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_tasks-0.7.0/src/task_pool.rs:180:9
= note: inside <bevy_ecs::schedule::ParallelExecutor as bevy_ecs::schedule::ParallelSystemExecutor>::run_systems at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_ecs-0.7.0/src/schedule/executor_parallel.rs:129:9
= note: inside <bevy_ecs::schedule::SystemStage as bevy_ecs::schedule::Stage>::run at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_ecs-0.7.0/src/schedule/stage.rs:852:17
= note: inside bevy_ecs::schedule::Schedule::run_once at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_ecs-0.7.0/src/schedule/mod.rs:341:13
note: inside main at src/main.rs:25:5
--> src/main.rs:25:5
|
25 | schedule.run_once(&mut world);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

note: tracking was triggered
--> /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/concurrent-queue-1.2.2/src/unbounded.rs:222:24
|
222 | let mut head = self.head.index.load(Ordering::Acquire);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ read outdated atomic value 0x0000000000000000
|
= note: inside concurrent_queue::unbounded::Unbounded::<async_task::runnable::Runnable>::pop at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/concurrent-queue-1.2.2/src/unbounded.rs:222:24
= note: inside concurrent_queue::ConcurrentQueue::<async_task::runnable::Runnable>::pop at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/concurrent-queue-1.2.2/src/lib.rs:180:36
= note: inside closure at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/async-executor-1.4.1/src/lib.rs:765:32
= note: inside closure at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/async-executor-1.4.1/src/lib.rs:673:23
= note: inside <futures_lite::future::PollFn<[closure@async_executor::Ticker::runnable_with<[closure@async_executor::Runner::runnable::{closure#0}::{closure#0}]>::{closure#0}::{closure#0}]> as std::future::Future>::poll at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-lite-1.12.0/src/future.rs:246:9
= note: inside closure at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/async-executor-1.4.1/src/lib.rs:693:11
= note: inside <std::future::from_generator::GenFuture<[static generator@async_executor::Ticker::runnable_with<[closure@async_executor::Runner::runnable::{closure#0}::{closure#0}]>::{closure#0}]> as std::future::Future>::poll at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/future/mod.rs:91:19
= note: inside closure at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/async-executor-1.4.1/src/lib.rs:794:15
= note: inside <std::future::from_generator::GenFuture<[static generator@async_executor::Runner::runnable::{closure#0}]> as std::future::Future>::poll at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/future/mod.rs:91:19
= note: inside closure at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/async-executor-1.4.1/src/lib.rs:234:53
= note: inside <std::future::from_generator::GenFuture<[static generator@async_executor::Executor::run<std::result::Result<(), async_channel::RecvError>, async_channel::Recv<()>>::{closure#0}::{closure#0}]> as std::future::Future>::poll at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/future/mod.rs:91:19
= note: inside <futures_lite::future::Or<async_channel::Recv<()>, std::future::from_generator::GenFuture<[static generator@async_executor::Executor::run<std::result::Result<(), async_channel::RecvError>, async_channel::Recv<()>>::{closure#0}::{closure#0}]>> as std::future::Future>::poll at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-lite-1.12.0/src/future.rs:529:33
= note: inside closure at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/async-executor-1.4.1/src/lib.rs:242:31
= note: inside <std::future::from_generator::GenFuture<[static generator@async_executor::Executor::run<std::result::Result<(), async_channel::RecvError>, async_channel::Recv<()>>::{closure#0}]> as std::future::Future>::poll at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/future/mod.rs:91:19
= note: inside closure at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-lite-1.12.0/src/future.rs:89:27
= note: inside std::thread::LocalKey::<std::cell::RefCell<(parking::Parker, std::task::Waker)>>::try_with::<[closure@futures_lite::future::block_on<std::result::Result<(), async_channel::RecvError>, std::future::from_generator::GenFuture<[static generator@async_executor::Executor::run<std::result::Result<(), async_channel::RecvError>, async_channel::Recv<()>>::{closure#0}]>>::{closure#0}], std::result::Result<(), async_channel::RecvError>> at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/thread/local.rs:445:16
= note: inside std::thread::LocalKey::<std::cell::RefCell<(parking::Parker, std::task::Waker)>>::with::<[closure@futures_lite::future::block_on<std::result::Result<(), async_channel::RecvError>, std::future::from_generator::GenFuture<[static generator@async_executor::Executor::run<std::result::Result<(), async_channel::RecvError>, async_channel::Recv<()>>::{closure#0}]>>::{closure#0}], std::result::Result<(), async_channel::RecvError>> at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/thread/local.rs:421:9
= note: inside futures_lite::future::block_on::<std::result::Result<(), async_channel::RecvError>, std::future::from_generator::GenFuture<[static generator@async_executor::Executor::run<std::result::Result<(), async_channel::RecvError>, async_channel::Recv<()>>::{closure#0}]>> at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-lite-1.12.0/src/future.rs:79:5
= note: inside closure at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_tasks-0.7.0/src/task_pool.rs:150:25
= note: inside std::sys_common::backtrace::__rust_begin_short_backtrace::<[closure@bevy_tasks::task_pool::TaskPool::new_internal::{closure#0}::{closure#0}], ()> at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:122:18
= note: inside closure at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/thread/mod.rs:501:17
= note: inside <std::panic::AssertUnwindSafe<[closure@std::thread::Builder::spawn_unchecked_<[closure@bevy_tasks::task_pool::TaskPool::new_internal::{closure#0}::{closure#0}], ()>::{closure#1}::{closure#0}]> as std::ops::FnOnce<()>>::call_once at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/panic/unwind_safe.rs:271:9
= note: inside std::panicking::r#try::do_call::<std::panic::AssertUnwindSafe<[closure@std::thread::Builder::spawn_unchecked_<[closure@bevy_tasks::task_pool::TaskPool::new_internal::{closure#0}::{closure#0}], ()>::{closure#1}::{closure#0}]>, ()> at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/panicking.rs:492:40
= note: inside std::panicking::r#try::<(), std::panic::AssertUnwindSafe<[closure@std::thread::Builder::spawn_unchecked_<[closure@bevy_tasks::task_pool::TaskPool::new_internal::{closure#0}::{closure#0}], ()>::{closure#1}::{closure#0}]>> at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/panicking.rs:456:19
= note: inside std::panic::catch_unwind::<std::panic::AssertUnwindSafe<[closure@std::thread::Builder::spawn_unchecked_<[closure@bevy_tasks::task_pool::TaskPool::new_internal::{closure#0}::{closure#0}], ()>::{closure#1}::{closure#0}]>, ()> at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/panic.rs:137:14
= note: inside closure at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/thread/mod.rs:500:30
= note: inside <[closure@std::thread::Builder::spawn_unchecked_<[closure@bevy_tasks::task_pool::TaskPool::new_internal::{closure#0}::{closure#0}], ()>::{closure#1}] as std::ops::FnOnce<()>>::call_once - shim(vtable) at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/ops/function.rs:248:5
= note: inside <std::boxed::Box<dyn std::ops::FnOnce()> as std::ops::FnOnce<()>>::call_once at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/alloc/src/boxed.rs:1951:9
= note: inside <std::boxed::Box<std::boxed::Box<dyn std::ops::FnOnce()>> as std::ops::FnOnce<()>>::call_once at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/alloc/src/boxed.rs:1951:9
= note: inside std::sys::unix::thread::Thread::new::thread_start at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/sys/unix/thread.rs:108:17

note: tracking was triggered
--> /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/concurrent-queue-1.2.2/src/unbounded.rs:222:24
|
222 | let mut head = self.head.index.load(Ordering::Acquire);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ read outdated atomic value 0x0000000000000008
|
= note: inside concurrent_queue::unbounded::Unbounded::<async_task::runnable::Runnable>::pop at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/concurrent-queue-1.2.2/src/unbounded.rs:222:24
= note: inside concurrent_queue::ConcurrentQueue::<async_task::runnable::Runnable>::pop at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/concurrent-queue-1.2.2/src/lib.rs:180:36
= note: inside async_executor::Executor::try_tick at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/async-executor-1.4.1/src/lib.rs:173:15
= note: inside closure at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_tasks-0.7.0/src/task_pool.rs:233:21
= note: inside std::thread::LocalKey::<async_executor::LocalExecutor>::try_with::<[closure@bevy_tasks::task_pool::TaskPool::scope<[closure@<bevy_ecs::schedule::ParallelExecutor as bevy_ecs::schedule::ParallelSystemExecutor>::run_systems::{closure#1}], ()>::{closure#0}], std::vec::Vec<()>> at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/thread/local.rs:445:16
= note: inside std::thread::LocalKey::<async_executor::LocalExecutor>::with::<[closure@bevy_tasks::task_pool::TaskPool::scope<[closure@<bevy_ecs::schedule::ParallelExecutor as bevy_ecs::schedule::ParallelSystemExecutor>::run_systems::{closure#1}], ()>::{closure#0}], std::vec::Vec<()>> at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/thread/local.rs:421:9
= note: inside bevy_tasks::task_pool::TaskPool::scope::<[closure@<bevy_ecs::schedule::ParallelExecutor as bevy_ecs::schedule::ParallelSystemExecutor>::run_systems::{closure#1}], ()> at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_tasks-0.7.0/src/task_pool.rs:180:9
= note: inside <bevy_ecs::schedule::ParallelExecutor as bevy_ecs::schedule::ParallelSystemExecutor>::run_systems at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_ecs-0.7.0/src/schedule/executor_parallel.rs:129:9
= note: inside <bevy_ecs::schedule::SystemStage as bevy_ecs::schedule::Stage>::run at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_ecs-0.7.0/src/schedule/stage.rs:852:17
= note: inside bevy_ecs::schedule::Schedule::run_once at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_ecs-0.7.0/src/schedule/mod.rs:341:13
note: inside main at src/main.rs:25:5
--> src/main.rs:25:5
|
25 | schedule.run_once(&mut world);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

note: tracking was triggered
--> /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/async-task-4.2.0/src/raw.rs:251:25
|
251 | let mut state = (*raw.header).state.load(Ordering::Acquire);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ read outdated atomic value 0x0000000000000250
|
= note: inside async_task::raw::RawTask::<std::future::from_generator::GenFuture<[static generator@async_executor::Executor::spawn<(), std::future::from_generator::GenFuture<[static generator@bevy_ecs::schedule::ParallelExecutor::prepare_systems::{closure#0}]>>::{closure#0}]>, (), [closure@async_executor::Executor::schedule::{closure#0}]>::wake_by_ref at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/async-task-4.2.0/src/raw.rs:251:25
= note: inside async_task::raw::RawTask::<std::future::from_generator::GenFuture<[static generator@async_executor::Executor::spawn<(), std::future::from_generator::GenFuture<[static generator@bevy_ecs::schedule::ParallelExecutor::prepare_systems::{closure#0}]>>::{closure#0}]>, (), [closure@async_executor::Executor::schedule::{closure#0}]>::wake at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/async-task-4.2.0/src/raw.rs:186:13
= note: inside std::task::Waker::wake at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/task/wake.rs:248:18
= note: inside event_listener::List::notify at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/event-listener-2.5.2/src/lib.rs:930:46
= note: inside event_listener::Event::notify at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/event-listener-2.5.2/src/lib.rs:224:17
= note: inside async_channel::Sender::<()>::try_send at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/async-channel-1.6.1/src/lib.rs:203:17
= note: inside <async_channel::Send<()> as std::future::Future>::poll at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/async-channel-1.6.1/src/lib.rs:906:19
= note: inside closure at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_ecs-0.7.0/src/schedule/executor_parallel.rs:251:30
= note: inside <std::future::from_generator::GenFuture<[static generator@bevy_ecs::schedule::ParallelExecutor::process_queued_systems::{closure#0}]> as std::future::Future>::poll at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/future/mod.rs:91:19
= note: inside closure at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_ecs-0.7.0/src/schedule/executor_parallel.rs:134:50
= note: inside <std::future::from_generator::GenFuture<[static generator@<bevy_ecs::schedule::ParallelExecutor as bevy_ecs::schedule::ParallelSystemExecutor>::run_systems::{closure#1}::{closure#0}]> as std::future::Future>::poll at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/future/mod.rs:91:19
= note: inside closure at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/async-executor-1.4.1/src/lib.rs:144:19
= note: inside <std::future::from_generator::GenFuture<[static generator@async_executor::Executor::spawn<(), std::future::from_generator::GenFuture<[static generator@<bevy_ecs::schedule::ParallelExecutor as bevy_ecs::schedule::ParallelSystemExecutor>::run_systems::{closure#1}::{closure#0}]>>::{closure#0}]> as std::future::Future>::poll at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/future/mod.rs:91:19
= note: inside async_task::raw::RawTask::<std::future::from_generator::GenFuture<[static generator@async_executor::Executor::spawn<(), std::future::from_generator::GenFuture<[static generator@<bevy_ecs::schedule::ParallelExecutor as bevy_ecs::schedule::ParallelSystemExecutor>::run_systems::{closure#1}::{closure#0}]>>::{closure#0}]>, (), [closure@async_executor::Executor::schedule::{closure#0}]>::run at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/async-task-4.2.0/src/raw.rs:489:20
= note: inside async_task::runnable::Runnable::run at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/async-task-4.2.0/src/runnable.rs:309:18
= note: inside closure at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/async-executor-1.4.1/src/lib.rs:235:21
= note: inside <std::future::from_generator::GenFuture<[static generator@async_executor::Executor::run<std::result::Result<(), async_channel::RecvError>, async_channel::Recv<()>>::{closure#0}::{closure#0}]> as std::future::Future>::poll at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/future/mod.rs:91:19
= note: inside <futures_lite::future::Or<async_channel::Recv<()>, std::future::from_generator::GenFuture<[static generator@async_executor::Executor::run<std::result::Result<(), async_channel::RecvError>, async_channel::Recv<()>>::{closure#0}::{closure#0}]>> as std::future::Future>::poll at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-lite-1.12.0/src/future.rs:529:33
= note: inside closure at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/async-executor-1.4.1/src/lib.rs:242:31
= note: inside <std::future::from_generator::GenFuture<[static generator@async_executor::Executor::run<std::result::Result<(), async_channel::RecvError>, async_channel::Recv<()>>::{closure#0}]> as std::future::Future>::poll at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/future/mod.rs:91:19
= note: inside closure at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-lite-1.12.0/src/future.rs:89:27
= note: inside std::thread::LocalKey::<std::cell::RefCell<(parking::Parker, std::task::Waker)>>::try_with::<[closure@futures_lite::future::block_on<std::result::Result<(), async_channel::RecvError>, std::future::from_generator::GenFuture<[static generator@async_executor::Executor::run<std::result::Result<(), async_channel::RecvError>, async_channel::Recv<()>>::{closure#0}]>>::{closure#0}], std::result::Result<(), async_channel::RecvError>> at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/thread/local.rs:445:16
= note: inside std::thread::LocalKey::<std::cell::RefCell<(parking::Parker, std::task::Waker)>>::with::<[closure@futures_lite::future::block_on<std::result::Result<(), async_channel::RecvError>, std::future::from_generator::GenFuture<[static generator@async_executor::Executor::run<std::result::Result<(), async_channel::RecvError>, async_channel::Recv<()>>::{closure#0}]>>::{closure#0}], std::result::Result<(), async_channel::RecvError>> at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/thread/local.rs:421:9
= note: inside futures_lite::future::block_on::<std::result::Result<(), async_channel::RecvError>, std::future::from_generator::GenFuture<[static generator@async_executor::Executor::run<std::result::Result<(), async_channel::RecvError>, async_channel::Recv<()>>::{closure#0}]>> at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-lite-1.12.0/src/future.rs:79:5
= note: inside closure at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_tasks-0.7.0/src/task_pool.rs:150:25
= note: inside std::sys_common::backtrace::__rust_begin_short_backtrace::<[closure@bevy_tasks::task_pool::TaskPool::new_internal::{closure#0}::{closure#0}], ()> at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:122:18
= note: inside closure at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/thread/mod.rs:501:17
= note: inside <std::panic::AssertUnwindSafe<[closure@std::thread::Builder::spawn_unchecked_<[closure@bevy_tasks::task_pool::TaskPool::new_internal::{closure#0}::{closure#0}], ()>::{closure#1}::{closure#0}]> as std::ops::FnOnce<()>>::call_once at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/panic/unwind_safe.rs:271:9
= note: inside std::panicking::r#try::do_call::<std::panic::AssertUnwindSafe<[closure@std::thread::Builder::spawn_unchecked_<[closure@bevy_tasks::task_pool::TaskPool::new_internal::{closure#0}::{closure#0}], ()>::{closure#1}::{closure#0}]>, ()> at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/panicking.rs:492:40
= note: inside std::panicking::r#try::<(), std::panic::AssertUnwindSafe<[closure@std::thread::Builder::spawn_unchecked_<[closure@bevy_tasks::task_pool::TaskPool::new_internal::{closure#0}::{closure#0}], ()>::{closure#1}::{closure#0}]>> at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/panicking.rs:456:19
= note: inside std::panic::catch_unwind::<std::panic::AssertUnwindSafe<[closure@std::thread::Builder::spawn_unchecked_<[closure@bevy_tasks::task_pool::TaskPool::new_internal::{closure#0}::{closure#0}], ()>::{closure#1}::{closure#0}]>, ()> at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/panic.rs:137:14
= note: inside closure at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/thread/mod.rs:500:30
= note: inside <[closure@std::thread::Builder::spawn_unchecked_<[closure@bevy_tasks::task_pool::TaskPool::new_internal::{closure#0}::{closure#0}], ()>::{closure#1}] as std::ops::FnOnce<()>>::call_once - shim(vtable) at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/ops/function.rs:248:5
= note: inside <std::boxed::Box<dyn std::ops::FnOnce()> as std::ops::FnOnce<()>>::call_once at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/alloc/src/boxed.rs:1951:9
= note: inside <std::boxed::Box<std::boxed::Box<dyn std::ops::FnOnce()>> as std::ops::FnOnce<()>>::call_once at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/alloc/src/boxed.rs:1951:9
= note: inside std::sys::unix::thread::Thread::new::thread_start at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/sys/unix/thread.rs:108:17

note: tracking was triggered
--> /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/concurrent-queue-1.2.2/src/unbounded.rs:47:15
|
47 | while self.state.load(Ordering::Acquire) & WRITE == 0 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ read outdated atomic value 0x0000000000000000
|
= note: inside concurrent_queue::unbounded::Slot::<async_task::runnable::Runnable>::wait_write at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/concurrent-queue-1.2.2/src/unbounded.rs:47:15
= note: inside concurrent_queue::unbounded::Unbounded::<async_task::runnable::Runnable>::pop at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/concurrent-queue-1.2.2/src/unbounded.rs:289:21
= note: inside concurrent_queue::ConcurrentQueue::<async_task::runnable::Runnable>::pop at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/concurrent-queue-1.2.2/src/lib.rs:180:36
= note: inside async_executor::Executor::try_tick at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/async-executor-1.4.1/src/lib.rs:173:15
= note: inside closure at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_tasks-0.7.0/src/task_pool.rs:233:21
= note: inside std::thread::LocalKey::<async_executor::LocalExecutor>::try_with::<[closure@bevy_tasks::task_pool::TaskPool::scope<[closure@<bevy_ecs::schedule::ParallelExecutor as bevy_ecs::schedule::ParallelSystemExecutor>::run_systems::{closure#1}], ()>::{closure#0}], std::vec::Vec<()>> at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/thread/local.rs:445:16
= note: inside std::thread::LocalKey::<async_executor::LocalExecutor>::with::<[closure@bevy_tasks::task_pool::TaskPool::scope<[closure@<bevy_ecs::schedule::ParallelExecutor as bevy_ecs::schedule::ParallelSystemExecutor>::run_systems::{closure#1}], ()>::{closure#0}], std::vec::Vec<()>> at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/thread/local.rs:421:9
= note: inside bevy_tasks::task_pool::TaskPool::scope::<[closure@<bevy_ecs::schedule::ParallelExecutor as bevy_ecs::schedule::ParallelSystemExecutor>::run_systems::{closure#1}], ()> at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_tasks-0.7.0/src/task_pool.rs:180:9
= note: inside <bevy_ecs::schedule::ParallelExecutor as bevy_ecs::schedule::ParallelSystemExecutor>::run_systems at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_ecs-0.7.0/src/schedule/executor_parallel.rs:129:9
= note: inside <bevy_ecs::schedule::SystemStage as bevy_ecs::schedule::Stage>::run at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_ecs-0.7.0/src/schedule/stage.rs:852:17
= note: inside bevy_ecs::schedule::Schedule::run_once at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_ecs-0.7.0/src/schedule/mod.rs:341:13
note: inside main at src/main.rs:25:5
--> src/main.rs:25:5
|
25 | schedule.run_once(&mut world);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

note: tracking was triggered
--> /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/concurrent-queue-1.2.2/src/unbounded.rs:241:28
|
241 | let tail = self.tail.index.load(Ordering::Relaxed);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ read outdated atomic value 0x0000000000000002
|
= note: inside concurrent_queue::unbounded::Unbounded::<usize>::pop at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/concurrent-queue-1.2.2/src/unbounded.rs:241:28
= note: inside concurrent_queue::ConcurrentQueue::<usize>::pop at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/concurrent-queue-1.2.2/src/lib.rs:180:36
= note: inside async_channel::Receiver::<usize>::try_recv at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/async-channel-1.6.1/src/lib.rs:469:15
= note: inside <async_channel::Recv<usize> as std::future::Future>::poll at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/async-channel-1.6.1/src/lib.rs:959:19
= note: inside closure at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_ecs-0.7.0/src/schedule/executor_parallel.rs:140:36
= note: inside <std::future::from_generator::GenFuture<[static generator@<bevy_ecs::schedule::ParallelExecutor as bevy_ecs::schedule::ParallelSystemExecutor>::run_systems::{closure#1}::{closure#0}]> as std::future::Future>::poll at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/future/mod.rs:91:19
= note: inside closure at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/async-executor-1.4.1/src/lib.rs:144:19
= note: inside <std::future::from_generator::GenFuture<[static generator@async_executor::Executor::spawn<(), std::future::from_generator::GenFuture<[static generator@<bevy_ecs::schedule::ParallelExecutor as bevy_ecs::schedule::ParallelSystemExecutor>::run_systems::{closure#1}::{closure#0}]>>::{closure#0}]> as std::future::Future>::poll at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/future/mod.rs:91:19
= note: inside async_task::raw::RawTask::<std::future::from_generator::GenFuture<[static generator@async_executor::Executor::spawn<(), std::future::from_generator::GenFuture<[static generator@<bevy_ecs::schedule::ParallelExecutor as bevy_ecs::schedule::ParallelSystemExecutor>::run_systems::{closure#1}::{closure#0}]>>::{closure#0}]>, (), [closure@async_executor::Executor::schedule::{closure#0}]>::run at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/async-task-4.2.0/src/raw.rs:489:20
= note: inside async_task::runnable::Runnable::run at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/async-task-4.2.0/src/runnable.rs:309:18
= note: inside closure at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/async-executor-1.4.1/src/lib.rs:235:21
= note: inside <std::future::from_generator::GenFuture<[static generator@async_executor::Executor::run<std::result::Result<(), async_channel::RecvError>, async_channel::Recv<()>>::{closure#0}::{closure#0}]> as std::future::Future>::poll at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/future/mod.rs:91:19
= note: inside <futures_lite::future::Or<async_channel::Recv<()>, std::future::from_generator::GenFuture<[static generator@async_executor::Executor::run<std::result::Result<(), async_channel::RecvError>, async_channel::Recv<()>>::{closure#0}::{closure#0}]>> as std::future::Future>::poll at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-lite-1.12.0/src/future.rs:529:33
= note: inside closure at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/async-executor-1.4.1/src/lib.rs:242:31
= note: inside <std::future::from_generator::GenFuture<[static generator@async_executor::Executor::run<std::result::Result<(), async_channel::RecvError>, async_channel::Recv<()>>::{closure#0}]> as std::future::Future>::poll at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/future/mod.rs:91:19
= note: inside closure at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-lite-1.12.0/src/future.rs:89:27
= note: inside std::thread::LocalKey::<std::cell::RefCell<(parking::Parker, std::task::Waker)>>::try_with::<[closure@futures_lite::future::block_on<std::result::Result<(), async_channel::RecvError>, std::future::from_generator::GenFuture<[static generator@async_executor::Executor::run<std::result::Result<(), async_channel::RecvError>, async_channel::Recv<()>>::{closure#0}]>>::{closure#0}], std::result::Result<(), async_channel::RecvError>> at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/thread/local.rs:445:16
= note: inside std::thread::LocalKey::<std::cell::RefCell<(parking::Parker, std::task::Waker)>>::with::<[closure@futures_lite::future::block_on<std::result::Result<(), async_channel::RecvError>, std::future::from_generator::GenFuture<[static generator@async_executor::Executor::run<std::result::Result<(), async_channel::RecvError>, async_channel::Recv<()>>::{closure#0}]>>::{closure#0}], std::result::Result<(), async_channel::RecvError>> at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/thread/local.rs:421:9
= note: inside futures_lite::future::block_on::<std::result::Result<(), async_channel::RecvError>, std::future::from_generator::GenFuture<[static generator@async_executor::Executor::run<std::result::Result<(), async_channel::RecvError>, async_channel::Recv<()>>::{closure#0}]>> at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-lite-1.12.0/src/future.rs:79:5
= note: inside closure at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_tasks-0.7.0/src/task_pool.rs:150:25
= note: inside std::sys_common::backtrace::__rust_begin_short_backtrace::<[closure@bevy_tasks::task_pool::TaskPool::new_internal::{closure#0}::{closure#0}], ()> at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:122:18
= note: inside closure at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/thread/mod.rs:501:17
= note: inside <std::panic::AssertUnwindSafe<[closure@std::thread::Builder::spawn_unchecked_<[closure@bevy_tasks::task_pool::TaskPool::new_internal::{closure#0}::{closure#0}], ()>::{closure#1}::{closure#0}]> as std::ops::FnOnce<()>>::call_once at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/panic/unwind_safe.rs:271:9
= note: inside std::panicking::r#try::do_call::<std::panic::AssertUnwindSafe<[closure@std::thread::Builder::spawn_unchecked_<[closure@bevy_tasks::task_pool::TaskPool::new_internal::{closure#0}::{closure#0}], ()>::{closure#1}::{closure#0}]>, ()> at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/panicking.rs:492:40
= note: inside std::panicking::r#try::<(), std::panic::AssertUnwindSafe<[closure@std::thread::Builder::spawn_unchecked_<[closure@bevy_tasks::task_pool::TaskPool::new_internal::{closure#0}::{closure#0}], ()>::{closure#1}::{closure#0}]>> at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/panicking.rs:456:19
= note: inside std::panic::catch_unwind::<std::panic::AssertUnwindSafe<[closure@std::thread::Builder::spawn_unchecked_<[closure@bevy_tasks::task_pool::TaskPool::new_internal::{closure#0}::{closure#0}], ()>::{closure#1}::{closure#0}]>, ()> at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/panic.rs:137:14
= note: inside closure at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/thread/mod.rs:500:30
= note: inside <[closure@std::thread::Builder::spawn_unchecked_<[closure@bevy_tasks::task_pool::TaskPool::new_internal::{closure#0}::{closure#0}], ()>::{closure#1}] as std::ops::FnOnce<()>>::call_once - shim(vtable) at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/ops/function.rs:248:5
= note: inside <std::boxed::Box<dyn std::ops::FnOnce()> as std::ops::FnOnce<()>>::call_once at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/alloc/src/boxed.rs:1951:9
= note: inside <std::boxed::Box<std::boxed::Box<dyn std::ops::FnOnce()>> as std::ops::FnOnce<()>>::call_once at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/alloc/src/boxed.rs:1951:9
= note: inside std::sys::unix::thread::Thread::new::thread_start at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/sys/unix/thread.rs:108:17

note: tracking was triggered
--> /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/async-task-4.2.0/src/task.rs:321:29
|
321 | let mut state = (*header).state.load(Ordering::Acquire);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ read outdated atomic value 0x0000000000000312
|
= note: inside async_task::task::Task::<()>::poll_task at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/async-task-4.2.0/src/task.rs:321:29
= note: inside <async_task::task::Task<()> as std::future::Future>::poll at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/async-task-4.2.0/src/task.rs:424:15
= note: inside closure at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_tasks-0.7.0/src/task_pool.rs:205:42
= note: inside <std::future::from_generator::GenFuture<[static generator@bevy_tasks::task_pool::TaskPool::scope<[closure@<bevy_ecs::schedule::ParallelExecutor as bevy_ecs::schedule::ParallelSystemExecutor>::run_systems::{closure#1}], ()>::{closure#0}::{closure#0}]> as std::future::Future>::poll at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/future/mod.rs:91:19
= note: inside <std::pin::Pin<&mut dyn std::future::Future<Output = std::vec::Vec<()>>> as std::future::Future>::poll at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/future/future.rs:124:9
= note: inside closure at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/async-executor-1.4.1/src/lib.rs:376:19
= note: inside <std::future::from_generator::GenFuture<[static generator@async_executor::LocalExecutor::spawn<std::vec::Vec<()>, std::pin::Pin<&mut dyn std::future::Future<Output = std::vec::Vec<()>>>>::{closure#0}]> as std::future::Future>::poll at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/future/mod.rs:91:19
= note: inside async_task::raw::RawTask::<std::future::from_generator::GenFuture<[static generator@async_executor::LocalExecutor::spawn<std::vec::Vec<()>, std::pin::Pin<&mut dyn std::future::Future<Output = std::vec::Vec<()>>>>::{closure#0}]>, std::vec::Vec<()>, [closure@async_executor::LocalExecutor::schedule::{closure#0}]>::run at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/async-task-4.2.0/src/raw.rs:489:20
= note: inside async_task::runnable::Runnable::run at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/async-task-4.2.0/src/runnable.rs:309:18
= note: inside async_executor::Executor::try_tick at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/async-executor-1.4.1/src/lib.rs:181:17
= note: inside async_executor::LocalExecutor::try_tick at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/async-executor-1.4.1/src/lib.rs:405:9
= note: inside closure at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_tasks-0.7.0/src/task_pool.rs:234:21
= note: inside std::thread::LocalKey::<async_executor::LocalExecutor>::try_with::<[closure@bevy_tasks::task_pool::TaskPool::scope<[closure@<bevy_ecs::schedule::ParallelExecutor as bevy_ecs::schedule::ParallelSystemExecutor>::run_systems::{closure#1}], ()>::{closure#0}], std::vec::Vec<()>> at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/thread/local.rs:445:16
= note: inside std::thread::LocalKey::<async_executor::LocalExecutor>::with::<[closure@bevy_tasks::task_pool::TaskPool::scope<[closure@<bevy_ecs::schedule::ParallelExecutor as bevy_ecs::schedule::ParallelSystemExecutor>::run_systems::{closure#1}], ()>::{closure#0}], std::vec::Vec<()>> at /Users/andy/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/thread/local.rs:421:9
= note: inside bevy_tasks::task_pool::TaskPool::scope::<[closure@<bevy_ecs::schedule::ParallelExecutor as bevy_ecs::schedule::ParallelSystemExecutor>::run_systems::{closure#1}], ()> at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_tasks-0.7.0/src/task_pool.rs:180:9
= note: inside <bevy_ecs::schedule::ParallelExecutor as bevy_ecs::schedule::ParallelSystemExecutor>::run_systems at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_ecs-0.7.0/src/schedule/executor_parallel.rs:129:9
= note: inside <bevy_ecs::schedule::SystemStage as bevy_ecs::schedule::Stage>::run at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_ecs-0.7.0/src/schedule/stage.rs:852:17
= note: inside bevy_ecs::schedule::Schedule::run_once at /Users/andy/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_ecs-0.7.0/src/schedule/mod.rs:341:13
note: inside main at src/main.rs:25:5
--> src/main.rs:25:5
|
25 | schedule.run_once(&mut world);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

These lines in concurrent-queue are very sus https://github.com/smol-rs/concurrent-queue/blob/cefe5efc4265ac7d6ef4287585288441e290afc5/src/unbounded.rs#L239-L241

            if new_head & MARK_BIT == 0 {
                crate::full_fence();
                let tail = self.tail.index.load(Ordering::Relaxed);

This is the same pattern as crossbeam-rs/crossbeam#838 (crate::full_fence() here is a SeqCst fence).

It is never right to put an Acquire/Release fence before an atomic load (fence must come after the load to cause any synchronisation). Putting a SeqCst fence before an atomic load can sometimes be useful but there has to be a paired SeqCst fence or store on the same location, but this does not provide synchronisation. There is no other fence in unbounded.rs and the only store to tail.index is Release. (nvm I missed a SeqCst compare exchange, though there is still no synchornisation.)

I don't know if this is the cause of this bevy issue (I'll expriment further tomorrow unless someone else beats me to it), but this fence is probably useless not doing enough.

cc @taiki-e

.github/workflows/ci.yml Outdated Show resolved Hide resolved
@RalfJung
Copy link
Contributor

RalfJung commented Jul 1, 2022

@alice-i-cecile so what needs to happen to land this? Other than linking to the issue tracking the infinite loop problem, this looks all good to me.

Co-authored-by: Ralf Jung <post@ralfj.de>
@mockersf
Copy link
Member Author

mockersf commented Jul 1, 2022

@alice-i-cecile so what needs to happen to land this? Other than linking to the issue tracking the infinite loop problem, this looks all good to me.

It needs to be approved by at least 2 persons. You can be one of them 🙂

Copy link
Contributor

@RalfJung RalfJung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a bevy contributor, but sure, I approve. ;)

@alice-i-cecile
Copy link
Member

By virtue of your assistance you are now ;)

@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Jul 1, 2022
@alice-i-cecile
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Jul 1, 2022
# Objective

- Follow suggestion from #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
@mockersf
Copy link
Member Author

mockersf commented Jul 1, 2022

I'm not a bevy contributor, but sure, I approve. ;)

Bevy contributor is not strictly defined as "having committed to the repo". Reviewing PRs or opening issues make you a contributor too 🙂
The contributing guide also calls out for two reviews from members with appropriate expertise, and I think you have here 👍

@bors bors bot changed the title unpin nightly and disable weak memory emulation [Merged by Bors] - unpin nightly and disable weak memory emulation Jul 1, 2022
@bors bors bot closed this Jul 1, 2022
inodentry pushed a commit to IyesGames/bevy that referenced this pull request Aug 8, 2022
# 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
james7132 pushed a commit to james7132/bevy that referenced this pull request Oct 28, 2022
# 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
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
# 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Build-System Related to build systems or continuous integration C-Code-Quality A section of code that is hard to understand or change S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants