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

Undefined behavior when encoding AVIF image #2108

Open
astral4 opened this issue Jan 15, 2024 · 19 comments
Open

Undefined behavior when encoding AVIF image #2108

astral4 opened this issue Jan 15, 2024 · 19 comments

Comments

@astral4
Copy link
Contributor

astral4 commented Jan 15, 2024

This happens with version 0.24.8. I am using a M1 MacBook Pro with rustc 1.75.0 (82e1608df 2023-12-21).

Running the program that brings up this issue results in zsh: illegal hardware instruction.

Miri output

The output of cargo +nightly miri run (using rustc 1.77.0-nightly (2319be8e2 2024-01-12)) is:

Preparing a sysroot for Miri (target: aarch64-apple-darwin)... done
     Running `/Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/bin/cargo-miri runner target/miri/aarch64-apple-darwin/debug/image-test`
error: Undefined Behavior: trying to retag from <9426063> for SharedReadOnly permission at alloc2467356[0x4], but that tag does not exist in the borrow stack for this location
   --> /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/slice/raw.rs:102:9
    |
102 |         &*ptr::slice_from_raw_parts(data, len)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |         |
    |         trying to retag from <9426063> for SharedReadOnly permission at alloc2467356[0x4], but that tag does not exist in the borrow stack for this location
    |         this error occurs as part of retag at alloc2467356[0x0..0xc]
    |
    = 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
help: <9426063> was created by a SharedReadOnly retag at offsets [0x0..0x4]
   --> src/main.rs:13:10
    |
13  |     drop(AvifEncoder::new(sink()).write_image(&img, img.width(), img.height(), ColorType::Rgba8));
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: BACKTRACE (of the first span):
    = note: inside `std::slice::from_raw_parts::<'_, rgb::RGBA<u8>>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/slice/raw.rs:102:9: 102:47
    = note: inside `<loop9::Triple<rgb::RGBA<u8>> as std::convert::AsRef<[rgb::RGBA<u8>]>>::as_ref` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/loop9-0.1.4/src/lib.rs:25:13: 25:54
    = note: inside `<loop9::Triple<rgb::RGBA<u8>> as std::ops::Deref>::deref` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/loop9-0.1.4/src/lib.rs:35:9: 35:22
    = note: inside `ravif::dirtyalpha::chain::<rgb::RGBA<u8>>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ravif-0.11.4/src/dirtyalpha.rs:108:5: 108:15
    = note: inside closure at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ravif-0.11.4/src/dirtyalpha.rs:31:12: 31:35
    = note: inside `loop9::loop9::<rgb::RGBA<u8>, {closure@ravif::dirtyalpha::blurred_dirty_alpha::{closure#0}}>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/loop9-0.1.4/src/lib.rs:115:13: 115:105
    = note: inside `loop9::loop9_img::<rgb::RGBA<u8>, {closure@ravif::dirtyalpha::blurred_dirty_alpha::{closure#0}}>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/loop9-0.1.4/src/lib.rs:62:5: 62:52
    = note: inside `ravif::dirtyalpha::blurred_dirty_alpha` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ravif-0.11.4/src/dirtyalpha.rs:27:5: 36:7
    = note: inside `ravif::av1encoder::Encoder::convert_alpha` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ravif-0.11.4/src/av1encoder.rs:236:17: 236:47
    = note: inside `ravif::av1encoder::Encoder::encode_rgba` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ravif-0.11.4/src/av1encoder.rs:188:25: 188:54
    = note: inside `<image::codecs::avif::AvifEncoder<std::io::Sink> as image::ImageEncoder>::write_image` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/image-0.24.8/src/codecs/avif/encoder.rs:118:40: 118:72
note: inside `main`
   --> src/main.rs:13:10
    |
13  |     drop(AvifEncoder::new(sink()).write_image(&img, img.width(), img.height(), ColorType::Rgba8));
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

error: aborting due to 1 previous error

Reproduction steps

  1. Clone this repository: https://github.com/astral4/image-test
  2. Run cargo run --release

I only observed UB on release builds with panic = "abort" and lto = true, but Miri still reports UB otherwise.

@fintelia
Copy link
Contributor

Seems that miri thinks the loop9 crate itself has unsoundness. Simply doing:

loop9::Triple::new(1u8, 2, 3).as_ref();

Produces:

error: Undefined Behavior: trying to retag from <1689> for SharedReadOnly permission at alloc828[0x1], but that tag does not exist in the borrow stack for this location
   --> /home/jonathan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/raw.rs:102:9
    |
102 |         &*ptr::slice_from_raw_parts(data, len)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |         |
    |         trying to retag from <1689> for SharedReadOnly permission at alloc828[0x1], but that tag does not exist in the borrow stack for this location
    |         this error occurs as part of retag at alloc828[0x0..0x3]
    |
    = 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
help: <1689> was created by a SharedReadOnly retag at offsets [0x0..0x1]
   --> src/main.rs:2:5
    |
2   | /     loop9::Triple::new(1u8, 2, 3)
3   | |         .as_ref();
    | |_________________^
    = note: BACKTRACE (of the first span):
    = note: inside `std::slice::from_raw_parts::<'_, u8>` at /home/jonathan/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/raw.rs:102:9: 102:47
    = note: inside `<loop9::Triple<u8> as std::convert::AsRef<[u8]>>::as_ref` at /home/jonathan/.cargo/registry/src/index.crates.io-6f17d22bba15001f/loop9-0.1.4/src/lib.rs:25:13: 25:54
note: inside `main`
   --> src/main.rs:2:5
    |
2   | /     loop9::Triple::new(1u8, 2, 3)
3   | |         .as_ref();
    | |_________________^

note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

However, there doesn't seem to be a git repository linked from the crate page to create an issue against.

@kornelski, since you're listed as the crate owner, could you take a look?

@kornelski
Copy link
Contributor

I've updated the crate. It didn't like me using address of the first field as the address of the struct. So I don't think there's any actual problem there, since the two pointers are numerically the same, it takes miri to spot the difference.

@astral4
Copy link
Contributor Author

astral4 commented Jan 15, 2024

I updated the repository reproducing this issue to use loop9 0.1.5, but I still get zsh: illegal hardware instruction. (I also replaced the test image to speed up Miri runs.) Miri still reports UB, but now it is in the crossbeam-epoch crate. The output of cargo +nightly miri run is:

Output
Preparing a sysroot for Miri (target: aarch64-apple-darwin)... done
     Running `/Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/bin/cargo-miri runner target/miri/aarch64-apple-darwin/debug/image-test`
warning: integer-to-pointer cast
   --> /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/atomic.rs:204:11
    |
204 |         &*(ptr as *const T)
    |           ^^^^^^^^^^^^^^^^^ integer-to-pointer cast
    |
    = help: This program is using integer-to-pointer casts or (equivalently) `ptr::from_exposed_addr`,
    = help: which means that Miri might miss pointer bugs in this program.
    = help: See https://doc.rust-lang.org/nightly/std/ptr/fn.from_exposed_addr.html for more details on that operation.
    = help: To ensure that Miri does not miss bugs in your program, use Strict Provenance APIs (https://doc.rust-lang.org/nightly/std/ptr/index.html#strict-provenance, https://crates.io/crates/sptr) instead.
    = help: You can then pass the `-Zmiri-strict-provenance` flag to Miri, to ensure you are not relying on `from_exposed_addr` semantics.
    = help: Alternatively, the `-Zmiri-permissive-provenance` flag disables this warning.
    = note: BACKTRACE:
    = note: inside `<crossbeam_epoch::internal::Local as crossbeam_epoch::atomic::Pointable>::deref::<'_>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/atomic.rs:204:11: 204:28
    = note: inside `crossbeam_epoch::atomic::Shared::<'_, crossbeam_epoch::internal::Local>::deref` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/atomic.rs:1421:9: 1421:22
    = note: inside `crossbeam_epoch::sync::list::List::<crossbeam_epoch::internal::Local>::insert` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/sync/list.rs:176:41: 176:58
    = note: inside `crossbeam_epoch::internal::Local::register` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/internal.rs:330:13: 330:65
    = note: inside `crossbeam_epoch::collector::Collector::register` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/collector.rs:45:9: 45:30
    = note: inside `crossbeam_epoch::default::HANDLE::__init` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/default.rs:34:34: 34:56
    = note: inside closure at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/common/thread_local/fast_local.rs:101:25: 101:33
    = note: inside `std::sys::common::thread_local::lazy::LazyKeyInner::<crossbeam_epoch::collector::LocalHandle>::initialize::<{closure@crossbeam_epoch::default::HANDLE::__getit::{closure#0}}>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/common/thread_local/mod.rs:54:25: 54:31
    = note: inside `std::thread::local_impl::Key::<crossbeam_epoch::collector::LocalHandle>::try_initialize::<{closure@crossbeam_epoch::default::HANDLE::__getit::{closure#0}}>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/common/thread_local/fast_local.rs:192:27: 192:54
    = note: inside `std::thread::local_impl::Key::<crossbeam_epoch::collector::LocalHandle>::get::<{closure@crossbeam_epoch::default::HANDLE::__getit::{closure#0}}>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/common/thread_local/fast_local.rs:175:25: 175:50
    = note: inside `crossbeam_epoch::default::HANDLE::__getit` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/common/thread_local/fast_local.rs:93:21: 102:23
    = note: inside `std::thread::LocalKey::<crossbeam_epoch::collector::LocalHandle>::try_with::<{closure@crossbeam_epoch::default::with_handle<{closure@crossbeam_epoch::default::is_pinned::{closure#0}}, bool>::{closure#0}}, bool>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/thread/local.rs:285:32: 285:50
    = note: inside `crossbeam_epoch::default::with_handle::<{closure@crossbeam_epoch::default::is_pinned::{closure#0}}, bool>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/default.rs:59:5: 60:28
    = note: inside `crossbeam_epoch::default::is_pinned` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/default.rs:46:5: 46:45
    = note: inside `crossbeam_deque::deque::Stealer::<rayon_core::job::JobRef>::steal` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-deque-0.8.5/src/deque.rs:641:12: 641:30
    = note: inside `rayon_core::registry::WorkerThread::take_local_job` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:750:19: 750:39
    = note: inside `rayon_core::registry::WorkerThread::wait_until_cold` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:784:32: 784:53
    = note: inside `rayon_core::registry::WorkerThread::wait_until::<rayon_core::latch::OnceLatch>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:768:13: 768:40
    = note: inside `rayon_core::registry::WorkerThread::wait_until_out_of_work` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:817:9: 817:65
    = note: inside `rayon_core::registry::main_loop` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:922:5: 922:43
    = note: inside `rayon_core::registry::ThreadBuilder::run` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:52:18: 52:33
    = note: inside closure at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:97:20: 97:32
    = note: inside `std::sys_common::backtrace::__rust_begin_short_backtrace::<{closure@<rayon_core::registry::DefaultSpawn as rayon_core::registry::ThreadSpawn>::spawn::{closure#0}}, ()>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:155:18: 155:21
    = note: inside closure at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/thread/mod.rs:529:17: 529:78
    = note: inside `<std::panic::AssertUnwindSafe<{closure@std::thread::Builder::spawn_unchecked_<'_, '_, {closure@<rayon_core::registry::DefaultSpawn as rayon_core::registry::ThreadSpawn>::spawn::{closure#0}}, ()>::{closure#1}::{closure#0}}> as std::ops::FnOnce<()>>::call_once` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/panic/unwind_safe.rs:272:9: 272:19
    = note: inside `std::panicking::r#try::do_call::<std::panic::AssertUnwindSafe<{closure@std::thread::Builder::spawn_unchecked_<'_, '_, {closure@<rayon_core::registry::DefaultSpawn as rayon_core::registry::ThreadSpawn>::spawn::{closure#0}}, ()>::{closure#1}::{closure#0}}>, ()>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/panicking.rs:554:40: 554:43
    = note: inside `std::panicking::r#try::<(), std::panic::AssertUnwindSafe<{closure@std::thread::Builder::spawn_unchecked_<'_, '_, {closure@<rayon_core::registry::DefaultSpawn as rayon_core::registry::ThreadSpawn>::spawn::{closure#0}}, ()>::{closure#1}::{closure#0}}>>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/panicking.rs:518:19: 518:81
    = note: inside `std::panic::catch_unwind::<std::panic::AssertUnwindSafe<{closure@std::thread::Builder::spawn_unchecked_<'_, '_, {closure@<rayon_core::registry::DefaultSpawn as rayon_core::registry::ThreadSpawn>::spawn::{closure#0}}, ()>::{closure#1}::{closure#0}}>, ()>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/panic.rs:142:14: 142:33
    = note: inside closure at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/thread/mod.rs:528:30: 530:16
    = note: inside `<{closure@std::thread::Builder::spawn_unchecked_<'_, '_, {closure@<rayon_core::registry::DefaultSpawn as rayon_core::registry::ThreadSpawn>::spawn::{closure#0}}, ()>::{closure#1}} as std::ops::FnOnce<()>>::call_once - shim(vtable)` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5: 250:71
    = note: inside `<std::boxed::Box<dyn std::ops::FnOnce()> as std::ops::FnOnce<()>>::call_once` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/boxed.rs:2016:9: 2016:52
    = note: inside `<std::boxed::Box<std::boxed::Box<dyn std::ops::FnOnce()>> as std::ops::FnOnce<()>>::call_once` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/boxed.rs:2016:9: 2016:52
    = note: inside `std::sys::unix::thread::Thread::new::thread_start` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/unix/thread.rs:108:17: 108:64

warning: integer-to-pointer cast
    --> /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/atomic.rs:1345:9
     |
1345 |         raw as *const _
     |         ^^^^^^^^^^^^^^^ integer-to-pointer cast
     |
     = note: inside `crossbeam_epoch::atomic::Shared::<'_, crossbeam_epoch::internal::Local>::as_raw` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/atomic.rs:1345:9: 1345:24
     = note: inside `crossbeam_epoch::internal::Local::register` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/internal.rs:332:24: 332:38
     = note: inside `crossbeam_epoch::collector::Collector::register` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/collector.rs:45:9: 45:30
     = note: inside `crossbeam_epoch::default::HANDLE::__init` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/default.rs:34:34: 34:56
     = note: inside closure at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/common/thread_local/fast_local.rs:101:25: 101:33
     = note: inside `std::sys::common::thread_local::lazy::LazyKeyInner::<crossbeam_epoch::collector::LocalHandle>::initialize::<{closure@crossbeam_epoch::default::HANDLE::__getit::{closure#0}}>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/common/thread_local/mod.rs:54:25: 54:31
     = note: inside `std::thread::local_impl::Key::<crossbeam_epoch::collector::LocalHandle>::try_initialize::<{closure@crossbeam_epoch::default::HANDLE::__getit::{closure#0}}>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/common/thread_local/fast_local.rs:192:27: 192:54
     = note: inside `std::thread::local_impl::Key::<crossbeam_epoch::collector::LocalHandle>::get::<{closure@crossbeam_epoch::default::HANDLE::__getit::{closure#0}}>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/common/thread_local/fast_local.rs:175:25: 175:50
     = note: inside `crossbeam_epoch::default::HANDLE::__getit` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/common/thread_local/fast_local.rs:93:21: 102:23
     = note: inside `std::thread::LocalKey::<crossbeam_epoch::collector::LocalHandle>::try_with::<{closure@crossbeam_epoch::default::with_handle<{closure@crossbeam_epoch::default::is_pinned::{closure#0}}, bool>::{closure#0}}, bool>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/thread/local.rs:285:32: 285:50
     = note: inside `crossbeam_epoch::default::with_handle::<{closure@crossbeam_epoch::default::is_pinned::{closure#0}}, bool>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/default.rs:59:5: 60:28
     = note: inside `crossbeam_epoch::default::is_pinned` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/default.rs:46:5: 46:45
     = note: inside `crossbeam_deque::deque::Stealer::<rayon_core::job::JobRef>::steal` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-deque-0.8.5/src/deque.rs:641:12: 641:30
     = note: inside `rayon_core::registry::WorkerThread::take_local_job` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:750:19: 750:39
     = note: inside `rayon_core::registry::WorkerThread::wait_until_cold` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:784:32: 784:53
     = note: inside `rayon_core::registry::WorkerThread::wait_until::<rayon_core::latch::OnceLatch>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:768:13: 768:40
     = note: inside `rayon_core::registry::WorkerThread::wait_until_out_of_work` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:817:9: 817:65
     = note: inside `rayon_core::registry::main_loop` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:922:5: 922:43
     = note: inside `rayon_core::registry::ThreadBuilder::run` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:52:18: 52:33
     = note: inside closure at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:97:20: 97:32
     = note: inside `std::sys_common::backtrace::__rust_begin_short_backtrace::<{closure@<rayon_core::registry::DefaultSpawn as rayon_core::registry::ThreadSpawn>::spawn::{closure#0}}, ()>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:155:18: 155:21
     = note: inside closure at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/thread/mod.rs:529:17: 529:78
     = note: inside `<std::panic::AssertUnwindSafe<{closure@std::thread::Builder::spawn_unchecked_<'_, '_, {closure@<rayon_core::registry::DefaultSpawn as rayon_core::registry::ThreadSpawn>::spawn::{closure#0}}, ()>::{closure#1}::{closure#0}}> as std::ops::FnOnce<()>>::call_once` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/panic/unwind_safe.rs:272:9: 272:19
     = note: inside `std::panicking::r#try::do_call::<std::panic::AssertUnwindSafe<{closure@std::thread::Builder::spawn_unchecked_<'_, '_, {closure@<rayon_core::registry::DefaultSpawn as rayon_core::registry::ThreadSpawn>::spawn::{closure#0}}, ()>::{closure#1}::{closure#0}}>, ()>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/panicking.rs:554:40: 554:43
     = note: inside `std::panicking::r#try::<(), std::panic::AssertUnwindSafe<{closure@std::thread::Builder::spawn_unchecked_<'_, '_, {closure@<rayon_core::registry::DefaultSpawn as rayon_core::registry::ThreadSpawn>::spawn::{closure#0}}, ()>::{closure#1}::{closure#0}}>>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/panicking.rs:518:19: 518:81
     = note: inside `std::panic::catch_unwind::<std::panic::AssertUnwindSafe<{closure@std::thread::Builder::spawn_unchecked_<'_, '_, {closure@<rayon_core::registry::DefaultSpawn as rayon_core::registry::ThreadSpawn>::spawn::{closure#0}}, ()>::{closure#1}::{closure#0}}>, ()>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/panic.rs:142:14: 142:33
     = note: inside closure at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/thread/mod.rs:528:30: 530:16
     = note: inside `<{closure@std::thread::Builder::spawn_unchecked_<'_, '_, {closure@<rayon_core::registry::DefaultSpawn as rayon_core::registry::ThreadSpawn>::spawn::{closure#0}}, ()>::{closure#1}} as std::ops::FnOnce<()>>::call_once - shim(vtable)` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5: 250:71
     = note: inside `<std::boxed::Box<dyn std::ops::FnOnce()> as std::ops::FnOnce<()>>::call_once` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/boxed.rs:2016:9: 2016:52
     = note: inside `<std::boxed::Box<std::boxed::Box<dyn std::ops::FnOnce()>> as std::ops::FnOnce<()>>::call_once` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/boxed.rs:2016:9: 2016:52
     = note: inside `std::sys::unix::thread::Thread::new::thread_start` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/unix/thread.rs:108:17: 108:64

error: Undefined Behavior: trying to retag from <3072939> for SharedReadWrite permission at alloc1267265[0x8], but that tag does not exist in the borrow stack for this location
   --> /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/internal.rs:549:9
    |
549 |         &*local_ptr
    |         ^^^^^^^^^^^
    |         |
    |         trying to retag from <3072939> for SharedReadWrite permission at alloc1267265[0x8], but that tag does not exist in the borrow stack for this location
    |         this error occurs as part of retag at alloc1267265[0x0..0x180]
    |
    = 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
help: <3072939> was created by a SharedReadWrite retag at offsets [0x0..0x8]
   --> /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/internal.rs:548:26
    |
548 |         let local_ptr = (entry as *const Entry).cast::<Self>();
    |                          ^^^^^
    = note: BACKTRACE (of the first span):
    = note: inside `<crossbeam_epoch::internal::Local as crossbeam_epoch::sync::list::IsElement<crossbeam_epoch::internal::Local>>::element_of` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/internal.rs:549:9: 549:20
    = note: inside `<crossbeam_epoch::sync::list::Iter<'_, crossbeam_epoch::internal::Local, crossbeam_epoch::internal::Local> as std::iter::Iterator>::next` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/sync/list.rs:290:37: 290:53
    = note: inside `crossbeam_epoch::internal::Global::try_advance` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/internal.rs:235:22: 235:45
    = note: inside `crossbeam_epoch::internal::Global::collect` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/internal.rs:200:28: 200:51
    = note: inside `crossbeam_epoch::internal::Local::pin` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/internal.rs:435:17: 435:46
    = note: inside `crossbeam_epoch::collector::LocalHandle::pin` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/collector.rs:81:18: 81:37
    = note: inside closure at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/default.rs:40:26: 40:38
    = note: inside closure at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/default.rs:60:23: 60:27
    = note: inside `std::thread::LocalKey::<crossbeam_epoch::collector::LocalHandle>::try_with::<{closure@crossbeam_epoch::default::with_handle<{closure@crossbeam_epoch::default::pin::{closure#0}}, crossbeam_epoch::guard::Guard>::{closure#0}}, crossbeam_epoch::guard::Guard>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/thread/local.rs:286:16: 286:31
    = note: inside `crossbeam_epoch::default::with_handle::<{closure@crossbeam_epoch::default::pin::{closure#0}}, crossbeam_epoch::guard::Guard>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/default.rs:59:5: 60:28
    = note: inside `crossbeam_epoch::default::pin` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/default.rs:40:5: 40:39
    = note: inside `crossbeam_deque::deque::Stealer::<rayon_core::job::JobRef>::steal` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-deque-0.8.5/src/deque.rs:645:22: 645:34
    = note: inside `rayon_core::registry::WorkerThread::take_local_job` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:750:19: 750:39
    = note: inside `rayon_core::registry::WorkerThread::wait_until_cold` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:784:32: 784:53
    = note: inside `rayon_core::registry::WorkerThread::wait_until::<rayon_core::latch::OnceLatch>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:768:13: 768:40
    = note: inside `rayon_core::registry::WorkerThread::wait_until_out_of_work` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:817:9: 817:65
    = note: inside `rayon_core::registry::main_loop` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:922:5: 922:43
    = note: inside `rayon_core::registry::ThreadBuilder::run` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:52:18: 52:33
    = note: inside closure at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:97:20: 97:32
    = note: inside `std::sys_common::backtrace::__rust_begin_short_backtrace::<{closure@<rayon_core::registry::DefaultSpawn as rayon_core::registry::ThreadSpawn>::spawn::{closure#0}}, ()>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:155:18: 155:21
    = note: inside closure at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/thread/mod.rs:529:17: 529:78
    = note: inside `<std::panic::AssertUnwindSafe<{closure@std::thread::Builder::spawn_unchecked_<'_, '_, {closure@<rayon_core::registry::DefaultSpawn as rayon_core::registry::ThreadSpawn>::spawn::{closure#0}}, ()>::{closure#1}::{closure#0}}> as std::ops::FnOnce<()>>::call_once` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/panic/unwind_safe.rs:272:9: 272:19
    = note: inside `std::panicking::r#try::do_call::<std::panic::AssertUnwindSafe<{closure@std::thread::Builder::spawn_unchecked_<'_, '_, {closure@<rayon_core::registry::DefaultSpawn as rayon_core::registry::ThreadSpawn>::spawn::{closure#0}}, ()>::{closure#1}::{closure#0}}>, ()>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/panicking.rs:554:40: 554:43
    = note: inside `std::panicking::r#try::<(), std::panic::AssertUnwindSafe<{closure@std::thread::Builder::spawn_unchecked_<'_, '_, {closure@<rayon_core::registry::DefaultSpawn as rayon_core::registry::ThreadSpawn>::spawn::{closure#0}}, ()>::{closure#1}::{closure#0}}>>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/panicking.rs:518:19: 518:81
    = note: inside `std::panic::catch_unwind::<std::panic::AssertUnwindSafe<{closure@std::thread::Builder::spawn_unchecked_<'_, '_, {closure@<rayon_core::registry::DefaultSpawn as rayon_core::registry::ThreadSpawn>::spawn::{closure#0}}, ()>::{closure#1}::{closure#0}}>, ()>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/panic.rs:142:14: 142:33
    = note: inside closure at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/thread/mod.rs:528:30: 530:16
    = note: inside `<{closure@std::thread::Builder::spawn_unchecked_<'_, '_, {closure@<rayon_core::registry::DefaultSpawn as rayon_core::registry::ThreadSpawn>::spawn::{closure#0}}, ()>::{closure#1}} as std::ops::FnOnce<()>>::call_once - shim(vtable)` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5: 250:71
    = note: inside `<std::boxed::Box<dyn std::ops::FnOnce()> as std::ops::FnOnce<()>>::call_once` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/boxed.rs:2016:9: 2016:52
    = note: inside `<std::boxed::Box<std::boxed::Box<dyn std::ops::FnOnce()>> as std::ops::FnOnce<()>>::call_once` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/boxed.rs:2016:9: 2016:52
    = note: inside `std::sys::unix::thread::Thread::new::thread_start` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/unix/thread.rs:108:17: 108:64

error: aborting due to 1 previous error; 2 warnings emitted

This error doesn't happen with -Zmiri-disable-stacked-borrows or -Zmiri-tree-borrows. Instead, Miri errors upon encountering this foreign function in the rav1e crate, since Miri doesn't support calling it.

Output
Preparing a sysroot for Miri (target: aarch64-apple-darwin)... done
     Running `/Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/bin/cargo-miri runner target/miri/aarch64-apple-darwin/debug/image-test`
warning: integer-to-pointer cast
   --> /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/atomic.rs:204:11
    |
204 |         &*(ptr as *const T)
    |           ^^^^^^^^^^^^^^^^^ integer-to-pointer cast
    |
    = help: This program is using integer-to-pointer casts or (equivalently) `ptr::from_exposed_addr`,
    = help: which means that Miri might miss pointer bugs in this program.
    = help: See https://doc.rust-lang.org/nightly/std/ptr/fn.from_exposed_addr.html for more details on that operation.
    = help: To ensure that Miri does not miss bugs in your program, use Strict Provenance APIs (https://doc.rust-lang.org/nightly/std/ptr/index.html#strict-provenance, https://crates.io/crates/sptr) instead.
    = help: You can then pass the `-Zmiri-strict-provenance` flag to Miri, to ensure you are not relying on `from_exposed_addr` semantics.
    = help: Alternatively, the `-Zmiri-permissive-provenance` flag disables this warning.
    = note: BACKTRACE:
    = note: inside `<crossbeam_epoch::internal::Local as crossbeam_epoch::atomic::Pointable>::deref::<'_>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/atomic.rs:204:11: 204:28
    = note: inside `crossbeam_epoch::atomic::Shared::<'_, crossbeam_epoch::internal::Local>::deref` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/atomic.rs:1421:9: 1421:22
    = note: inside `crossbeam_epoch::sync::list::List::<crossbeam_epoch::internal::Local>::insert` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/sync/list.rs:176:41: 176:58
    = note: inside `crossbeam_epoch::internal::Local::register` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/internal.rs:330:13: 330:65
    = note: inside `crossbeam_epoch::collector::Collector::register` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/collector.rs:45:9: 45:30
    = note: inside `crossbeam_epoch::default::HANDLE::__init` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/default.rs:34:34: 34:56
    = note: inside closure at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/common/thread_local/fast_local.rs:101:25: 101:33
    = note: inside `std::sys::common::thread_local::lazy::LazyKeyInner::<crossbeam_epoch::collector::LocalHandle>::initialize::<{closure@crossbeam_epoch::default::HANDLE::__getit::{closure#0}}>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/common/thread_local/mod.rs:54:25: 54:31
    = note: inside `std::thread::local_impl::Key::<crossbeam_epoch::collector::LocalHandle>::try_initialize::<{closure@crossbeam_epoch::default::HANDLE::__getit::{closure#0}}>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/common/thread_local/fast_local.rs:192:27: 192:54
    = note: inside `std::thread::local_impl::Key::<crossbeam_epoch::collector::LocalHandle>::get::<{closure@crossbeam_epoch::default::HANDLE::__getit::{closure#0}}>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/common/thread_local/fast_local.rs:175:25: 175:50
    = note: inside `crossbeam_epoch::default::HANDLE::__getit` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/common/thread_local/fast_local.rs:93:21: 102:23
    = note: inside `std::thread::LocalKey::<crossbeam_epoch::collector::LocalHandle>::try_with::<{closure@crossbeam_epoch::default::with_handle<{closure@crossbeam_epoch::default::is_pinned::{closure#0}}, bool>::{closure#0}}, bool>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/thread/local.rs:285:32: 285:50
    = note: inside `crossbeam_epoch::default::with_handle::<{closure@crossbeam_epoch::default::is_pinned::{closure#0}}, bool>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/default.rs:59:5: 60:28
    = note: inside `crossbeam_epoch::default::is_pinned` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/default.rs:46:5: 46:45
    = note: inside `crossbeam_deque::deque::Stealer::<rayon_core::job::JobRef>::steal` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-deque-0.8.5/src/deque.rs:641:12: 641:30
    = note: inside `rayon_core::registry::WorkerThread::take_local_job` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:750:19: 750:39
    = note: inside `rayon_core::registry::WorkerThread::wait_until_cold` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:784:32: 784:53
    = note: inside `rayon_core::registry::WorkerThread::wait_until::<rayon_core::latch::OnceLatch>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:768:13: 768:40
    = note: inside `rayon_core::registry::WorkerThread::wait_until_out_of_work` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:817:9: 817:65
    = note: inside `rayon_core::registry::main_loop` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:922:5: 922:43
    = note: inside `rayon_core::registry::ThreadBuilder::run` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:52:18: 52:33
    = note: inside closure at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:97:20: 97:32
    = note: inside `std::sys_common::backtrace::__rust_begin_short_backtrace::<{closure@<rayon_core::registry::DefaultSpawn as rayon_core::registry::ThreadSpawn>::spawn::{closure#0}}, ()>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:155:18: 155:21
    = note: inside closure at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/thread/mod.rs:529:17: 529:78
    = note: inside `<std::panic::AssertUnwindSafe<{closure@std::thread::Builder::spawn_unchecked_<'_, '_, {closure@<rayon_core::registry::DefaultSpawn as rayon_core::registry::ThreadSpawn>::spawn::{closure#0}}, ()>::{closure#1}::{closure#0}}> as std::ops::FnOnce<()>>::call_once` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/panic/unwind_safe.rs:272:9: 272:19
    = note: inside `std::panicking::r#try::do_call::<std::panic::AssertUnwindSafe<{closure@std::thread::Builder::spawn_unchecked_<'_, '_, {closure@<rayon_core::registry::DefaultSpawn as rayon_core::registry::ThreadSpawn>::spawn::{closure#0}}, ()>::{closure#1}::{closure#0}}>, ()>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/panicking.rs:554:40: 554:43
    = note: inside `std::panicking::r#try::<(), std::panic::AssertUnwindSafe<{closure@std::thread::Builder::spawn_unchecked_<'_, '_, {closure@<rayon_core::registry::DefaultSpawn as rayon_core::registry::ThreadSpawn>::spawn::{closure#0}}, ()>::{closure#1}::{closure#0}}>>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/panicking.rs:518:19: 518:81
    = note: inside `std::panic::catch_unwind::<std::panic::AssertUnwindSafe<{closure@std::thread::Builder::spawn_unchecked_<'_, '_, {closure@<rayon_core::registry::DefaultSpawn as rayon_core::registry::ThreadSpawn>::spawn::{closure#0}}, ()>::{closure#1}::{closure#0}}>, ()>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/panic.rs:142:14: 142:33
    = note: inside closure at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/thread/mod.rs:528:30: 530:16
    = note: inside `<{closure@std::thread::Builder::spawn_unchecked_<'_, '_, {closure@<rayon_core::registry::DefaultSpawn as rayon_core::registry::ThreadSpawn>::spawn::{closure#0}}, ()>::{closure#1}} as std::ops::FnOnce<()>>::call_once - shim(vtable)` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5: 250:71
    = note: inside `<std::boxed::Box<dyn std::ops::FnOnce()> as std::ops::FnOnce<()>>::call_once` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/boxed.rs:2016:9: 2016:52
    = note: inside `<std::boxed::Box<std::boxed::Box<dyn std::ops::FnOnce()>> as std::ops::FnOnce<()>>::call_once` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/boxed.rs:2016:9: 2016:52
    = note: inside `std::sys::unix::thread::Thread::new::thread_start` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/unix/thread.rs:108:17: 108:64

warning: integer-to-pointer cast
    --> /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/atomic.rs:1345:9
     |
1345 |         raw as *const _
     |         ^^^^^^^^^^^^^^^ integer-to-pointer cast
     |
     = note: inside `crossbeam_epoch::atomic::Shared::<'_, crossbeam_epoch::internal::Local>::as_raw` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/atomic.rs:1345:9: 1345:24
     = note: inside `crossbeam_epoch::internal::Local::register` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/internal.rs:332:24: 332:38
     = note: inside `crossbeam_epoch::collector::Collector::register` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/collector.rs:45:9: 45:30
     = note: inside `crossbeam_epoch::default::HANDLE::__init` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/default.rs:34:34: 34:56
     = note: inside closure at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/common/thread_local/fast_local.rs:101:25: 101:33
     = note: inside `std::sys::common::thread_local::lazy::LazyKeyInner::<crossbeam_epoch::collector::LocalHandle>::initialize::<{closure@crossbeam_epoch::default::HANDLE::__getit::{closure#0}}>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/common/thread_local/mod.rs:54:25: 54:31
     = note: inside `std::thread::local_impl::Key::<crossbeam_epoch::collector::LocalHandle>::try_initialize::<{closure@crossbeam_epoch::default::HANDLE::__getit::{closure#0}}>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/common/thread_local/fast_local.rs:192:27: 192:54
     = note: inside `std::thread::local_impl::Key::<crossbeam_epoch::collector::LocalHandle>::get::<{closure@crossbeam_epoch::default::HANDLE::__getit::{closure#0}}>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/common/thread_local/fast_local.rs:175:25: 175:50
     = note: inside `crossbeam_epoch::default::HANDLE::__getit` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/common/thread_local/fast_local.rs:93:21: 102:23
     = note: inside `std::thread::LocalKey::<crossbeam_epoch::collector::LocalHandle>::try_with::<{closure@crossbeam_epoch::default::with_handle<{closure@crossbeam_epoch::default::is_pinned::{closure#0}}, bool>::{closure#0}}, bool>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/thread/local.rs:285:32: 285:50
     = note: inside `crossbeam_epoch::default::with_handle::<{closure@crossbeam_epoch::default::is_pinned::{closure#0}}, bool>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/default.rs:59:5: 60:28
     = note: inside `crossbeam_epoch::default::is_pinned` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-epoch-0.9.18/src/default.rs:46:5: 46:45
     = note: inside `crossbeam_deque::deque::Stealer::<rayon_core::job::JobRef>::steal` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-deque-0.8.5/src/deque.rs:641:12: 641:30
     = note: inside `rayon_core::registry::WorkerThread::take_local_job` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:750:19: 750:39
     = note: inside `rayon_core::registry::WorkerThread::wait_until_cold` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:784:32: 784:53
     = note: inside `rayon_core::registry::WorkerThread::wait_until::<rayon_core::latch::OnceLatch>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:768:13: 768:40
     = note: inside `rayon_core::registry::WorkerThread::wait_until_out_of_work` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:817:9: 817:65
     = note: inside `rayon_core::registry::main_loop` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:922:5: 922:43
     = note: inside `rayon_core::registry::ThreadBuilder::run` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:52:18: 52:33
     = note: inside closure at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:97:20: 97:32
     = note: inside `std::sys_common::backtrace::__rust_begin_short_backtrace::<{closure@<rayon_core::registry::DefaultSpawn as rayon_core::registry::ThreadSpawn>::spawn::{closure#0}}, ()>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:155:18: 155:21
     = note: inside closure at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/thread/mod.rs:529:17: 529:78
     = note: inside `<std::panic::AssertUnwindSafe<{closure@std::thread::Builder::spawn_unchecked_<'_, '_, {closure@<rayon_core::registry::DefaultSpawn as rayon_core::registry::ThreadSpawn>::spawn::{closure#0}}, ()>::{closure#1}::{closure#0}}> as std::ops::FnOnce<()>>::call_once` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/panic/unwind_safe.rs:272:9: 272:19
     = note: inside `std::panicking::r#try::do_call::<std::panic::AssertUnwindSafe<{closure@std::thread::Builder::spawn_unchecked_<'_, '_, {closure@<rayon_core::registry::DefaultSpawn as rayon_core::registry::ThreadSpawn>::spawn::{closure#0}}, ()>::{closure#1}::{closure#0}}>, ()>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/panicking.rs:554:40: 554:43
     = note: inside `std::panicking::r#try::<(), std::panic::AssertUnwindSafe<{closure@std::thread::Builder::spawn_unchecked_<'_, '_, {closure@<rayon_core::registry::DefaultSpawn as rayon_core::registry::ThreadSpawn>::spawn::{closure#0}}, ()>::{closure#1}::{closure#0}}>>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/panicking.rs:518:19: 518:81
     = note: inside `std::panic::catch_unwind::<std::panic::AssertUnwindSafe<{closure@std::thread::Builder::spawn_unchecked_<'_, '_, {closure@<rayon_core::registry::DefaultSpawn as rayon_core::registry::ThreadSpawn>::spawn::{closure#0}}, ()>::{closure#1}::{closure#0}}>, ()>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/panic.rs:142:14: 142:33
     = note: inside closure at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/thread/mod.rs:528:30: 530:16
     = note: inside `<{closure@std::thread::Builder::spawn_unchecked_<'_, '_, {closure@<rayon_core::registry::DefaultSpawn as rayon_core::registry::ThreadSpawn>::spawn::{closure#0}}, ()>::{closure#1}} as std::ops::FnOnce<()>>::call_once - shim(vtable)` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5: 250:71
     = note: inside `<std::boxed::Box<dyn std::ops::FnOnce()> as std::ops::FnOnce<()>>::call_once` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/boxed.rs:2016:9: 2016:52
     = note: inside `<std::boxed::Box<std::boxed::Box<dyn std::ops::FnOnce()>> as std::ops::FnOnce<()>>::call_once` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/boxed.rs:2016:9: 2016:52
     = note: inside `std::sys::unix::thread::Thread::new::thread_start` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/unix/thread.rs:108:17: 108:64

error: unsupported operation: can't call foreign function `rav1e_ipred_smooth_8bpc_neon` on OS `macos`
   --> /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.7.1/src/asm/aarch64/predict.rs:529:11
    |
529 |           rav1e_ipred_smooth_8bpc_neon(dst_ptr, stride, edge_ptr, w, h, angle);
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't call foreign function `rav1e_ipred_smooth_8bpc_neon` on OS `macos`
    |
    = help: this is likely not a bug in the program; it indicates that the program performed an operation that the interpreter does not support
    = note: BACKTRACE:
    = note: inside `rav1e::asm::aarch64::predict::dispatch_predict_intra::<u8>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.7.1/src/asm/aarch64/predict.rs:529:11: 529:79
    = note: inside `rav1e::predict::PredictionMode::predict_intra::<u8>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.7.1/src/predict.rs:244:5: 247:6
    = note: inside `rav1e::rdo::intra_frame_rdo_mode_decision::<u8>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.7.1/src/rdo.rs:1475:9: 1485:10
    = note: inside `rav1e::rdo::rdo_mode_decision::<u8>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.7.1/src/rdo.rs:998:12: 1008:6
    = note: inside `rav1e::encoder::encode_partition_bottomup::<u8, rav1e::ec::WriterBase<rav1e::ec::WriterRecorder>>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.7.1/src/encoder.rs:2696:7: 2696:63
    = note: inside `rav1e::encoder::encode_partition_bottomup::<u8, rav1e::ec::WriterBase<rav1e::ec::WriterRecorder>>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.7.1/src/encoder.rs:2806:32: 2817:10
    = note: inside `rav1e::encoder::encode_tile::<u8>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.7.1/src/encoder.rs:3516:9: 3527:10
    = note: inside closure at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.7.1/src/encoder.rs:3256:7: 3256:64
    = note: inside `std::ops::function::impls::<impl std::ops::FnMut<((rav1e::tiling::tiler::TileContextMut<'_, u8>, &mut rav1e::context::cdf_context::CDFContext),)> for &{closure@rav1e::encoder::encode_tile_group<u8>::{closure#0}}>::call_mut` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/ops/function.rs:272:13: 272:32
    = note: inside `std::ops::function::impls::<impl std::ops::FnOnce<((rav1e::tiling::tiler::TileContextMut<'_, u8>, &mut rav1e::context::cdf_context::CDFContext),)> for &mut &{closure@rav1e::encoder::encode_tile_group<u8>::{closure#0}}>::call_once` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/ops/function.rs:305:13: 305:35
    = note: inside `std::option::Option::<(rav1e::tiling::tiler::TileContextMut<'_, u8>, &mut rav1e::context::cdf_context::CDFContext)>::map::<(std::vec::Vec<u8>, rav1e::stats::EncoderStats), &mut &{closure@rav1e::encoder::encode_tile_group<u8>::{closure#0}}>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/option.rs:1072:29: 1072:33
    = note: inside `<std::iter::Map<rayon::vec::SliceDrain<'_, (rav1e::tiling::tiler::TileContextMut<'_, u8>, &mut rav1e::context::cdf_context::CDFContext)>, &{closure@rav1e::encoder::encode_tile_group<u8>::{closure#0}}> as std::iter::Iterator>::next` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/iter/adapters/map.rs:104:9: 104:42
    = note: inside `<rayon::iter::unzip::UnzipFolder<'_, rayon::iter::unzip::Unzip, rayon::iter::collect::consumer::CollectResult<'_, std::vec::Vec<u8>>, rayon::iter::collect::consumer::CollectResult<'_, rav1e::stats::EncoderStats>> as rayon::iter::plumbing::Folder<(std::vec::Vec<u8>, rav1e::stats::EncoderStats)>>::consume_iter::<std::iter::Map<rayon::vec::SliceDrain<'_, (rav1e::tiling::tiler::TileContextMut<'_, u8>, &mut rav1e::context::cdf_context::CDFContext)>, &{closure@rav1e::encoder::encode_tile_group<u8>::{closure#0}}>>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-1.8.0/src/iter/plumbing/mod.rs:178:21: 178:25
    = note: inside `<rayon::iter::map::MapFolder<'_, rayon::iter::unzip::UnzipFolder<'_, rayon::iter::unzip::Unzip, rayon::iter::collect::consumer::CollectResult<'_, std::vec::Vec<u8>>, rayon::iter::collect::consumer::CollectResult<'_, rav1e::stats::EncoderStats>>, {closure@rav1e::encoder::encode_tile_group<u8>::{closure#0}}> as rayon::iter::plumbing::Folder<(rav1e::tiling::tiler::TileContextMut<'_, u8>, &mut rav1e::context::cdf_context::CDFContext)>>::consume_iter::<rayon::vec::SliceDrain<'_, (rav1e::tiling::tiler::TileContextMut<'_, u8>, &mut rav1e::context::cdf_context::CDFContext)>>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-1.8.0/src/iter/map.rs:248:21: 248:78
    = note: inside `<rayon::vec::DrainProducer<'_, (rav1e::tiling::tiler::TileContextMut<'_, u8>, &mut rav1e::context::cdf_context::CDFContext)> as rayon::iter::plumbing::Producer>::fold_with::<rayon::iter::map::MapFolder<'_, rayon::iter::unzip::UnzipFolder<'_, rayon::iter::unzip::Unzip, rayon::iter::collect::consumer::CollectResult<'_, std::vec::Vec<u8>>, rayon::iter::collect::consumer::CollectResult<'_, rav1e::stats::EncoderStats>>, {closure@rav1e::encoder::encode_tile_group<u8>::{closure#0}}>>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-1.8.0/src/iter/plumbing/mod.rs:110:9: 110:46
    = note: inside `rayon::iter::plumbing::bridge_producer_consumer::helper::<rayon::vec::DrainProducer<'_, (rav1e::tiling::tiler::TileContextMut<'_, u8>, &mut rav1e::context::cdf_context::CDFContext)>, rayon::iter::map::MapConsumer<'_, rayon::iter::unzip::UnzipConsumer<'_, rayon::iter::unzip::Unzip, rayon::iter::collect::consumer::CollectConsumer<'_, std::vec::Vec<u8>>, rayon::iter::collect::consumer::CollectConsumer<'_, rav1e::stats::EncoderStats>>, {closure@rav1e::encoder::encode_tile_group<u8>::{closure#0}}>>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-1.8.0/src/iter/plumbing/mod.rs:438:13: 438:55
    = note: inside `rayon::iter::plumbing::bridge_producer_consumer::<rayon::vec::DrainProducer<'_, (rav1e::tiling::tiler::TileContextMut<'_, u8>, &mut rav1e::context::cdf_context::CDFContext)>, rayon::iter::map::MapConsumer<'_, rayon::iter::unzip::UnzipConsumer<'_, rayon::iter::unzip::Unzip, rayon::iter::collect::consumer::CollectConsumer<'_, std::vec::Vec<u8>>, rayon::iter::collect::consumer::CollectConsumer<'_, rav1e::stats::EncoderStats>>, {closure@rav1e::encoder::encode_tile_group<u8>::{closure#0}}>>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-1.8.0/src/iter/plumbing/mod.rs:397:12: 397:60
    = note: inside `<rayon::iter::plumbing::bridge::Callback<rayon::iter::map::MapConsumer<'_, rayon::iter::unzip::UnzipConsumer<'_, rayon::iter::unzip::Unzip, rayon::iter::collect::consumer::CollectConsumer<'_, std::vec::Vec<u8>>, rayon::iter::collect::consumer::CollectConsumer<'_, rav1e::stats::EncoderStats>>, {closure@rav1e::encoder::encode_tile_group<u8>::{closure#0}}>> as rayon::iter::plumbing::ProducerCallback<(rav1e::tiling::tiler::TileContextMut<'_, u8>, &mut rav1e::context::cdf_context::CDFContext)>>::callback::<rayon::vec::DrainProducer<'_, (rav1e::tiling::tiler::TileContextMut<'_, u8>, &mut rav1e::context::cdf_context::CDFContext)>>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-1.8.0/src/iter/plumbing/mod.rs:373:13: 373:72
    = note: inside `<rayon::vec::Drain<'_, (rav1e::tiling::tiler::TileContextMut<'_, u8>, &mut rav1e::context::cdf_context::CDFContext)> as rayon::iter::IndexedParallelIterator>::with_producer::<rayon::iter::plumbing::bridge::Callback<rayon::iter::map::MapConsumer<'_, rayon::iter::unzip::UnzipConsumer<'_, rayon::iter::unzip::Unzip, rayon::iter::collect::consumer::CollectConsumer<'_, std::vec::Vec<u8>>, rayon::iter::collect::consumer::CollectConsumer<'_, rav1e::stats::EncoderStats>>, {closure@rav1e::encoder::encode_tile_group<u8>::{closure#0}}>>>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-1.8.0/src/vec.rs:147:13: 147:40
    = note: inside `<rayon::vec::IntoIter<(rav1e::tiling::tiler::TileContextMut<'_, u8>, &mut rav1e::context::cdf_context::CDFContext)> as rayon::iter::IndexedParallelIterator>::with_producer::<rayon::iter::plumbing::bridge::Callback<rayon::iter::map::MapConsumer<'_, rayon::iter::unzip::UnzipConsumer<'_, rayon::iter::unzip::Unzip, rayon::iter::collect::consumer::CollectConsumer<'_, std::vec::Vec<u8>>, rayon::iter::collect::consumer::CollectConsumer<'_, rav1e::stats::EncoderStats>>, {closure@rav1e::encoder::encode_tile_group<u8>::{closure#0}}>>>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-1.8.0/src/vec.rs:83:9: 83:55
    = note: inside `rayon::iter::plumbing::bridge::<rayon::vec::IntoIter<(rav1e::tiling::tiler::TileContextMut<'_, u8>, &mut rav1e::context::cdf_context::CDFContext)>, rayon::iter::map::MapConsumer<'_, rayon::iter::unzip::UnzipConsumer<'_, rayon::iter::unzip::Unzip, rayon::iter::collect::consumer::CollectConsumer<'_, std::vec::Vec<u8>>, rayon::iter::collect::consumer::CollectConsumer<'_, rav1e::stats::EncoderStats>>, {closure@rav1e::encoder::encode_tile_group<u8>::{closure#0}}>>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-1.8.0/src/iter/plumbing/mod.rs:357:12: 357:62
    = note: inside `<rayon::vec::IntoIter<(rav1e::tiling::tiler::TileContextMut<'_, u8>, &mut rav1e::context::cdf_context::CDFContext)> as rayon::iter::ParallelIterator>::drive_unindexed::<rayon::iter::map::MapConsumer<'_, rayon::iter::unzip::UnzipConsumer<'_, rayon::iter::unzip::Unzip, rayon::iter::collect::consumer::CollectConsumer<'_, std::vec::Vec<u8>>, rayon::iter::collect::consumer::CollectConsumer<'_, rav1e::stats::EncoderStats>>, {closure@rav1e::encoder::encode_tile_group<u8>::{closure#0}}>>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-1.8.0/src/vec.rs:58:9: 58:31
    = note: inside `<rayon::iter::map::Map<rayon::vec::IntoIter<(rav1e::tiling::tiler::TileContextMut<'_, u8>, &mut rav1e::context::cdf_context::CDFContext)>, {closure@rav1e::encoder::encode_tile_group<u8>::{closure#0}}> as rayon::iter::ParallelIterator>::drive_unindexed::<rayon::iter::unzip::UnzipConsumer<'_, rayon::iter::unzip::Unzip, rayon::iter::collect::consumer::CollectConsumer<'_, std::vec::Vec<u8>>, rayon::iter::collect::consumer::CollectConsumer<'_, rav1e::stats::EncoderStats>>>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-1.8.0/src/iter/map.rs:49:9: 49:45
    = note: inside `<rayon::iter::unzip::UnzipB<'_, rayon::iter::map::Map<rayon::vec::IntoIter<(rav1e::tiling::tiler::TileContextMut<'_, u8>, &mut rav1e::context::cdf_context::CDFContext)>, {closure@rav1e::encoder::encode_tile_group<u8>::{closure#0}}>, rayon::iter::unzip::Unzip, rayon::iter::collect::consumer::CollectConsumer<'_, std::vec::Vec<u8>>> as rayon::iter::ParallelIterator>::drive_unindexed::<rayon::iter::collect::consumer::CollectConsumer<'_, rav1e::stats::EncoderStats>>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-1.8.0/src/iter/unzip.rs:271:22: 271:57
    = note: inside closure at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-1.8.0/src/iter/collect/mod.rs:39:46: 39:74
    = note: inside `rayon::iter::collect::collect_with_consumer::<rav1e::stats::EncoderStats, {closure@rayon::iter::collect::special_extend<rayon::iter::unzip::UnzipB<'_, rayon::iter::map::Map<rayon::vec::IntoIter<(rav1e::tiling::tiler::TileContextMut<'_, u8>, &mut rav1e::context::cdf_context::CDFContext)>, {closure@rav1e::encoder::encode_tile_group<u8>::{closure#0}}>, rayon::iter::unzip::Unzip, rayon::iter::collect::consumer::CollectConsumer<'_, std::vec::Vec<u8>>>, rav1e::stats::EncoderStats>::{closure#0}}>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-1.8.0/src/iter/collect/mod.rs:84:18: 84:63
    = note: inside `rayon::iter::collect::special_extend::<rayon::iter::unzip::UnzipB<'_, rayon::iter::map::Map<rayon::vec::IntoIter<(rav1e::tiling::tiler::TileContextMut<'_, u8>, &mut rav1e::context::cdf_context::CDFContext)>, {closure@rav1e::encoder::encode_tile_group<u8>::{closure#0}}>, rayon::iter::unzip::Unzip, rayon::iter::collect::consumer::CollectConsumer<'_, std::vec::Vec<u8>>>, rav1e::stats::EncoderStats>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-1.8.0/src/iter/collect/mod.rs:39:5: 39:75
    = note: inside `rayon::iter::extend::<impl rayon::iter::ParallelExtend<rav1e::stats::EncoderStats> for std::vec::Vec<rav1e::stats::EncoderStats>>::par_extend::<rayon::iter::unzip::UnzipB<'_, rayon::iter::map::Map<rayon::vec::IntoIter<(rav1e::tiling::tiler::TileContextMut<'_, u8>, &mut rav1e::context::cdf_context::CDFContext)>, {closure@rav1e::encoder::encode_tile_group<u8>::{closure#0}}>, rayon::iter::unzip::Unzip, rayon::iter::collect::consumer::CollectConsumer<'_, std::vec::Vec<u8>>>>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-1.8.0/src/iter/extend.rs:582:17: 582:68
    = note: inside `<rayon::iter::unzip::UnzipA<'_, rayon::iter::map::Map<rayon::vec::IntoIter<(rav1e::tiling::tiler::TileContextMut<'_, u8>, &mut rav1e::context::cdf_context::CDFContext)>, {closure@rav1e::encoder::encode_tile_group<u8>::{closure#0}}>, rayon::iter::unzip::Unzip, std::vec::Vec<rav1e::stats::EncoderStats>> as rayon::iter::ParallelIterator>::drive_unindexed::<rayon::iter::collect::consumer::CollectConsumer<'_, std::vec::Vec<u8>>>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-1.8.0/src/iter/unzip.rs:221:13: 221:36
    = note: inside closure at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-1.8.0/src/iter/collect/mod.rs:39:46: 39:74
    = note: inside `rayon::iter::collect::collect_with_consumer::<std::vec::Vec<u8>, {closure@rayon::iter::collect::special_extend<rayon::iter::unzip::UnzipA<'_, rayon::iter::map::Map<rayon::vec::IntoIter<(rav1e::tiling::tiler::TileContextMut<'_, u8>, &mut rav1e::context::cdf_context::CDFContext)>, {closure@rav1e::encoder::encode_tile_group<u8>::{closure#0}}>, rayon::iter::unzip::Unzip, std::vec::Vec<rav1e::stats::EncoderStats>>, std::vec::Vec<u8>>::{closure#0}}>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-1.8.0/src/iter/collect/mod.rs:84:18: 84:63
    = note: inside `rayon::iter::collect::special_extend::<rayon::iter::unzip::UnzipA<'_, rayon::iter::map::Map<rayon::vec::IntoIter<(rav1e::tiling::tiler::TileContextMut<'_, u8>, &mut rav1e::context::cdf_context::CDFContext)>, {closure@rav1e::encoder::encode_tile_group<u8>::{closure#0}}>, rayon::iter::unzip::Unzip, std::vec::Vec<rav1e::stats::EncoderStats>>, std::vec::Vec<u8>>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-1.8.0/src/iter/collect/mod.rs:39:5: 39:75
    = note: inside `rayon::iter::extend::<impl rayon::iter::ParallelExtend<std::vec::Vec<u8>> for std::vec::Vec<std::vec::Vec<u8>>>::par_extend::<rayon::iter::unzip::UnzipA<'_, rayon::iter::map::Map<rayon::vec::IntoIter<(rav1e::tiling::tiler::TileContextMut<'_, u8>, &mut rav1e::context::cdf_context::CDFContext)>, {closure@rav1e::encoder::encode_tile_group<u8>::{closure#0}}>, rayon::iter::unzip::Unzip, std::vec::Vec<rav1e::stats::EncoderStats>>>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-1.8.0/src/iter/extend.rs:582:17: 582:68
    = note: inside `rayon::iter::unzip::execute_into::<rayon::iter::map::Map<rayon::vec::IntoIter<(rav1e::tiling::tiler::TileContextMut<'_, u8>, &mut rav1e::context::cdf_context::CDFContext)>, {closure@rav1e::encoder::encode_tile_group<u8>::{closure#0}}>, rayon::iter::unzip::Unzip, std::vec::Vec<std::vec::Vec<u8>>, std::vec::Vec<rav1e::stats::EncoderStats>>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-1.8.0/src/iter/unzip.rs:54:5: 54:23
    = note: inside `rayon::iter::unzip::execute::<rayon::iter::map::Map<rayon::vec::IntoIter<(rav1e::tiling::tiler::TileContextMut<'_, u8>, &mut rav1e::context::cdf_context::CDFContext)>, {closure@rav1e::encoder::encode_tile_group<u8>::{closure#0}}>, rayon::iter::unzip::Unzip, std::vec::Vec<std::vec::Vec<u8>>, std::vec::Vec<rav1e::stats::EncoderStats>>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-1.8.0/src/iter/unzip.rs:38:5: 38:41
    = note: inside `rayon::iter::unzip::unzip::<rayon::iter::map::Map<rayon::vec::IntoIter<(rav1e::tiling::tiler::TileContextMut<'_, u8>, &mut rav1e::context::cdf_context::CDFContext)>, {closure@rav1e::encoder::encode_tile_group<u8>::{closure#0}}>, std::vec::Vec<u8>, rav1e::stats::EncoderStats, std::vec::Vec<std::vec::Vec<u8>>, std::vec::Vec<rav1e::stats::EncoderStats>>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-1.8.0/src/iter/unzip.rs:69:5: 69:23
    = note: inside `<rayon::iter::map::Map<rayon::vec::IntoIter<(rav1e::tiling::tiler::TileContextMut<'_, u8>, &mut rav1e::context::cdf_context::CDFContext)>, {closure@rav1e::encoder::encode_tile_group<u8>::{closure#0}}> as rayon::iter::ParallelIterator>::unzip::<std::vec::Vec<u8>, rav1e::stats::EncoderStats, std::vec::Vec<std::vec::Vec<u8>>, std::vec::Vec<rav1e::stats::EncoderStats>>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-1.8.0/src/iter/mod.rs:2101:9: 2101:27
    = note: inside `rav1e::encoder::encode_tile_group::<u8>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.7.1/src/encoder.rs:3250:46: 3258:13
    = note: inside `rav1e::encoder::encode_frame::<u8>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.7.1/src/encoder.rs:3781:20: 3781:56
    = note: inside `rav1e::api::internal::ContextInner::<u8>::encode_normal_packet` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.7.1/src/api/internal.rs:1397:7: 1397:72
    = note: inside `rav1e::api::internal::ContextInner::<u8>::encode_packet` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.7.1/src/api/internal.rs:1276:7: 1276:52
    = note: inside `rav1e::api::internal::ContextInner::<u8>::receive_packet` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.7.1/src/api/internal.rs:1513:19: 1513:57
    = note: inside closure at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.7.1/src/api/context.rs:305:27: 305:49
    = note: inside `rav1e::api::context::Context::<u8>::receive_packet` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.7.1/src/api/context.rs:309:15: 309:20
    = note: inside `ravif::av1encoder::encode_to_av1::<u8, {closure@ravif::av1encoder::Encoder::encode_raw_planes<u8, std::iter::Map<imgref::iter::PixelsIter<'_, rgb::RGBA<u8>>, {closure@ravif::av1encoder::Encoder::encode_rgba::{closure#5}}>, std::iter::Map<imgref::iter::PixelsIter<'_, rgb::RGBA<u8>>, {closure@ravif::av1encoder::Encoder::encode_rgba::{closure#6}}>>::{closure#1}::{closure#0}}>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ravif-0.11.4/src/av1encoder.rs:668:15: 668:35
    = note: inside closure at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ravif-0.11.4/src/av1encoder.rs:346:32: 356:64
    = note: inside closure at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/join/mod.rs:102:18: 102:21
    = note: inside closure at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/join/mod.rs:124:17: 124:44
    = note: inside `<std::panic::AssertUnwindSafe<{closure@rayon_core::join::join_context::call_a<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, {closure@rayon_core::join::join::call<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, {closure@ravif::av1encoder::Encoder::encode_raw_planes<u8, std::iter::Map<imgref::iter::PixelsIter<'_, rgb::RGBA<u8>>, {closure@ravif::av1encoder::Encoder::encode_rgba::{closure#5}}>, std::iter::Map<imgref::iter::PixelsIter<'_, rgb::RGBA<u8>>, {closure@ravif::av1encoder::Encoder::encode_rgba::{closure#6}}>>::{closure#1}}>::{closure#0}}>::{closure#0}}> as std::ops::FnOnce<()>>::call_once` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/panic/unwind_safe.rs:272:9: 272:19
    = note: inside `std::panicking::r#try::do_call::<std::panic::AssertUnwindSafe<{closure@rayon_core::join::join_context::call_a<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, {closure@rayon_core::join::join::call<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, {closure@ravif::av1encoder::Encoder::encode_raw_planes<u8, std::iter::Map<imgref::iter::PixelsIter<'_, rgb::RGBA<u8>>, {closure@ravif::av1encoder::Encoder::encode_rgba::{closure#5}}>, std::iter::Map<imgref::iter::PixelsIter<'_, rgb::RGBA<u8>>, {closure@ravif::av1encoder::Encoder::encode_rgba::{closure#6}}>>::{closure#1}}>::{closure#0}}>::{closure#0}}>, std::result::Result<std::vec::Vec<u8>, ravif::error::Error>>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/panicking.rs:554:40: 554:43
    = note: inside `std::panicking::r#try::<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, std::panic::AssertUnwindSafe<{closure@rayon_core::join::join_context::call_a<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, {closure@rayon_core::join::join::call<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, {closure@ravif::av1encoder::Encoder::encode_raw_planes<u8, std::iter::Map<imgref::iter::PixelsIter<'_, rgb::RGBA<u8>>, {closure@ravif::av1encoder::Encoder::encode_rgba::{closure#5}}>, std::iter::Map<imgref::iter::PixelsIter<'_, rgb::RGBA<u8>>, {closure@ravif::av1encoder::Encoder::encode_rgba::{closure#6}}>>::{closure#1}}>::{closure#0}}>::{closure#0}}>>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/panicking.rs:518:19: 518:81
    = note: inside `std::panic::catch_unwind::<std::panic::AssertUnwindSafe<{closure@rayon_core::join::join_context::call_a<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, {closure@rayon_core::join::join::call<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, {closure@ravif::av1encoder::Encoder::encode_raw_planes<u8, std::iter::Map<imgref::iter::PixelsIter<'_, rgb::RGBA<u8>>, {closure@ravif::av1encoder::Encoder::encode_rgba::{closure#5}}>, std::iter::Map<imgref::iter::PixelsIter<'_, rgb::RGBA<u8>>, {closure@ravif::av1encoder::Encoder::encode_rgba::{closure#6}}>>::{closure#1}}>::{closure#0}}>::{closure#0}}>, std::result::Result<std::vec::Vec<u8>, ravif::error::Error>>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/panic.rs:142:14: 142:33
    = note: inside `rayon_core::unwind::halt_unwinding::<{closure@rayon_core::join::join_context::call_a<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, {closure@rayon_core::join::join::call<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, {closure@ravif::av1encoder::Encoder::encode_raw_planes<u8, std::iter::Map<imgref::iter::PixelsIter<'_, rgb::RGBA<u8>>, {closure@ravif::av1encoder::Encoder::encode_rgba::{closure#5}}>, std::iter::Map<imgref::iter::PixelsIter<'_, rgb::RGBA<u8>>, {closure@ravif::av1encoder::Encoder::encode_rgba::{closure#6}}>>::{closure#1}}>::{closure#0}}>::{closure#0}}, std::result::Result<std::vec::Vec<u8>, ravif::error::Error>>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/unwind.rs:17:5: 17:48
    = note: inside closure at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/join/mod.rs:142:24: 142:72
    = note: inside closure at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:521:21: 521:46
    = note: inside closure at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/job.rs:218:41: 218:51
    = note: inside `<std::panic::AssertUnwindSafe<{closure@rayon_core::job::JobResult<(std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, std::option::Option<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>>)>::call<{closure@rayon_core::registry::Registry::in_worker_cold<{closure@rayon_core::join::join_context<{closure@rayon_core::join::join::call<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, {closure@ravif::av1encoder::Encoder::encode_raw_planes<u8, std::iter::Map<imgref::iter::PixelsIter<'_, rgb::RGBA<u8>>, {closure@ravif::av1encoder::Encoder::encode_rgba::{closure#5}}>, std::iter::Map<imgref::iter::PixelsIter<'_, rgb::RGBA<u8>>, {closure@ravif::av1encoder::Encoder::encode_rgba::{closure#6}}>>::{closure#1}}>::{closure#0}}, {closure@rayon_core::join::join::call<std::option::Option<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>>, {closure@ravif::av1encoder::Encoder::encode_raw_planes<u8, std::iter::Map<imgref::iter::PixelsIter<'_, rgb::RGBA<u8>>, {closure@ravif::av1encoder::Encoder::encode_rgba::{closure#5}}>, std::iter::Map<imgref::iter::PixelsIter<'_, rgb::RGBA<u8>>, {closure@ravif::av1encoder::Encoder::encode_rgba::{closure#6}}>>::{closure#2}}>::{closure#0}}, std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, std::option::Option<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>>>::{closure#0}}, (std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, std::option::Option<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>>)>::{closure#0}::{closure#0}}>::{closure#0}}> as std::ops::FnOnce<()>>::call_once` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/panic/unwind_safe.rs:272:9: 272:19
    = note: inside `std::panicking::r#try::do_call::<std::panic::AssertUnwindSafe<{closure@rayon_core::job::JobResult<(std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, std::option::Option<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>>)>::call<{closure@rayon_core::registry::Registry::in_worker_cold<{closure@rayon_core::join::join_context<{closure@rayon_core::join::join::call<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, {closure@ravif::av1encoder::Encoder::encode_raw_planes<u8, std::iter::Map<imgref::iter::PixelsIter<'_, rgb::RGBA<u8>>, {closure@ravif::av1encoder::Encoder::encode_rgba::{closure#5}}>, std::iter::Map<imgref::iter::PixelsIter<'_, rgb::RGBA<u8>>, {closure@ravif::av1encoder::Encoder::encode_rgba::{closure#6}}>>::{closure#1}}>::{closure#0}}, {closure@rayon_core::join::join::call<std::option::Option<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>>, {closure@ravif::av1encoder::Encoder::encode_raw_planes<u8, std::iter::Map<imgref::iter::PixelsIter<'_, rgb::RGBA<u8>>, {closure@ravif::av1encoder::Encoder::encode_rgba::{closure#5}}>, std::iter::Map<imgref::iter::PixelsIter<'_, rgb::RGBA<u8>>, {closure@ravif::av1encoder::Encoder::encode_rgba::{closure#6}}>>::{closure#2}}>::{closure#0}}, std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, std::option::Option<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>>>::{closure#0}}, (std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, std::option::Option<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>>)>::{closure#0}::{closure#0}}>::{closure#0}}>, (std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, std::option::Option<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>>)>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/panicking.rs:554:40: 554:43
    = note: inside `std::panicking::r#try::<(std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, std::option::Option<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>>), std::panic::AssertUnwindSafe<{closure@rayon_core::job::JobResult<(std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, std::option::Option<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>>)>::call<{closure@rayon_core::registry::Registry::in_worker_cold<{closure@rayon_core::join::join_context<{closure@rayon_core::join::join::call<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, {closure@ravif::av1encoder::Encoder::encode_raw_planes<u8, std::iter::Map<imgref::iter::PixelsIter<'_, rgb::RGBA<u8>>, {closure@ravif::av1encoder::Encoder::encode_rgba::{closure#5}}>, std::iter::Map<imgref::iter::PixelsIter<'_, rgb::RGBA<u8>>, {closure@ravif::av1encoder::Encoder::encode_rgba::{closure#6}}>>::{closure#1}}>::{closure#0}}, {closure@rayon_core::join::join::call<std::option::Option<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>>, {closure@ravif::av1encoder::Encoder::encode_raw_planes<u8, std::iter::Map<imgref::iter::PixelsIter<'_, rgb::RGBA<u8>>, {closure@ravif::av1encoder::Encoder::encode_rgba::{closure#5}}>, std::iter::Map<imgref::iter::PixelsIter<'_, rgb::RGBA<u8>>, {closure@ravif::av1encoder::Encoder::encode_rgba::{closure#6}}>>::{closure#2}}>::{closure#0}}, std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, std::option::Option<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>>>::{closure#0}}, (std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, std::option::Option<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>>)>::{closure#0}::{closure#0}}>::{closure#0}}>>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/panicking.rs:518:19: 518:81
    = note: inside `std::panic::catch_unwind::<std::panic::AssertUnwindSafe<{closure@rayon_core::job::JobResult<(std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, std::option::Option<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>>)>::call<{closure@rayon_core::registry::Registry::in_worker_cold<{closure@rayon_core::join::join_context<{closure@rayon_core::join::join::call<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, {closure@ravif::av1encoder::Encoder::encode_raw_planes<u8, std::iter::Map<imgref::iter::PixelsIter<'_, rgb::RGBA<u8>>, {closure@ravif::av1encoder::Encoder::encode_rgba::{closure#5}}>, std::iter::Map<imgref::iter::PixelsIter<'_, rgb::RGBA<u8>>, {closure@ravif::av1encoder::Encoder::encode_rgba::{closure#6}}>>::{closure#1}}>::{closure#0}}, {closure@rayon_core::join::join::call<std::option::Option<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>>, {closure@ravif::av1encoder::Encoder::encode_raw_planes<u8, std::iter::Map<imgref::iter::PixelsIter<'_, rgb::RGBA<u8>>, {closure@ravif::av1encoder::Encoder::encode_rgba::{closure#5}}>, std::iter::Map<imgref::iter::PixelsIter<'_, rgb::RGBA<u8>>, {closure@ravif::av1encoder::Encoder::encode_rgba::{closure#6}}>>::{closure#2}}>::{closure#0}}, std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, std::option::Option<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>>>::{closure#0}}, (std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, std::option::Option<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>>)>::{closure#0}::{closure#0}}>::{closure#0}}>, (std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, std::option::Option<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>>)>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/panic.rs:142:14: 142:33
    = note: inside `rayon_core::unwind::halt_unwinding::<{closure@rayon_core::job::JobResult<(std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, std::option::Option<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>>)>::call<{closure@rayon_core::registry::Registry::in_worker_cold<{closure@rayon_core::join::join_context<{closure@rayon_core::join::join::call<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, {closure@ravif::av1encoder::Encoder::encode_raw_planes<u8, std::iter::Map<imgref::iter::PixelsIter<'_, rgb::RGBA<u8>>, {closure@ravif::av1encoder::Encoder::encode_rgba::{closure#5}}>, std::iter::Map<imgref::iter::PixelsIter<'_, rgb::RGBA<u8>>, {closure@ravif::av1encoder::Encoder::encode_rgba::{closure#6}}>>::{closure#1}}>::{closure#0}}, {closure@rayon_core::join::join::call<std::option::Option<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>>, {closure@ravif::av1encoder::Encoder::encode_raw_planes<u8, std::iter::Map<imgref::iter::PixelsIter<'_, rgb::RGBA<u8>>, {closure@ravif::av1encoder::Encoder::encode_rgba::{closure#5}}>, std::iter::Map<imgref::iter::PixelsIter<'_, rgb::RGBA<u8>>, {closure@ravif::av1encoder::Encoder::encode_rgba::{closure#6}}>>::{closure#2}}>::{closure#0}}, std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, std::option::Option<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>>>::{closure#0}}, (std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, std::option::Option<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>>)>::{closure#0}::{closure#0}}>::{closure#0}}, (std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, std::option::Option<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>>)>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/unwind.rs:17:5: 17:48
    = note: inside `rayon_core::job::JobResult::<(std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, std::option::Option<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>>)>::call::<{closure@rayon_core::registry::Registry::in_worker_cold<{closure@rayon_core::join::join_context<{closure@rayon_core::join::join::call<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, {closure@ravif::av1encoder::Encoder::encode_raw_planes<u8, std::iter::Map<imgref::iter::PixelsIter<'_, rgb::RGBA<u8>>, {closure@ravif::av1encoder::Encoder::encode_rgba::{closure#5}}>, std::iter::Map<imgref::iter::PixelsIter<'_, rgb::RGBA<u8>>, {closure@ravif::av1encoder::Encoder::encode_rgba::{closure#6}}>>::{closure#1}}>::{closure#0}}, {closure@rayon_core::join::join::call<std::option::Option<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>>, {closure@ravif::av1encoder::Encoder::encode_raw_planes<u8, std::iter::Map<imgref::iter::PixelsIter<'_, rgb::RGBA<u8>>, {closure@ravif::av1encoder::Encoder::encode_rgba::{closure#5}}>, std::iter::Map<imgref::iter::PixelsIter<'_, rgb::RGBA<u8>>, {closure@ravif::av1encoder::Encoder::encode_rgba::{closure#6}}>>::{closure#2}}>::{closure#0}}, std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, std::option::Option<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>>>::{closure#0}}, (std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, std::option::Option<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>>)>::{closure#0}::{closure#0}}>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/job.rs:218:15: 218:52
    = note: inside `<rayon_core::job::StackJob<rayon_core::latch::LatchRef<'_, rayon_core::latch::LockLatch>, {closure@rayon_core::registry::Registry::in_worker_cold<{closure@rayon_core::join::join_context<{closure@rayon_core::join::join::call<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, {closure@ravif::av1encoder::Encoder::encode_raw_planes<u8, std::iter::Map<imgref::iter::PixelsIter<'_, rgb::RGBA<u8>>, {closure@ravif::av1encoder::Encoder::encode_rgba::{closure#5}}>, std::iter::Map<imgref::iter::PixelsIter<'_, rgb::RGBA<u8>>, {closure@ravif::av1encoder::Encoder::encode_rgba::{closure#6}}>>::{closure#1}}>::{closure#0}}, {closure@rayon_core::join::join::call<std::option::Option<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>>, {closure@ravif::av1encoder::Encoder::encode_raw_planes<u8, std::iter::Map<imgref::iter::PixelsIter<'_, rgb::RGBA<u8>>, {closure@ravif::av1encoder::Encoder::encode_rgba::{closure#5}}>, std::iter::Map<imgref::iter::PixelsIter<'_, rgb::RGBA<u8>>, {closure@ravif::av1encoder::Encoder::encode_rgba::{closure#6}}>>::{closure#2}}>::{closure#0}}, std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, std::option::Option<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>>>::{closure#0}}, (std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, std::option::Option<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>>)>::{closure#0}::{closure#0}}, (std::result::Result<std::vec::Vec<u8>, ravif::error::Error>, std::option::Option<std::result::Result<std::vec::Vec<u8>, ravif::error::Error>>)> as rayon_core::job::Job>::execute` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/job.rs:120:32: 120:53
    = note: inside `rayon_core::job::JobRef::execute` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/job.rs:64:9: 64:40
    = note: inside `rayon_core::registry::WorkerThread::execute` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:859:9: 859:22
    = note: inside `rayon_core::registry::WorkerThread::wait_until_cold` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:793:21: 793:38
    = note: inside `rayon_core::registry::WorkerThread::wait_until::<rayon_core::latch::OnceLatch>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:768:13: 768:40
    = note: inside `rayon_core::registry::WorkerThread::wait_until_out_of_work` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:817:9: 817:65
    = note: inside `rayon_core::registry::main_loop` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:922:5: 922:43
    = note: inside `rayon_core::registry::ThreadBuilder::run` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:52:18: 52:33
    = note: inside closure at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rayon-core-1.12.0/src/registry.rs:97:20: 97:32
    = note: inside `std::sys_common::backtrace::__rust_begin_short_backtrace::<{closure@<rayon_core::registry::DefaultSpawn as rayon_core::registry::ThreadSpawn>::spawn::{closure#0}}, ()>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:155:18: 155:21
    = note: inside closure at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/thread/mod.rs:529:17: 529:78
    = note: inside `<std::panic::AssertUnwindSafe<{closure@std::thread::Builder::spawn_unchecked_<'_, '_, {closure@<rayon_core::registry::DefaultSpawn as rayon_core::registry::ThreadSpawn>::spawn::{closure#0}}, ()>::{closure#1}::{closure#0}}> as std::ops::FnOnce<()>>::call_once` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/panic/unwind_safe.rs:272:9: 272:19
    = note: inside `std::panicking::r#try::do_call::<std::panic::AssertUnwindSafe<{closure@std::thread::Builder::spawn_unchecked_<'_, '_, {closure@<rayon_core::registry::DefaultSpawn as rayon_core::registry::ThreadSpawn>::spawn::{closure#0}}, ()>::{closure#1}::{closure#0}}>, ()>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/panicking.rs:554:40: 554:43
    = note: inside `std::panicking::r#try::<(), std::panic::AssertUnwindSafe<{closure@std::thread::Builder::spawn_unchecked_<'_, '_, {closure@<rayon_core::registry::DefaultSpawn as rayon_core::registry::ThreadSpawn>::spawn::{closure#0}}, ()>::{closure#1}::{closure#0}}>>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/panicking.rs:518:19: 518:81
    = note: inside `std::panic::catch_unwind::<std::panic::AssertUnwindSafe<{closure@std::thread::Builder::spawn_unchecked_<'_, '_, {closure@<rayon_core::registry::DefaultSpawn as rayon_core::registry::ThreadSpawn>::spawn::{closure#0}}, ()>::{closure#1}::{closure#0}}>, ()>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/panic.rs:142:14: 142:33
    = note: inside closure at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/thread/mod.rs:528:30: 530:16
    = note: inside `<{closure@std::thread::Builder::spawn_unchecked_<'_, '_, {closure@<rayon_core::registry::DefaultSpawn as rayon_core::registry::ThreadSpawn>::spawn::{closure#0}}, ()>::{closure#1}} as std::ops::FnOnce<()>>::call_once - shim(vtable)` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5: 250:71
    = note: inside `<std::boxed::Box<dyn std::ops::FnOnce()> as std::ops::FnOnce<()>>::call_once` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/boxed.rs:2016:9: 2016:52
    = note: inside `<std::boxed::Box<std::boxed::Box<dyn std::ops::FnOnce()>> as std::ops::FnOnce<()>>::call_once` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/boxed.rs:2016:9: 2016:52
    = note: inside `std::sys::unix::thread::Thread::new::thread_start` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/unix/thread.rs:108:17: 108:64

error: aborting due to 1 previous error; 2 warnings emitted

crossbeam-epoch has had issues with Stacked Borrows violations in the past (see crossbeam-rs/crossbeam#545), but I don't know if this is related.

@fintelia
Copy link
Contributor

fintelia commented Jan 15, 2024

Given that crossbeam is quite widely used, I'd speculate that the undefined behavior that's causing the illegal instruction is coming from elsewhere. Any chance you'd be able to capture a backtrace, perhaps by running in GDB?

You also may be able to run rav1e directly and see if you still get the crash

@Shnatsel
Copy link
Contributor

I do recommend trying rav1e on its own, since the issue is likely cause by it (image doesn't contain any unsafe code in this path). You can use cavif for a quick an easy test.

rav1e relies on raw assembly internally so I don't think miri will be much help here since it doesn't support that. Address Sanitizer will fare better but it won't be able to instrument the assembly code either. Perhaps valgrind will be better since it runs the actual assembly?

@Shnatsel
Copy link
Contributor

Shnatsel commented Jan 16, 2024

Running miri with MIRIFLAGS=-Zmiri-tree-borrows might also be a good idea. It is a slightly more lax memory model that should not run into the "Stacked Borrows rules it violated are still experimental" sort of thing, hopefully pointing at the actual source of the UB.

@Shnatsel
Copy link
Contributor

Ah, crossbeam-epoch actually has UB and they use custom MIRIFLAGS to paper over it in CI:

https://github.com/crossbeam-rs/crossbeam/blob/3aa2598e3943c791e68d668d9f92e84e748bab65/ci/miri.sh#L25-L38

Let's copy their flags and see if miri turns up anything else. It'll probably fail once it reaches the assembly, and that's expected; the interesting part is whether it fails on anything else before reaching that point.

Thanks to @saethlin for discovering this!

@saethlin
Copy link

Based on their comments, crossbeam-epoch is just incompatible with Stacked Borrows, it's crossbeam-deque that actually has UB.

@fintelia
Copy link
Contributor

The original error is "illegal hardware instruction". How likely is it that some of the assembly just... contains an instruction that your CPU doesn't support?

@Shnatsel
Copy link
Contributor

On an M1 - not likely. The only thing I can think of that wouldn't be supported is SVE, and I doubt rav1e has any code using it considering that no hardware supporting it has actually shipped yet.

@saethlin
Copy link

I only observed UB on release builds with panic = "abort"

makes it distinctly unlikely that this is related to using an unavailable CPU feature.

@astral4
Copy link
Contributor Author

astral4 commented Jan 17, 2024

I've managed to reproduce this issue using just the rav1e crate. The repository containing my code is at https://github.com/astral4/avif-ub. The output of cargo +nightly miri run is:

Output
Preparing a sysroot for Miri (target: aarch64-apple-darwin)... done
     Running `/Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/bin/cargo-miri runner target/miri/aarch64-apple-darwin/debug/avif-ub`
error: Undefined Behavior: trying to retag from <12005408> for Unique permission at alloc1971676[0x1e], but that tag does not exist in the borrow stack for this location
   --> /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/slice/raw.rs:149:9
    |
149 |         &mut *ptr::slice_from_raw_parts_mut(data, len)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |         |
    |         trying to retag from <12005408> for Unique permission at alloc1971676[0x1e], but that tag does not exist in the borrow stack for this location
    |         this error occurs as part of retag at alloc1971676[0x0..0x12c]
    |
    = 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
help: <12005408> was created by a SharedReadWrite retag at offsets [0x0..0x1e]
   --> src/main.rs:23:10
    |
23  |     drop(context.receive_packet().unwrap());
    |          ^^^^^^^^^^^^^^^^^^^^^^^^
    = note: BACKTRACE (of the first span):
    = note: inside `std::slice::from_raw_parts_mut::<'_, rav1e::context::Block>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/slice/raw.rs:149:9: 149:55
    = note: inside `rav1e::tiling::TileBlocksMut::<'_>::for_each::<{closure@rav1e::tiling::TileBlocksMut<'_>::set_segmentation_idx::{closure#0}}>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.7.1/src/tiling/tile_blocks.rs:220:24: 220:36
    = note: inside `rav1e::tiling::TileBlocksMut::<'_>::set_segmentation_idx` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.7.1/src/tiling/tile_blocks.rs:262:5: 262:67
    = note: inside closure at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.7.1/src/rdo.rs:859:7: 859:62
    = note: inside `rav1e::rdo::luma_chroma_mode_rdo::<u8>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.7.1/src/rdo.rs:950:5: 950:22
    = note: inside closure at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.7.1/src/rdo.rs:1516:5: 1533:6
    = note: inside `<std::iter::Take<std::slice::Iter<'_, rav1e::prelude::PredictionMode>> as std::iter::adapters::take::SpecTake>::spec_for_each::<{closure@rav1e::rdo::intra_frame_rdo_mode_decision<u8>::{closure#2}}>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/iter/adapters/take.rs:318:13: 318:19
    = note: inside `<std::iter::Take<std::slice::Iter<'_, rav1e::prelude::PredictionMode>> as std::iter::Iterator>::for_each::<{closure@rav1e::rdo::intra_frame_rdo_mode_decision<u8>::{closure#2}}>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/iter/adapters/take.rs:115:9: 115:37
    = note: inside `rav1e::rdo::intra_frame_rdo_mode_decision::<u8>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.7.1/src/rdo.rs:1508:3: 1534:5
    = note: inside `rav1e::rdo::rdo_mode_decision::<u8>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.7.1/src/rdo.rs:998:12: 1008:6
    = note: inside `rav1e::encoder::encode_partition_bottomup::<u8, rav1e::ec::WriterBase<rav1e::ec::WriterRecorder>>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.7.1/src/encoder.rs:2696:7: 2696:63
    = note: inside `rav1e::encoder::encode_partition_bottomup::<u8, rav1e::ec::WriterBase<rav1e::ec::WriterRecorder>>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.7.1/src/encoder.rs:2806:32: 2817:10
    = note: inside `rav1e::encoder::encode_tile::<u8>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.7.1/src/encoder.rs:3516:9: 3527:10
    = note: inside closure at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.7.1/src/encoder.rs:3256:7: 3256:64
    = note: inside closure at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/iter/adapters/map.rs:85:28: 85:34
    = note: inside `<std::vec::IntoIter<(rav1e::tiling::TileContextMut<'_, u8>, &mut rav1e::context::CDFContext)> as std::iter::Iterator>::fold::<(), {closure@std::iter::adapters::map::map_fold<(rav1e::tiling::TileContextMut<'_, u8>, &mut rav1e::context::CDFContext), (std::vec::Vec<u8>, rav1e::data::EncoderStats), (), {closure@rav1e::encoder::encode_tile_group<u8>::{closure#0}}, {closure@<(ExtendA, ExtendB) as std::iter::Extend<(A, B)>>::extend::extend<std::vec::Vec<u8>, rav1e::data::EncoderStats, std::vec::Vec<std::vec::Vec<u8>>, std::vec::Vec<rav1e::data::EncoderStats>>::{closure#0}}>::{closure#0}}>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/iter/traits/iterator.rs:2640:21: 2640:32
    = note: inside `<std::iter::Map<std::vec::IntoIter<(rav1e::tiling::TileContextMut<'_, u8>, &mut rav1e::context::CDFContext)>, {closure@rav1e::encoder::encode_tile_group<u8>::{closure#0}}> as std::iter::Iterator>::fold::<(), {closure@<(ExtendA, ExtendB) as std::iter::Extend<(A, B)>>::extend::extend<std::vec::Vec<u8>, rav1e::data::EncoderStats, std::vec::Vec<std::vec::Vec<u8>>, std::vec::Vec<rav1e::data::EncoderStats>>::{closure#0}}>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/iter/adapters/map.rs:125:9: 125:50
    = note: inside `<(std::vec::Vec<std::vec::Vec<u8>>, std::vec::Vec<rav1e::data::EncoderStats>) as std::iter::Extend<(std::vec::Vec<u8>, rav1e::data::EncoderStats)>>::extend::<std::iter::Map<std::vec::IntoIter<(rav1e::tiling::TileContextMut<'_, u8>, &mut rav1e::context::CDFContext)>, {closure@rav1e::encoder::encode_tile_group<u8>::{closure#0}}>>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/iter/traits/collect.rs:443:9: 443:36
    = note: inside `<std::iter::Map<std::vec::IntoIter<(rav1e::tiling::TileContextMut<'_, u8>, &mut rav1e::context::CDFContext)>, {closure@rav1e::encoder::encode_tile_group<u8>::{closure#0}}> as std::iter::Iterator>::unzip::<std::vec::Vec<u8>, rav1e::data::EncoderStats, std::vec::Vec<std::vec::Vec<u8>>, std::vec::Vec<rav1e::data::EncoderStats>>` at /Users/***/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/iter/traits/iterator.rs:3450:9: 3450:30
    = note: inside `rav1e::encoder::encode_tile_group::<u8>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.7.1/src/encoder.rs:3250:46: 3258:13
    = note: inside `rav1e::encoder::encode_frame::<u8>` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.7.1/src/encoder.rs:3781:20: 3781:56
    = note: inside `rav1e::api::internal::ContextInner::<u8>::encode_normal_packet` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.7.1/src/api/internal.rs:1397:7: 1397:72
    = note: inside `rav1e::api::internal::ContextInner::<u8>::encode_packet` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.7.1/src/api/internal.rs:1276:7: 1276:52
    = note: inside `rav1e::api::internal::ContextInner::<u8>::receive_packet` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.7.1/src/api/internal.rs:1513:19: 1513:57
    = note: inside closure at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.7.1/src/api/context.rs:305:27: 305:49
    = note: inside `rav1e::Context::<u8>::receive_packet` at /Users/***/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rav1e-0.7.1/src/api/context.rs:309:15: 309:20
note: inside `main`
   --> src/main.rs:23:10
    |
23  |     drop(context.receive_packet().unwrap());
    |          ^^^^^^^^^^^^^^^^^^^^^^^^

note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

error: aborting due to 1 previous error

@Shnatsel
Copy link
Contributor

Great! That narrows things down a lot.

It's best to report it to the rav1e issue tracker: https://github.com/xiph/rav1e/issues

@saethlin
Copy link

That diagnostic is just identifying the &Header pattern, which Stacked Borrows does not allow and the fact that Stacked Borrows forbids the pattern is a known defect in Stacked Borrows. So the Miri reports in this thread are not educational; in some sense they are false positives. They are UB according to Stacked Borrows (which the diagnostic points out by linking documentation for the model and calling it experimental) but we do not optimize on this specific aspect of Stacked Borrows, so there is not necessarily any connection at all between these Miri diagnostics and the fact that you got a SIGILL.

Miri has an alternative aliasing model which fixes that issue, you can swap to it with MIRIFLAGS=-Zmiri-tree-borrows.

But in either case, I think that reducing an example that will SIGILL would also be very educational. There's an unexpected optimization happening, and reducing the unexpectly-optimized code would help point out whether this is UB or a miscompilation.

@astral4
Copy link
Contributor Author

astral4 commented Jan 18, 2024

I redid the work at https://github.com/astral4/avif-ub to isolate error signals like SIGILL instead of Miri complaints. Running in release mode with lto = true will result in a segfault.

@saethlin
Copy link

saethlin commented Jan 18, 2024

I'm looking at commit 749c3747356e233d84a33f376537695ffd2fa4e1, and just doing cargo +nightly run --release or cargo +stable run --release does not segfault. I also tried adding panic = "abort" and still no segfaults or sigills.

Perhaps there's some global Cargo setting you've set that is required to expose the issue? Can you cargo clean then cargo run --release --verbose (make sure that crashes) and paste the last rustc invocation? Mine looks like

Running `/home/ben/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rustc --crate-name avif_ub --edition=2021 src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=128 --crate-type bin --emit=dep-info,link -C opt-level=3 -C lto -C metadata=12bb65dfdc9a571b -C extra-filename=-12bb65dfdc9a571b --out-dir /tmp/avif-ub/target/release/deps -C strip=debuginfo -L dependency=/tmp/avif-ub/target/release/deps --extern avif_ub=/tmp/avif-ub/target/release/deps/libavif_ub-e615745521679927.rlib --extern rav1e=/tmp/avif-ub/target/release/deps/librav1e-f195f7593087d828.rlib`

@astral4
Copy link
Contributor Author

astral4 commented Jan 18, 2024

Mine looks like this:

Running `/Users/***/.rustup/toolchains/stable-aarch64-apple-darwin/bin/rustc --crate-name avif_ub --edition=2021 src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=224 --crate-type bin --emit=dep-info,link -C opt-level=3 -C lto -C metadata=2cfed1994cc482f1 -C extra-filename=-2cfed1994cc482f1 --out-dir /Users/***/Documents/GitHub/avif-ub/target/release/deps -L dependency=/Users/***/Documents/GitHub/avif-ub/target/release/deps --extern avif_ub=/Users/***/Documents/GitHub/avif-ub/target/release/deps/libavif_ub-4556493e8dcb1d54.rlib --extern rav1e=/Users/***/Documents/GitHub/avif-ub/target/release/deps/librav1e-0e71015f6d01b52d.rlib`

@saethlin
Copy link

I don't see any extra flags in there. I tried this on the M1 I have access to and I can't provoke a crash there either.

I believe you that there's a problem here, but I don't know how to work on this without the ability to reproduce it. If you can build a Dockerfile which provokes the segfault when built, that would almost certainly be reproducible.

@astral4
Copy link
Contributor Author

astral4 commented Jan 25, 2024

I give up on trying to reproduce this issue.

My goal was to build a Docker image containing a Rust toolchain that could compile to the aarch64-apple-darwin target. However, my efforts were unsuccessful.

First, I tried using cross. However, cross doesn't offer a pre-built image with the aarch64-apple-darwin target for legal reasons, so I had to build my own. I was able to extract a macOS SDK using OSXCross, but I failed to build the image because some Ubuntu repositories no longer have release files:

Output
... cross % cargo build-docker-image aarch64-apple-darwin-cross --build-arg 'MACOS_SDK_DIR=cross-toolchains/docker/sdk' --build-arg 'MACOS_SDK_FILE=MacOSX14.0.sdk.tar.xz' 
    Finished dev [unoptimized + debuginfo] target(s) in 0.19s
     Running `target/debug/xtask build-docker-image aarch64-apple-darwin-cross --build-arg MACOS_SDK_DIR=cross-toolchains/docker/sdk --build-arg MACOS_SDK_FILE=MacOSX14.0.sdk.tar.xz`
[cross] note: Build aarch64-apple-darwin-cross for x86_64-unknown-linux-gnu
[+] Building 441.9s (15/18)                                                                                                                                                                                                     
 => [internal] load build definition from Dockerfile.aarch64-apple-darwin-cross                                                                                                                                            0.0s
 => => transferring dockerfile: 1.17kB                                                                                                                                                                                     0.0s
 => [internal] load .dockerignore                                                                                                                                                                                          0.0s
 => => transferring context: 223B                                                                                                                                                                                          0.0s
 => [internal] load metadata for docker.io/library/ubuntu:20.04                                                                                                                                                            1.2s
 => ERROR importing cache manifest from ghcr.io/cross-rs/aarch64-apple-darwin-cross:main                                                                                                                                   0.4s
 => [ 1/13] FROM docker.io/library/ubuntu:20.04@sha256:f2034e7195f61334e6caff6ecf2e965f92d11e888309065da85ff50c617732b8                                                                                                    1.3s
 => => resolve docker.io/library/ubuntu:20.04@sha256:f2034e7195f61334e6caff6ecf2e965f92d11e888309065da85ff50c617732b8                                                                                                      0.0s
 => => sha256:bac6081102aae54ba4bcc714695b8f637e42768c7f376f374c428bab043ddc0f 424B / 424B                                                                                                                                 0.0s
 => => sha256:f78909c2b360d866b3220655c0b079838258b8891a12ac25fc670f0cbb54229f 2.30kB / 2.30kB                                                                                                                             0.0s
 => => sha256:527f5363b98e562da03d2e0bbf86fd7c34f487bffd9b27a3cf0a9afea2f0ee1f 27.51MB / 27.51MB                                                                                                                           0.8s
 => => sha256:f2034e7195f61334e6caff6ecf2e965f92d11e888309065da85ff50c617732b8 1.13kB / 1.13kB                                                                                                                             0.0s
 => => extracting sha256:527f5363b98e562da03d2e0bbf86fd7c34f487bffd9b27a3cf0a9afea2f0ee1f                                                                                                                                  0.4s
 => [internal] load build context                                                                                                                                                                                          0.9s
 => => transferring context: 67.18MB                                                                                                                                                                                       0.8s
 => [ 2/13] COPY common.sh lib.sh /                                                                                                                                                                                        0.1s
 => [ 3/13] RUN /common.sh                                                                                                                                                                                               243.2s
 => [ 4/13] COPY cmake.sh /                                                                                                                                                                                                0.0s 
 => [ 5/13] RUN /cmake.sh                                                                                                                                                                                                 20.2s 
 => [ 6/13] COPY xargo.sh /                                                                                                                                                                                                0.0s 
 => [ 7/13] RUN /xargo.sh                                                                                                                                                                                                111.5s 
 => [ 8/13] COPY cross-toolchains/docker/sdk/MacOSX14.0.sdk.tar.xz* /                                                                                                                                                      0.2s 
 => [ 9/13] COPY cross-toolchains/docker/darwin.sh /                                                                                                                                                                       0.0s 
 => ERROR [10/13] RUN /darwin.sh                                                                                                                                                                                          63.7s 
------                                                                                                                                                                                                                          
 > importing cache manifest from ghcr.io/cross-rs/aarch64-apple-darwin-cross:main:                                                                                                                                              
------                                                                                                                                                                                                                          
------                                                                                                                                                                                                                          
 > [10/13] RUN /darwin.sh:                                                                                                                                                                                                      
#0 0.214 + set -eo pipefail                                                                                                                                                                                                     
#0 0.215 + . lib.sh
#0 0.216 ++ purge_list=()
#0 0.219 ++ GNU_MIRRORS=("https://ftp.gnu.org/gnu/" "https://ftpmirror.gnu.org/")
#0 0.224 + [[ MacOSX14.0.sdk.tar.xz == \n\o\n\e\x\i\s\t\e\n\t ]]
#0 0.225 + main
#0 0.226 + local commit=17bb5e2d0a46533c1dd525cf4e9a80d88bd9f00e
#0 0.226 + install_packages curl gcc g++ make patch xz-utils python
#0 0.227 + grep -i ubuntu /etc/os-release
#0 0.252 NAME="Ubuntu"
#0 0.252 ID=ubuntu
#0 0.252 PRETTY_NAME="Ubuntu 20.04.6 LTS"
#0 0.252 HOME_URL="https://www.ubuntu.com/"
#0 0.252 SUPPORT_URL="https://help.ubuntu.com/"
#0 0.252 BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
#0 0.252 PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
#0 0.252 UBUNTU_CODENAME=focal
#0 0.254 + apt-get update
#0 1.161 Hit:1 http://security.archive.ubuntu.com/ubuntu focal-security InRelease
#0 1.161 Hit:2 http://archive.archive.ubuntu.com/ubuntu focal InRelease
#0 1.162 Hit:3 http://archive.archive.ubuntu.com/ubuntu focal-updates InRelease
#0 1.162 Hit:4 http://archive.archive.ubuntu.com/ubuntu focal-backports InRelease
#0 1.162 Hit:5 http://ports.ubuntu.com/ubuntu-ports focal InRelease
#0 1.239 Hit:6 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease
#0 1.315 Hit:7 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease
#0 1.391 Hit:8 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease
#0 9.641 Reading package lists...
#0 16.06 + for pkg in "${@}"
#0 16.06 + dpkg -L curl
#0 16.12 + for pkg in "${@}"
#0 16.12 + dpkg -L gcc
#0 16.17 + for pkg in "${@}"
#0 16.17 + dpkg -L g++
#0 16.23 + for pkg in "${@}"
#0 16.23 + dpkg -L make
#0 16.28 + for pkg in "${@}"
#0 16.28 + dpkg -L patch
#0 16.33 + apt-get install --assume-yes --no-install-recommends patch
#0 16.89 Reading package lists...
#0 23.18 Building dependency tree...
#0 23.89 Reading state information...
#0 24.42 Suggested packages:
#0 24.42   ed diffutils-doc
#0 24.50 The following NEW packages will be installed:
#0 24.50   patch
#0 25.25 0 upgraded, 1 newly installed, 0 to remove and 8 not upgraded.
#0 25.25 Need to get 105 kB of archives.
#0 25.25 After this operation, 238 kB of additional disk space will be used.
#0 25.25 Get:1 http://archive.archive.ubuntu.com/ubuntu focal/main amd64 patch amd64 2.7.6-6 [105 kB]
#0 25.93 debconf: delaying package configuration, since apt-utils is not installed
#0 26.04 Fetched 105 kB in 1s (110 kB/s)
#0 26.16 Selecting previously unselected package patch.
(Reading database ... 12603 files and directories currently installed.)
#0 26.18 Preparing to unpack .../patch_2.7.6-6_amd64.deb ...
#0 26.18 Unpacking patch (2.7.6-6) ...
#0 26.34 Setting up patch (2.7.6-6) ...
#0 26.43 + purge_list+=("${pkg}")
#0 26.43 + for pkg in "${@}"
#0 26.43 + dpkg -L xz-utils
#0 26.48 + apt-get install --assume-yes --no-install-recommends xz-utils
#0 27.03 Reading package lists...
#0 33.31 Building dependency tree...
#0 34.01 Reading state information...
#0 34.65 The following NEW packages will be installed:
#0 34.65   xz-utils
#0 34.76 0 upgraded, 1 newly installed, 0 to remove and 8 not upgraded.
#0 34.76 Need to get 82.6 kB of archives.
#0 34.76 After this operation, 356 kB of additional disk space will be used.
#0 34.76 Get:1 http://archive.archive.ubuntu.com/ubuntu focal-updates/main amd64 xz-utils amd64 5.2.4-1ubuntu1.1 [82.6 kB]
#0 35.23 debconf: delaying package configuration, since apt-utils is not installed
#0 35.33 Fetched 82.6 kB in 0s (696 kB/s)
#0 35.44 Selecting previously unselected package xz-utils.
(Reading database ... 12612 files and directories currently installed.)
#0 35.46 Preparing to unpack .../xz-utils_5.2.4-1ubuntu1.1_amd64.deb ...
#0 35.47 Unpacking xz-utils (5.2.4-1ubuntu1.1) ...
#0 35.61 Setting up xz-utils (5.2.4-1ubuntu1.1) ...
#0 35.66 update-alternatives: using /usr/bin/xz to provide /usr/bin/lzma (lzma) in auto mode
#0 35.66 update-alternatives: warning: skip creation of /usr/share/man/man1/lzma.1.gz because associated file /usr/share/man/man1/xz.1.gz (of link group lzma) doesn't exist
#0 35.66 update-alternatives: warning: skip creation of /usr/share/man/man1/unlzma.1.gz because associated file /usr/share/man/man1/unxz.1.gz (of link group lzma) doesn't exist
#0 35.66 update-alternatives: warning: skip creation of /usr/share/man/man1/lzcat.1.gz because associated file /usr/share/man/man1/xzcat.1.gz (of link group lzma) doesn't exist
#0 35.66 update-alternatives: warning: skip creation of /usr/share/man/man1/lzmore.1.gz because associated file /usr/share/man/man1/xzmore.1.gz (of link group lzma) doesn't exist
#0 35.66 update-alternatives: warning: skip creation of /usr/share/man/man1/lzless.1.gz because associated file /usr/share/man/man1/xzless.1.gz (of link group lzma) doesn't exist
#0 35.66 update-alternatives: warning: skip creation of /usr/share/man/man1/lzdiff.1.gz because associated file /usr/share/man/man1/xzdiff.1.gz (of link group lzma) doesn't exist
#0 35.66 update-alternatives: warning: skip creation of /usr/share/man/man1/lzcmp.1.gz because associated file /usr/share/man/man1/xzcmp.1.gz (of link group lzma) doesn't exist
#0 35.66 update-alternatives: warning: skip creation of /usr/share/man/man1/lzgrep.1.gz because associated file /usr/share/man/man1/xzgrep.1.gz (of link group lzma) doesn't exist
#0 35.66 update-alternatives: warning: skip creation of /usr/share/man/man1/lzegrep.1.gz because associated file /usr/share/man/man1/xzegrep.1.gz (of link group lzma) doesn't exist
#0 35.66 update-alternatives: warning: skip creation of /usr/share/man/man1/lzfgrep.1.gz because associated file /usr/share/man/man1/xzfgrep.1.gz (of link group lzma) doesn't exist
#0 35.75 + purge_list+=("${pkg}")
#0 35.75 + for pkg in "${@}"
#0 35.75 + dpkg -L python
#0 35.81 + apt-get install --assume-yes --no-install-recommends python
#0 36.35 Reading package lists...
#0 42.60 Building dependency tree...
#0 43.30 Reading state information...
#0 43.81 The following additional packages will be installed:
#0 43.81   libpython2-stdlib libpython2.7-minimal libpython2.7-stdlib libreadline8
#0 43.81   mime-support python2 python2-minimal python2.7 python2.7-minimal
#0 43.81   readline-common
#0 43.81 Suggested packages:
#0 43.81   python2-doc python-tk python2.7-doc binfmt-support readline-doc
#0 44.17 The following NEW packages will be installed:
#0 44.17   libpython2-stdlib libpython2.7-minimal libpython2.7-stdlib libreadline8
#0 44.17   mime-support python-is-python2 python2 python2-minimal python2.7
#0 44.18   python2.7-minimal readline-common
#0 44.29 0 upgraded, 11 newly installed, 0 to remove and 8 not upgraded.
#0 44.29 Need to get 4030 kB of archives.
#0 44.29 After this operation, 17.1 MB of additional disk space will be used.
#0 44.29 Get:1 http://archive.archive.ubuntu.com/ubuntu focal-updates/universe amd64 libpython2.7-minimal amd64 2.7.18-1~20.04.3 [336 kB]
#0 44.35 Get:2 http://archive.archive.ubuntu.com/ubuntu focal-updates/universe amd64 python2.7-minimal amd64 2.7.18-1~20.04.3 [1280 kB]
#0 44.51 Get:3 http://archive.archive.ubuntu.com/ubuntu focal/universe amd64 python2-minimal amd64 2.7.17-2ubuntu4 [27.5 kB]
#0 44.51 Get:4 http://archive.archive.ubuntu.com/ubuntu focal/main amd64 mime-support all 3.64ubuntu1 [30.6 kB]
#0 44.52 Get:5 http://archive.archive.ubuntu.com/ubuntu focal/main amd64 readline-common all 8.0-4 [53.5 kB]
#0 44.52 Get:6 http://archive.archive.ubuntu.com/ubuntu focal/main amd64 libreadline8 amd64 8.0-4 [131 kB]
#0 44.53 Get:7 http://archive.archive.ubuntu.com/ubuntu focal-updates/universe amd64 libpython2.7-stdlib amd64 2.7.18-1~20.04.3 [1888 kB]
#0 44.76 Get:8 http://archive.archive.ubuntu.com/ubuntu focal-updates/universe amd64 python2.7 amd64 2.7.18-1~20.04.3 [248 kB]
#0 44.79 Get:9 http://archive.archive.ubuntu.com/ubuntu focal/universe amd64 libpython2-stdlib amd64 2.7.17-2ubuntu4 [7072 B]
#0 44.79 Get:10 http://archive.archive.ubuntu.com/ubuntu focal/universe amd64 python2 amd64 2.7.17-2ubuntu4 [26.5 kB]
#0 44.80 Get:11 http://archive.archive.ubuntu.com/ubuntu focal/universe amd64 python-is-python2 all 2.7.17-4 [2496 B]
#0 45.23 debconf: delaying package configuration, since apt-utils is not installed
#0 45.34 Fetched 4030 kB in 1s (6649 kB/s)
#0 45.46 Selecting previously unselected package libpython2.7-minimal:amd64.
(Reading database ... 12649 files and directories currently installed.)
#0 45.48 Preparing to unpack .../0-libpython2.7-minimal_2.7.18-1~20.04.3_amd64.deb ...
#0 45.48 Unpacking libpython2.7-minimal:amd64 (2.7.18-1~20.04.3) ...
#0 45.68 Selecting previously unselected package python2.7-minimal.
#0 45.69 Preparing to unpack .../1-python2.7-minimal_2.7.18-1~20.04.3_amd64.deb ...
#0 45.74 Unpacking python2.7-minimal (2.7.18-1~20.04.3) ...
#0 46.14 Selecting previously unselected package python2-minimal.
#0 46.15 Preparing to unpack .../2-python2-minimal_2.7.17-2ubuntu4_amd64.deb ...
#0 46.15 Unpacking python2-minimal (2.7.17-2ubuntu4) ...
#0 46.28 Selecting previously unselected package mime-support.
#0 46.28 Preparing to unpack .../3-mime-support_3.64ubuntu1_all.deb ...
#0 46.28 Unpacking mime-support (3.64ubuntu1) ...
#0 46.40 Selecting previously unselected package readline-common.
#0 46.40 Preparing to unpack .../4-readline-common_8.0-4_all.deb ...
#0 46.40 Unpacking readline-common (8.0-4) ...
#0 46.53 Selecting previously unselected package libreadline8:amd64.
#0 46.53 Preparing to unpack .../5-libreadline8_8.0-4_amd64.deb ...
#0 46.54 Unpacking libreadline8:amd64 (8.0-4) ...
#0 46.69 Selecting previously unselected package libpython2.7-stdlib:amd64.
#0 46.69 Preparing to unpack .../6-libpython2.7-stdlib_2.7.18-1~20.04.3_amd64.deb ...
#0 46.69 Unpacking libpython2.7-stdlib:amd64 (2.7.18-1~20.04.3) ...
#0 47.22 Selecting previously unselected package python2.7.
#0 47.23 Preparing to unpack .../7-python2.7_2.7.18-1~20.04.3_amd64.deb ...
#0 47.23 Unpacking python2.7 (2.7.18-1~20.04.3) ...
#0 47.37 Selecting previously unselected package libpython2-stdlib:amd64.
#0 47.37 Preparing to unpack .../8-libpython2-stdlib_2.7.17-2ubuntu4_amd64.deb ...
#0 47.37 Unpacking libpython2-stdlib:amd64 (2.7.17-2ubuntu4) ...
#0 47.50 Setting up libpython2.7-minimal:amd64 (2.7.18-1~20.04.3) ...
#0 47.55 Setting up python2.7-minimal (2.7.18-1~20.04.3) ...
#0 48.69 Setting up python2-minimal (2.7.17-2ubuntu4) ...
#0 49.01 Selecting previously unselected package python2.
(Reading database ... 13447 files and directories currently installed.)
#0 49.03 Preparing to unpack .../python2_2.7.17-2ubuntu4_amd64.deb ...
#0 49.03 Unpacking python2 (2.7.17-2ubuntu4) ...
#0 49.16 Selecting previously unselected package python-is-python2.
#0 49.16 Preparing to unpack .../python-is-python2_2.7.17-4_all.deb ...
#0 49.16 Unpacking python-is-python2 (2.7.17-4) ...
#0 49.30 Setting up mime-support (3.64ubuntu1) ...
#0 49.49 Setting up readline-common (8.0-4) ...
#0 49.53 Setting up libreadline8:amd64 (8.0-4) ...
#0 49.53 Setting up libpython2.7-stdlib:amd64 (2.7.18-1~20.04.3) ...
#0 49.54 Setting up python2.7 (2.7.18-1~20.04.3) ...
#0 51.74 Setting up libpython2-stdlib:amd64 (2.7.17-2ubuntu4) ...
#0 51.75 Setting up python2 (2.7.17-2ubuntu4) ...
#0 51.75 Setting up python-is-python2 (2.7.17-4) ...
#0 51.75 Processing triggers for libc-bin (2.31-0ubuntu9.14) ...
#0 51.95 + purge_list+=("${pkg}")
#0 51.95 + apt-get update
#0 52.83 Hit:1 http://security.archive.ubuntu.com/ubuntu focal-security InRelease
#0 52.83 Hit:2 http://archive.archive.ubuntu.com/ubuntu focal InRelease
#0 52.83 Hit:3 http://archive.archive.ubuntu.com/ubuntu focal-updates InRelease
#0 52.83 Hit:4 http://archive.archive.ubuntu.com/ubuntu focal-backports InRelease
#0 52.84 Ign:5 http://ports.ubuntu.com/ubuntu-ports focal InRelease
#0 52.84 Ign:6 http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease
#0 52.84 Ign:7 http://ports.ubuntu.com/ubuntu-ports focal-backports InRelease
#0 52.84 Ign:8 http://ports.ubuntu.com/ubuntu-ports focal-security InRelease
#0 52.85 Err:9 http://ports.ubuntu.com/ubuntu-ports focal Release
#0 52.85   404  Not Found [IP: 185.125.190.36 80]
#0 52.87 Err:10 http://ports.ubuntu.com/ubuntu-ports focal-updates Release
#0 52.87   404  Not Found [IP: 185.125.190.36 80]
#0 52.88 Err:11 http://ports.ubuntu.com/ubuntu-ports focal-backports Release
#0 52.88   404  Not Found [IP: 185.125.190.36 80]
#0 52.88 Err:12 http://ports.ubuntu.com/ubuntu-ports focal-security Release
#0 52.88   404  Not Found [IP: 185.125.190.36 80]
#0 57.34 Reading package lists...
#0 63.67 E: The repository 'http://ports.ubuntu.com/ubuntu-ports focal Release' no longer has a Release file.
#0 63.67 E: The repository 'http://ports.ubuntu.com/ubuntu-ports focal-updates Release' no longer has a Release file.
#0 63.67 E: The repository 'http://ports.ubuntu.com/ubuntu-ports focal-backports Release' no longer has a Release file.
#0 63.68 E: The repository 'http://ports.ubuntu.com/ubuntu-ports focal-security Release' no longer has a Release file.
------
ERROR: failed to solve: executor failed running [/bin/sh -c /darwin.sh]: exit code: 100
Error: 
   0: some error(s) encountered

Location:
   xtask/src/build_docker_image.rs:346

Error:

      0: `docker buildx build --platform linux/amd64 --build-arg 'CROSS_TARGET_TRIPLE=AARCH64_APPLE_DARWIN_CROSS' --load --pull --cache-from 'type=registry,ref=ghcr.io/cross-rs/aarch64-apple-darwin-cross:main' --tag ghcr.io/cross-rs/aarch64-apple-darwin-cross:local --label 'org.cross-rs.for-cross-target=aarch64-apple-darwin-cross' --label 'org.cross-rs.runs-with=x86_64-unknown-linux-gnu' --file /Users/.../Documents/GitHub/avif-ub/cross/docker/cross-toolchains/docker/Dockerfile.aarch64-apple-darwin-cross --progress auto --build-arg 'MACOS_SDK_DIR=cross-toolchains/docker/sdk' --build-arg 'MACOS_SDK_FILE=MacOSX14.0.sdk.tar.xz' .` failed with exit status: 1

   Location:
      xtask/src/build_docker_image.rs:309

   Warning: call to docker failed
   Suggestion: is `buildx` available for the container engine?
   Note: disable the `buildkit` dependency optionally with `CROSS_CONTAINER_ENGINE_NO_BUILDKIT=1`

I was stuck because I had no idea how to address this, so I looked for another approach. Next, I tried using a pre-built image from this repository. I was able to successfully compile the program, but I didn't observe SIGILL/SIGSEGV. Then, I tried to reproduce the issue using ravif (i.e. compiling the program at this commit), but the program didn't even successfully compile because the build script for rav1e produced an error:

Output
... avif-ub % docker run --rm --volume "${PWD}":/root/src --workdir /root/src joseluisq/rust-linux-darwin-builder:1.75.0 sh -c "cargo build --release --target aarch64-apple-darwin" && ./target/aarch64-apple-darwin/release/avif-ub
   ...
The following warnings were emitted during compilation:

warning: rav1e@0.7.1: cc: error: unrecognized command-line option '-arch'; did you mean '-march='?
warning: rav1e@0.7.1: ToolExecError: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/cdef.o" "-c" "src/arm/64/cdef.S" with args "cc" did not execute successfully (status code exit status: 1).running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/cdef16.o" "-c" "src/arm/64/cdef16.S"
warning: rav1e@0.7.1: cc: error: unrecognized command-line option '-arch'; did you mean '-march='?
warning: rav1e@0.7.1: ToolExecError: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/cdef16.o" "-c" "src/arm/64/cdef16.S" with args "cc" did not execute successfully (status code exit status: 1).running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/cdef_dist.o" "-c" "src/arm/64/cdef_dist.S"
warning: rav1e@0.7.1: cc: error: unrecognized command-line option '-arch'; did you mean '-march='?
warning: rav1e@0.7.1: ToolExecError: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/cdef_dist.o" "-c" "src/arm/64/cdef_dist.S" with args "cc" did not execute successfully (status code exit status: 1).running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/mc.o" "-c" "src/arm/64/mc.S"
warning: rav1e@0.7.1: cc: error: unrecognized command-line option '-arch'; did you mean '-march='?
warning: rav1e@0.7.1: ToolExecError: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/mc.o" "-c" "src/arm/64/mc.S" with args "cc" did not execute successfully (status code exit status: 1).running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/mc16.o" "-c" "src/arm/64/mc16.S"
warning: rav1e@0.7.1: cc: error: unrecognized command-line option '-arch'; did you mean '-march='?
warning: rav1e@0.7.1: ToolExecError: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/mc16.o" "-c" "src/arm/64/mc16.S" with args "cc" did not execute successfully (status code exit status: 1).running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/itx.o" "-c" "src/arm/64/itx.S"
warning: rav1e@0.7.1: cc: error: unrecognized command-line option '-arch'; did you mean '-march='?
warning: rav1e@0.7.1: ToolExecError: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/itx.o" "-c" "src/arm/64/itx.S" with args "cc" did not execute successfully (status code exit status: 1).running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/ipred.o" "-c" "src/arm/64/ipred.S"
warning: rav1e@0.7.1: cc: error: unrecognized command-line option '-arch'; did you mean '-march='?
warning: rav1e@0.7.1: cc: error: unrecognized command-line option '-arch'; did you mean '-march='?
warning: rav1e@0.7.1: ToolExecError: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/itx16.o" "-c" "src/arm/64/itx16.S" with args "cc" did not execute successfully (status code exit status: 1).
warning: rav1e@0.7.1: ToolExecError: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/ipred.o" "-c" "src/arm/64/ipred.S" with args "cc" did not execute successfully (status code exit status: 1).running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/ipred16.o" "-c" "src/arm/64/ipred16.S"
warning: rav1e@0.7.1: cc: error: unrecognized command-line option '-arch'; did you mean '-march='?
warning: rav1e@0.7.1: cc: error: unrecognized command-line option '-arch'; did you mean '-march='?
warning: rav1e@0.7.1: ToolExecError: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/ipred16.o" "-c" "src/arm/64/ipred16.S" with args "cc" did not execute successfully (status code exit status: 1).
warning: rav1e@0.7.1: ToolExecError: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/sad.o" "-c" "src/arm/64/sad.S" with args "cc" did not execute successfully (status code exit status: 1).running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/satd.o" "-c" "src/arm/64/satd.S"
warning: rav1e@0.7.1: cc: error: unrecognized command-line option '-arch'; did you mean '-march='?
warning: rav1e@0.7.1: cc: error: unrecognized command-line option '-arch'; did you mean '-march='?
warning: rav1e@0.7.1: ToolExecError: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/satd.o" "-c" "src/arm/64/satd.S" with args "cc" did not execute successfully (status code exit status: 1).
warning: rav1e@0.7.1: ToolExecError: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/sse.o" "-c" "src/arm/64/sse.S" with args "cc" did not execute successfully (status code exit status: 1).running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/tables.o" "-c" "src/arm/tables.S"
warning: rav1e@0.7.1: cc: error: unrecognized command-line option '-arch'; did you mean '-march='?
warning: rav1e@0.7.1: ToolExecError: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/tables.o" "-c" "src/arm/tables.S" with args "cc" did not execute successfully (status code exit status: 1).

error: failed to run custom build command for `rav1e v0.7.1`

Caused by:
  process didn't exit successfully: `/root/src/target/release/build/rav1e-07a377f8147e24fe/build-script-build` (exit status: 1)
  --- stdout
  cargo:rustc-cfg=asm_neon
  TARGET = Some("aarch64-apple-darwin")
  OPT_LEVEL = Some("3")
  HOST = Some("aarch64-unknown-linux-gnu")
  cargo:rerun-if-env-changed=CC_aarch64-apple-darwin
  CC_aarch64-apple-darwin = None
  cargo:rerun-if-env-changed=CC_aarch64_apple_darwin
  CC_aarch64_apple_darwin = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  RUSTC_LINKER = Some("arm64e-apple-darwin22.4-clang")
  cargo:rerun-if-env-changed=CROSS_COMPILE
  CROSS_COMPILE = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("false")
  CARGO_CFG_TARGET_FEATURE = Some("aes,crc,dit,dotprod,dpb,dpb2,fcma,fhm,flagm,fp16,frintts,jsconv,lor,lse,neon,paca,pacg,pan,pmuv3,ras,rcpc,rcpc2,rdm,sb,sha2,sha3,ssbs,vh")
  cargo:rerun-if-env-changed=CFLAGS_aarch64-apple-darwin
  CFLAGS_aarch64-apple-darwin = None
  cargo:rerun-if-env-changed=CFLAGS_aarch64_apple_darwin
  CFLAGS_aarch64_apple_darwin = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/cdef.o" "-c" "src/arm/64/cdef.S"
  cargo:warning=cc: error: unrecognized command-line option '-arch'; did you mean '-march='?

  exit status: 1
  cargo:warning=ToolExecError: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/cdef.o" "-c" "src/arm/64/cdef.S" with args "cc" did not execute successfully (status code exit status: 1).running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/cdef16.o" "-c" "src/arm/64/cdef16.S"
  cargo:warning=cc: error: unrecognized command-line option '-arch'; did you mean '-march='?


  exit status: 1
  cargo:warning=ToolExecError: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/cdef16.o" "-c" "src/arm/64/cdef16.S" with args "cc" did not execute successfully (status code exit status: 1).running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/cdef_dist.o" "-c" "src/arm/64/cdef_dist.S"
  cargo:warning=cc: error: unrecognized command-line option '-arch'; did you mean '-march='?


  exit status: 1
  cargo:warning=ToolExecError: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/cdef_dist.o" "-c" "src/arm/64/cdef_dist.S" with args "cc" did not execute successfully (status code exit status: 1).running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/mc.o" "-c" "src/arm/64/mc.S"
  cargo:warning=cc: error: unrecognized command-line option '-arch'; did you mean '-march='?


  exit status: 1
  cargo:warning=ToolExecError: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/mc.o" "-c" "src/arm/64/mc.S" with args "cc" did not execute successfully (status code exit status: 1).running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/mc16.o" "-c" "src/arm/64/mc16.S"
  cargo:warning=cc: error: unrecognized command-line option '-arch'; did you mean '-march='?


  exit status: 1
  cargo:warning=ToolExecError: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/mc16.o" "-c" "src/arm/64/mc16.S" with args "cc" did not execute successfully (status code exit status: 1).running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/itx.o" "-c" "src/arm/64/itx.S"
  cargo:warning=cc: error: unrecognized command-line option '-arch'; did you mean '-march='?

  running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/itx16.o" "-c" "src/arm/64/itx16.S"

  exit status: 1
  cargo:warning=ToolExecError: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/itx.o" "-c" "src/arm/64/itx.S" with args "cc" did not execute successfully (status code exit status: 1).running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/ipred.o" "-c" "src/arm/64/ipred.S"
  cargo:warning=cc: error: unrecognized command-line option '-arch'; did you mean '-march='?

  cargo:warning=cc: error: unrecognized command-line option '-arch'; did you mean '-march='?


  exit status: 1
  cargo:warning=ToolExecError: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/itx16.o" "-c" "src/arm/64/itx16.S" with args "cc" did not execute successfully (status code exit status: 1).
  exit status: 1
  cargo:warning=ToolExecError: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/ipred.o" "-c" "src/arm/64/ipred.S" with args "cc" did not execute successfully (status code exit status: 1).running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/ipred16.o" "-c" "src/arm/64/ipred16.S"
  running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/sad.o" "-c" "src/arm/64/sad.S"
  cargo:warning=cc: error: unrecognized command-line option '-arch'; did you mean '-march='?

  cargo:warning=cc: error: unrecognized command-line option '-arch'; did you mean '-march='?


  exit status: 1
  cargo:warning=ToolExecError: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/ipred16.o" "-c" "src/arm/64/ipred16.S" with args "cc" did not execute successfully (status code exit status: 1).
  exit status: 1
  cargo:warning=ToolExecError: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/sad.o" "-c" "src/arm/64/sad.S" with args "cc" did not execute successfully (status code exit status: 1).running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/satd.o" "-c" "src/arm/64/satd.S"
  running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/sse.o" "-c" "src/arm/64/sse.S"
  cargo:warning=cc: error: unrecognized command-line option '-arch'; did you mean '-march='?

  cargo:warning=cc: error: unrecognized command-line option '-arch'; did you mean '-march='?


  exit status: 1
  cargo:warning=ToolExecError: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/satd.o" "-c" "src/arm/64/satd.S" with args "cc" did not execute successfully (status code exit status: 1).
  exit status: 1
  cargo:warning=ToolExecError: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/64/sse.o" "-c" "src/arm/64/sse.S" with args "cc" did not execute successfully (status code exit status: 1).running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/tables.o" "-c" "src/arm/tables.S"
  cargo:warning=cc: error: unrecognized command-line option '-arch'; did you mean '-march='?


  exit status: 1
  cargo:warning=ToolExecError: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/tables.o" "-c" "src/arm/tables.S" with args "cc" did not execute successfully (status code exit status: 1).

  --- stderr


  error occurred: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-arch" "arm64" "-I" "." "-I" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out" "-Wall" "-Wextra" "-o" "/root/src/target/aarch64-apple-darwin/release/build/rav1e-e28c8852cf6f3caa/out/src/arm/tables.o" "-c" "src/arm/tables.S" with args "cc" did not execute successfully (status code exit status: 1).


warning: build failed, waiting for other jobs to finish...

At this point, I'm not sure what I can do. The problem still exists, obviously, but all of the possible causes mentioned so far have been dismissed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants