rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
97.62k stars 12.63k forks source link

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', src/tools/miri/src/shims/unix/linux/fd/event.rs:60:80 #111053

Closed OlivierLDff closed 1 year ago

OlivierLDff commented 1 year ago

Code

src/lib.rs:

/// Send a message to the event sender.
/// If the message queue is full, the function will return the message.
/// If the receiver is dropped, the function will return an error.
///
/// # Return
///
/// - [Ok(None)] if the message is sent.
/// - [Ok(Some(T))] if the message queue is full.
/// - [Err(T)] if the receiver is dropped.
pub fn send_non_blocking<T>(
    sender: &tokio::sync::mpsc::Sender<T>,
    message: T,
) -> Result<Option<T>, T> {
    match sender.try_send(message) {
        Ok(()) => Ok(None),
        Err(tokio::sync::mpsc::error::TrySendError::Full(message)) => Ok(Some(message)),
        Err(tokio::sync::mpsc::error::TrySendError::Closed(message)) => Err(message),
    }
}

#[cfg(test)]
mod test_tokio_send {
    use super::*;

    #[tokio::test(flavor = "multi_thread", worker_threads = 2)]
    async fn test_send_non_blocking() {
        let (sender, mut receiver) = tokio::sync::mpsc::channel(1);
        let message = "Hello world";
        const N: usize = 1024;

        tokio::spawn(async move {
            for _ in 0..N {
                let mut temp_message = Some(message);
                loop {
                    tokio::task::yield_now().await;

                    match send_non_blocking(&sender, temp_message.take().unwrap()).unwrap() {
                        None => break,
                        Some(message) => {
                            temp_message = Some(message);
                        }
                    }
                }
            }
        });

        // Check that the receiver received all the messages
        for _ in 0..N {
            assert_eq!(receiver.recv().await.unwrap(), message);
        }

        assert!(receiver.recv().await.is_none(), "sender should drop");
    }
}

Cargo.toml:

[package]
name = "test_tokio_crash"
version = "0.1.0"
edition = "2021"

[dependencies]
tokio = { version = "1.27", features = ["full"] }

Meta

rustc --version --verbose:

rustc 1.71.0-nightly (9ecda8de8 2023-04-30)
binary: rustc
commit-hash: 9ecda8de85ce893cc3fc748ab06be0b8250147a7
commit-date: 2023-04-30
host: x86_64-unknown-linux-gnu
release: 1.71.0-nightly
LLVM version: 16.0.2

Error output

RUSTBACKTRACE=1 cargo miri test
Preparing a sysroot for Miri (target: x86_64-unknown-linux-gnu)... done
WARNING: Ignoring `RUSTC_WRAPPER` environment variable, Miri does not support wrapping.
    Finished test [unoptimized + debuginfo] target(s) in 0.01s
     Running unittests src/lib.rs (target/miri/x86_64-unknown-linux-gnu/debug/deps/test_tokio_crash-e06001c0da78e369)

running 1 test
test test_tokio_send::test_send_non_blocking ... warning: integer-to-pointer cast
   --> /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/parking_lot_core-0.9.7/src/word_lock.rs:320:9
    |
320 |         (self & QUEUE_MASK) as *const ThreadData
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 `<usize as parking_lot_core::word_lock::LockState>::queue_head` at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/parking_lot_core-0.9.7/src/word_lock.rs:320:9: 320:49
    = note: inside `parking_lot_core::word_lock::WordLock::unlock` at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/parking_lot_core-0.9.7/src/word_lock.rs:104:39: 104:57
    = note: inside closure at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/parking_lot_core-0.9.7/src/parking_lot.rs:624:9: 624:30
    = note: inside `parking_lot_core::parking_lot::with_thread_data::<parking_lot_core::parking_lot::ParkResult, [closure@parking_lot_core::parking_lot::park<[closure@parking_lot::condvar::Condvar::wait_until_internal::{closure#0}], [closure@parking_lot::condvar::Condvar::wait_until_internal::{closure#1}], [closure@parking_lot::condvar::Condvar::wait_until_internal::{closure#2}]>::{closure#0}]>` at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/parking_lot_core-0.9.7/src/parking_lot.rs:207:5: 207:36
    = note: inside `parking_lot_core::parking_lot::park::<[closure@parking_lot::condvar::Condvar::wait_until_internal::{closure#0}], [closure@parking_lot::condvar::Condvar::wait_until_internal::{closure#1}], [closure@parking_lot::condvar::Condvar::wait_until_internal::{closure#2}]>` at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/parking_lot_core-0.9.7/src/parking_lot.rs:600:5: 705:7
    = note: inside `parking_lot::condvar::Condvar::wait_until_internal` at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/parking_lot-0.12.1/src/condvar.rs:333:35: 340:18
    = note: inside `parking_lot::condvar::Condvar::wait::<()>` at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/parking_lot-0.12.1/src/condvar.rs:256:9: 256:88
    = note: inside `tokio::loom::std::parking_lot::Condvar::wait::<()>` at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.0/src/loom/std/parking_lot.rs:150:9: 150:34
    = note: inside `tokio::runtime::park::Inner::park` at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.0/src/runtime/park.rs:117:17: 117:37
    = note: inside closure at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.0/src/runtime/park.rs:255:41: 255:65
    = note: inside closure at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.0/src/runtime/park.rs:269:41: 269:49
    = note: inside `std::thread::LocalKey::<tokio::runtime::park::ParkThread>::try_with::<[closure@tokio::runtime::park::CachedParkThread::with_current<[closure@tokio::runtime::park::CachedParkThread::park::{closure#0}], ()>::{closure#0}], ()>` at /home/user/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:270:16: 270:31
    = note: inside `tokio::runtime::park::CachedParkThread::with_current::<[closure@tokio::runtime::park::CachedParkThread::park::{closure#0}], ()>` at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.0/src/runtime/park.rs:269:9: 269:50
    = note: inside `tokio::runtime::park::CachedParkThread::park` at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.0/src/runtime/park.rs:255:9: 255:66
    = note: inside `tokio::runtime::park::CachedParkThread::block_on::<std::pin::Pin<&mut dyn std::future::Future<Output = ()>>>` at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.0/src/runtime/park.rs:292:13: 292:24
    = note: inside `tokio::runtime::context::BlockingRegionGuard::block_on::<std::pin::Pin<&mut dyn std::future::Future<Output = ()>>>` at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.0/src/runtime/context.rs:315:13: 315:29
    = note: inside `tokio::runtime::scheduler::multi_thread::MultiThread::block_on::<std::pin::Pin<&mut dyn std::future::Future<Output = ()>>>` at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.0/src/runtime/scheduler/multi_thread/mod.rs:66:9: 68:30
note: inside `test_tokio_send::test_send_non_blocking`
   --> src/lib.rs:48:9
    |
48  | /         for _ in 0..N {
49  | |             assert_eq!(receiver.recv().await.unwrap(), message);
50  | |         }
51  | |
52  | |         assert!(receiver.recv().await.is_none(), "sender should drop");
    | |_______________________________________________________________________^
note: inside closure
   --> src/lib.rs:26:39
    |
25  |     #[tokio::test(flavor = "multi_thread", worker_threads = 2)]
    |     ----------------------------------------------------------- in this procedural macro expansion
26  |     async fn test_send_non_blocking() {
    |                                       ^
    = note: this warning originates in the attribute macro `::core::prelude::v1::test` which comes from the expansion of the attribute macro `tokio::test` (in Nightly builds, run with -Z macro-backtrace for more info)

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', src/tools/miri/src/shims/unix/linux/fd/event.rs:60:80
stack backtrace:
   0:     0x7f3c5cca7331 - std::backtrace_rs::backtrace::libunwind::trace::hc9361e36aeb59839
                               at /rustc/9ecda8de85ce893cc3fc748ab06be0b8250147a7/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f3c5cca7331 - std::backtrace_rs::backtrace::trace_unsynchronized::h9236c8bfdcb4bd80
                               at /rustc/9ecda8de85ce893cc3fc748ab06be0b8250147a7/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f3c5cca7331 - std::sys_common::backtrace::_print_fmt::h7fcfbb49f6ba2502
                               at /rustc/9ecda8de85ce893cc3fc748ab06be0b8250147a7/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f3c5cca7331 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h79701e9b22410d70
                               at /rustc/9ecda8de85ce893cc3fc748ab06be0b8250147a7/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f3c5cd07f1f - core::fmt::rt::Argument::fmt::hd0e21085a8ceb988
                               at /rustc/9ecda8de85ce893cc3fc748ab06be0b8250147a7/library/core/src/fmt/rt.rs:138:9
   5:     0x7f3c5cd07f1f - core::fmt::write::h4fc8327a2048dd4d
                               at /rustc/9ecda8de85ce893cc3fc748ab06be0b8250147a7/library/core/src/fmt/mod.rs:1094:21
   6:     0x7f3c5cc9a541 - std::io::Write::write_fmt::hc0f49c54197144fb
                               at /rustc/9ecda8de85ce893cc3fc748ab06be0b8250147a7/library/std/src/io/mod.rs:1712:15
   7:     0x7f3c5cca7145 - std::sys_common::backtrace::_print::h9e223a02ac862cb5
                               at /rustc/9ecda8de85ce893cc3fc748ab06be0b8250147a7/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f3c5cca7145 - std::sys_common::backtrace::print::h8094443d63ecfb4c
                               at /rustc/9ecda8de85ce893cc3fc748ab06be0b8250147a7/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f3c5cca9c87 - std::panicking::default_hook::{{closure}}::hbf12cbeeb299f3f1
  10:     0x7f3c5cca9a74 - std::panicking::default_hook::h79422e3bc5c0d82d
                               at /rustc/9ecda8de85ce893cc3fc748ab06be0b8250147a7/library/std/src/panicking.rs:288:9
  11:     0x7f3c5fed2cf5 - rustc_driver_impl[d04a82bf5e705304]::DEFAULT_HOOK::{closure#0}::{closure#0}
  12:     0x7f3c5ccaa3a7 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hfeb88eb8dfd6ec3a
                               at /rustc/9ecda8de85ce893cc3fc748ab06be0b8250147a7/library/alloc/src/boxed.rs:1999:9
  13:     0x7f3c5ccaa3a7 - std::panicking::rust_panic_with_hook::hecec3b7c59290886
                               at /rustc/9ecda8de85ce893cc3fc748ab06be0b8250147a7/library/std/src/panicking.rs:695:13
  14:     0x7f3c5ccaa0e1 - std::panicking::begin_panic_handler::{{closure}}::h87e403c8e6c6e41e
                               at /rustc/9ecda8de85ce893cc3fc748ab06be0b8250147a7/library/std/src/panicking.rs:580:13
  15:     0x7f3c5cca7776 - std::sys_common::backtrace::__rust_end_short_backtrace::hbdd5d6ae6c35db8a
                               at /rustc/9ecda8de85ce893cc3fc748ab06be0b8250147a7/library/std/src/sys_common/backtrace.rs:150:18
  16:     0x7f3c5cca9e92 - rust_begin_unwind
                               at /rustc/9ecda8de85ce893cc3fc748ab06be0b8250147a7/library/std/src/panicking.rs:578:5
  17:     0x7f3c5cd041c3 - core::panicking::panic_fmt::h0fbc2a051543a5d5
                               at /rustc/9ecda8de85ce893cc3fc748ab06be0b8250147a7/library/core/src/panicking.rs:67:14
  18:     0x7f3c5cd04253 - core::panicking::panic::h5f7706d0d92180ba
                               at /rustc/9ecda8de85ce893cc3fc748ab06be0b8250147a7/library/core/src/panicking.rs:117:5
  19:     0x5645b4baa047 - <miri[d44f8c3f6374d72b]::shims::unix::linux::fd::event::Event as miri[d44f8c3f6374d72b]::shims::unix::fs::FileDescriptor>::write
  20:     0x5645b4b40957 - <rustc_const_eval[592ed5a20e2e9142]::interpret::eval_context::InterpCx<miri[d44f8c3f6374d72b]::machine::MiriMachine> as miri[d44f8c3f6374d72b]::shims::unix::fs::EvalContextExt>::write
  21:     0x5645b4b36cc4 - <rustc_const_eval[592ed5a20e2e9142]::interpret::eval_context::InterpCx<miri[d44f8c3f6374d72b]::machine::MiriMachine> as miri[d44f8c3f6374d72b]::shims::unix::foreign_items::EvalContextExt>::emulate_foreign_item_by_name
  22:     0x5645b4b1b652 - <rustc_const_eval[592ed5a20e2e9142]::interpret::eval_context::InterpCx<miri[d44f8c3f6374d72b]::machine::MiriMachine> as miri[d44f8c3f6374d72b]::shims::foreign_items::EvalContextExt>::emulate_foreign_item_by_name
  23:     0x5645b4ad2cb4 - <rustc_const_eval[592ed5a20e2e9142]::interpret::eval_context::InterpCx<miri[d44f8c3f6374d72b]::machine::MiriMachine>>::eval_fn_call
  24:     0x5645b4b0999c - <rustc_const_eval[592ed5a20e2e9142]::interpret::eval_context::InterpCx<miri[d44f8c3f6374d72b]::machine::MiriMachine> as miri[d44f8c3f6374d72b]::concurrency::thread::EvalContextExt>::run_threads
  25:     0x5645b4b8a856 - miri[d44f8c3f6374d72b]::eval::eval_entry
  26:     0x5645b49de178 - <rustc_middle[e1cd9dc0ac0f7dd2]::ty::context::GlobalCtxt>::enter::<<miri[759e90251b6d149]::MiriCompilerCalls as rustc_driver_impl[d04a82bf5e705304]::Callbacks>::after_analysis::{closure#0}, ()>
  27:     0x5645b49e4fa9 - <miri[759e90251b6d149]::MiriCompilerCalls as rustc_driver_impl[d04a82bf5e705304]::Callbacks>::after_analysis
  28:     0x7f3c5f15e52c - <rustc_interface[6098359c075b63e5]::interface::Compiler>::enter::<rustc_driver_impl[d04a82bf5e705304]::run_compiler::{closure#1}::{closure#2}, core[b1830eda9a6e2491]::result::Result<core[b1830eda9a6e2491]::option::Option<rustc_interface[6098359c075b63e5]::queries::Linker>, rustc_span[15a1debf587e480e]::ErrorGuaranteed>>
  29:     0x7f3c5f154e4f - std[468ab6db55de55b5]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[6098359c075b63e5]::util::run_in_thread_pool_with_globals<rustc_interface[6098359c075b63e5]::interface::run_compiler<core[b1830eda9a6e2491]::result::Result<(), rustc_span[15a1debf587e480e]::ErrorGuaranteed>, rustc_driver_impl[d04a82bf5e705304]::run_compiler::{closure#1}>::{closure#0}, core[b1830eda9a6e2491]::result::Result<(), rustc_span[15a1debf587e480e]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[b1830eda9a6e2491]::result::Result<(), rustc_span[15a1debf587e480e]::ErrorGuaranteed>>
  30:     0x7f3c5f1545f5 - <<std[468ab6db55de55b5]::thread::Builder>::spawn_unchecked_<rustc_interface[6098359c075b63e5]::util::run_in_thread_pool_with_globals<rustc_interface[6098359c075b63e5]::interface::run_compiler<core[b1830eda9a6e2491]::result::Result<(), rustc_span[15a1debf587e480e]::ErrorGuaranteed>, rustc_driver_impl[d04a82bf5e705304]::run_compiler::{closure#1}>::{closure#0}, core[b1830eda9a6e2491]::result::Result<(), rustc_span[15a1debf587e480e]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[b1830eda9a6e2491]::result::Result<(), rustc_span[15a1debf587e480e]::ErrorGuaranteed>>::{closure#1} as core[b1830eda9a6e2491]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  31:     0x7f3c5ccb48c5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hed918a1540dc7a50
                               at /rustc/9ecda8de85ce893cc3fc748ab06be0b8250147a7/library/alloc/src/boxed.rs:1985:9
  32:     0x7f3c5ccb48c5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h606682b9bd0e55ac
                               at /rustc/9ecda8de85ce893cc3fc748ab06be0b8250147a7/library/alloc/src/boxed.rs:1985:9
  33:     0x7f3c5ccb48c5 - std::sys::unix::thread::Thread::new::thread_start::h0bbd7726c94faa71
                               at /rustc/9ecda8de85ce893cc3fc748ab06be0b8250147a7/library/std/src/sys/unix/thread.rs:108:17
  34:     0x7f3c5cb57609 - start_thread
                               at /build/glibc-SzIz7B/glibc-2.31/nptl/pthread_create.c:477:8
  35:     0x7f3c5c92b133 - clone
                               at /build/glibc-SzIz7B/glibc-2.31/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95
  36:                0x0 - <unknown>

error: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.71.0-nightly (9ecda8de8 2023-04-30) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack

Miri caused an ICE during evaluation. Here's the interpreter backtrace at the time of the panic:
note: the place in the program where the ICE was triggered
   --> /home/user/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/unix/fd.rs:247:13
    |
247 | /             libc::write(
248 | |                 self.as_raw_fd(),
249 | |                 buf.as_ptr() as *const libc::c_void,
250 | |                 cmp::min(buf.len(), READ_LIMIT),
251 | |             )
    | |_____________^
    |
    = note: inside `std::sys::unix::fd::FileDesc::write` at /home/user/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/unix/fd.rs:247:13: 251:14
    = note: inside `std::sys::unix::fs::File::write` at /home/user/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/unix/fs.rs:1141:9: 1141:26
    = note: inside `<&std::fs::File as std::io::Write>::write` at /home/user/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/fs.rs:837:9: 837:30
    = note: inside `mio::sys::unix::waker::eventfd::Waker::wake` at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-0.8.6/src/sys/unix/waker.rs:32:19: 32:41
    = note: inside `mio::waker::Waker::wake` at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-0.8.6/src/waker.rs:94:9: 94:26
    = note: inside `tokio::runtime::io::Handle::unpark` at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.0/src/runtime/io/mod.rs:243:9: 243:26
    = note: inside `tokio::runtime::driver::IoHandle::unpark` at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.0/src/runtime/driver.rs:182:46: 182:61
    = note: inside `tokio::runtime::driver::Handle::unpark` at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.0/src/runtime/driver.rs:81:9: 81:25
    = note: inside `tokio::runtime::scheduler::multi_thread::park::Inner::unpark` at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.0/src/runtime/scheduler/multi_thread/park.rs:208:30: 208:45
    = note: inside `tokio::runtime::scheduler::multi_thread::park::Unparker::unpark` at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.0/src/runtime/scheduler/multi_thread/park.rs:100:9: 100:34
    = note: inside `tokio::runtime::scheduler::multi_thread::worker::<impl tokio::runtime::scheduler::multi_thread::handle::Handle>::notify_parked` at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.0/src/runtime/scheduler/multi_thread/worker.rs:821:13: 821:67
    = note: inside `tokio::runtime::scheduler::multi_thread::worker::<impl tokio::runtime::scheduler::multi_thread::handle::Handle>::transition_worker_from_searching` at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.0/src/runtime/scheduler/multi_thread/worker.rs:848:13: 848:33
    = note: inside `tokio::runtime::scheduler::multi_thread::worker::Core::transition_from_searching` at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.0/src/runtime/scheduler/multi_thread/worker.rs:649:9: 649:57
    = note: inside `tokio::runtime::scheduler::multi_thread::worker::Context::run_task` at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.0/src/runtime/scheduler/multi_thread/worker.rs:456:9: 456:53
    = note: inside `tokio::runtime::scheduler::multi_thread::worker::Context::run` at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.0/src/runtime/scheduler/multi_thread/worker.rs:426:24: 426:49
    = note: inside closure at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.0/src/runtime/scheduler/multi_thread/worker.rs:406:17: 406:29
    = note: inside `tokio::macros::scoped_tls::ScopedKey::<tokio::runtime::scheduler::multi_thread::worker::Context>::set::<[closure@tokio::runtime::scheduler::multi_thread::worker::run::{closure#0}], ()>` at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.0/src/macros/scoped_tls.rs:61:9: 61:12
    = note: inside `tokio::runtime::scheduler::multi_thread::worker::run` at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.0/src/runtime/scheduler/multi_thread/worker.rs:403:5: 412:7
    = note: inside closure at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.0/src/runtime/scheduler/multi_thread/worker.rs:365:45: 365:56
    = note: inside `<tokio::runtime::blocking::task::BlockingTask<[closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}]> as std::future::Future>::poll` at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.0/src/runtime/blocking/task.rs:42:21: 42:27
    = note: inside closure at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.0/src/runtime/task/core.rs:223:17: 223:37
    = note: inside `tokio::loom::std::unsafe_cell::UnsafeCell::<tokio::runtime::task::core::Stage<tokio::runtime::blocking::task::BlockingTask<[closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}]>>>::with_mut::<std::task::Poll<()>, [closure@tokio::runtime::task::core::Core<tokio::runtime::blocking::task::BlockingTask<[closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}]>, tokio::runtime::blocking::schedule::BlockingSchedule>::poll::{closure#0}]>` at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.0/src/loom/std/unsafe_cell.rs:14:9: 14:24
    = note: inside `tokio::runtime::task::core::Core::<tokio::runtime::blocking::task::BlockingTask<[closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}]>, tokio::runtime::blocking::schedule::BlockingSchedule>::poll` at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.0/src/runtime/task/core.rs:212:13: 224:15
    = note: inside closure at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.0/src/runtime/task/harness.rs:476:19: 476:38
    = note: inside `<std::panic::AssertUnwindSafe<[closure@tokio::runtime::task::harness::poll_future<tokio::runtime::blocking::task::BlockingTask<[closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}]>, tokio::runtime::blocking::schedule::BlockingSchedule>::{closure#0}]> as std::ops::FnOnce<()>>::call_once` at /home/user/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/panic/unwind_safe.rs:271:9: 271:19
    = note: inside `std::panicking::r#try::do_call::<std::panic::AssertUnwindSafe<[closure@tokio::runtime::task::harness::poll_future<tokio::runtime::blocking::task::BlockingTask<[closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}]>, tokio::runtime::blocking::schedule::BlockingSchedule>::{closure#0}]>, std::task::Poll<()>>` at /home/user/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:485:40: 485:43
    = note: inside `std::panicking::r#try::<std::task::Poll<()>, std::panic::AssertUnwindSafe<[closure@tokio::runtime::task::harness::poll_future<tokio::runtime::blocking::task::BlockingTask<[closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}]>, tokio::runtime::blocking::schedule::BlockingSchedule>::{closure#0}]>>` at /home/user/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:449:19: 449:81
    = note: inside `std::panic::catch_unwind::<std::panic::AssertUnwindSafe<[closure@tokio::runtime::task::harness::poll_future<tokio::runtime::blocking::task::BlockingTask<[closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}]>, tokio::runtime::blocking::schedule::BlockingSchedule>::{closure#0}]>, std::task::Poll<()>>` at /home/user/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panic.rs:140:14: 140:33
    = note: inside `tokio::runtime::task::harness::poll_future::<tokio::runtime::blocking::task::BlockingTask<[closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}]>, tokio::runtime::blocking::schedule::BlockingSchedule>` at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.0/src/runtime/task/harness.rs:464:18: 479:8
    = note: inside `tokio::runtime::task::harness::Harness::<tokio::runtime::blocking::task::BlockingTask<[closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}]>, tokio::runtime::blocking::schedule::BlockingSchedule>::poll_inner` at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.0/src/runtime/task/harness.rs:198:27: 198:55
    = note: inside `tokio::runtime::task::harness::Harness::<tokio::runtime::blocking::task::BlockingTask<[closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}]>, tokio::runtime::blocking::schedule::BlockingSchedule>::poll` at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.0/src/runtime/task/harness.rs:152:15: 152:32
    = note: inside `tokio::runtime::task::raw::poll::<tokio::runtime::blocking::task::BlockingTask<[closure@tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{closure#0}]>, tokio::runtime::blocking::schedule::BlockingSchedule>` at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.0/src/runtime/task/raw.rs:255:5: 255:19
    = note: inside `tokio::runtime::task::raw::RawTask::poll` at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.0/src/runtime/task/raw.rs:200:18: 200:41
    = note: inside `tokio::runtime::task::UnownedTask::<tokio::runtime::blocking::schedule::BlockingSchedule>::run` at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.0/src/runtime/task/mod.rs:431:9: 431:19
    = note: inside `tokio::runtime::blocking::pool::Task::run` at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.0/src/runtime/blocking/pool.rs:159:9: 159:24
    = note: inside `tokio::runtime::blocking::pool::Inner::run` at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.0/src/runtime/blocking/pool.rs:513:17: 513:27
    = note: inside closure at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.0/src/runtime/blocking/pool.rs:471:13: 471:54
    = note: inside `std::sys_common::backtrace::__rust_begin_short_backtrace::<[closure@tokio::runtime::blocking::pool::Spawner::spawn_thread::{closure#0}], ()>` at /home/user/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:134:18: 134:21
    = note: inside closure at /home/user/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/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@tokio::runtime::blocking::pool::Spawner::spawn_thread::{closure#0}], ()>::{closure#1}::{closure#0}]> as std::ops::FnOnce<()>>::call_once` at /home/user/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/panic/unwind_safe.rs:271:9: 271:19
    = note: inside `std::panicking::r#try::do_call::<std::panic::AssertUnwindSafe<[closure@std::thread::Builder::spawn_unchecked_<'_, '_, [closure@tokio::runtime::blocking::pool::Spawner::spawn_thread::{closure#0}], ()>::{closure#1}::{closure#0}]>, ()>` at /home/user/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:485:40: 485:43
    = note: inside `std::panicking::r#try::<(), std::panic::AssertUnwindSafe<[closure@std::thread::Builder::spawn_unchecked_<'_, '_, [closure@tokio::runtime::blocking::pool::Spawner::spawn_thread::{closure#0}], ()>::{closure#1}::{closure#0}]>>` at /home/user/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:449:19: 449:81
    = note: inside `std::panic::catch_unwind::<std::panic::AssertUnwindSafe<[closure@std::thread::Builder::spawn_unchecked_<'_, '_, [closure@tokio::runtime::blocking::pool::Spawner::spawn_thread::{closure#0}], ()>::{closure#1}::{closure#0}]>, ()>` at /home/user/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panic.rs:140:14: 140:33
    = note: inside closure at /home/user/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/mod.rs:528:30: 530:16
    = note: inside `<[closure@std::thread::Builder::spawn_unchecked_<'_, '_, [closure@tokio::runtime::blocking::pool::Spawner::spawn_thread::{closure#0}], ()>::{closure#1}] as std::ops::FnOnce<()>>::call_once - shim(vtable)` at /home/user/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/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 /home/user/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/boxed.rs:1985:9: 1985:52
    = note: inside `<std::boxed::Box<std::boxed::Box<dyn std::ops::FnOnce()>> as std::ops::FnOnce<()>>::call_once` at /home/user/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/boxed.rs:1985:9: 1985:52
    = note: inside `std::sys::unix::thread::Thread::new::thread_start` at /home/user/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/unix/thread.rs:108:17: 108:64

warning: 1 warning emitted

error: test failed, to rerun pass `--lib`
Backtrace

``` ```

clubby789 commented 1 year ago

This seems like a Miri-specific issue, so should probably be filed to that repo: https://github.com/rust-lang/miri/

jyn514 commented 1 year ago

Going to close this since the upstream issue was also closed.