tokio-rs / tokio

A runtime for writing reliable asynchronous applications with Rust. Provides I/O, networking, scheduling, timers, ...
https://tokio.rs
MIT License
25.45k stars 2.31k forks source link

Panic at linked_list.rs - reborn #6597

Open chroche opened 1 month ago

chroche commented 1 month ago

Version

> cargo tree | grep tokio

│   │   │   └── tokio v1.37.0
│   │   │       └── tokio-macros v2.2.0 (proc-macro)
│   │   │   │   ├── tokio v1.37.0 (*)
│   │   │   │   └── tokio-util v0.7.11
│   │   │   │       └── tokio v1.37.0 (*)
│   │   │   ├── tokio v1.37.0 (*)
│   │   │   │   ├── tokio v1.37.0 (*)
│   │   │   │   ├── tokio-util v0.7.11 (*)
│   │   │   │   ├── tokio v1.37.0 (*)
│   │   │   │   ├── tokio v1.37.0 (*)
│   │   │   │   └── tokio-rustls v0.24.1
│   │   │   │       └── tokio v1.37.0 (*)
│   │   │   ├── tokio v1.37.0 (*)
│   ├── tokio v1.37.0 (*)
│   │   │   ├── tokio v1.37.0 (*)
│   │   │   └── tokio-io-timeout v1.2.0
│   │   │       └── tokio v1.37.0 (*)
│   │   ├── tokio v1.37.0 (*)
│   │   ├── tokio-util v0.7.11 (*)
│   │   │   ├── tokio v1.37.0 (*)
│   │   │   ├── tokio-util v0.7.11 (*)
│       ├── tokio v1.37.0 (*)
│       ├── tokio-util v0.7.11 (*)
└── tokio v1.37.0 (*)
│   ├── tokio v1.37.0 (*)
│   ├── tokio-test v0.4.4
│   │   ├── tokio v1.37.0 (*)
│   │   └── tokio-stream v0.1.15
│   │       └── tokio v1.37.0 (*)

Platform

> uname -a

Darwin ELSLAPM-156935 21.6.0 Darwin Kernel Version 21.6.0: Wed Apr 24 06:02:02 PDT 2024; root:xnu-8020.240.18.708.4~1/RELEASE_X86_64 x86_64

Description I seem to be able to reproduce the bug mentioned in https://github.com/tokio-rs/tokio/issues/5782.

Error message:

thread 'main' panicked at .cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/util/linked_list.rs:130:9:
assertion `left != right` failed
  left: Some(0x7f8c1c826e18)
 right: Some(0x7f8c1c826e18)

The stacktrace looks like this:

   0:        0x1065dbdc5 - std::backtrace_rs::backtrace::libunwind::trace::he87ba3c236c7ad5f
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:        0x1065dbdc5 - std::backtrace_rs::backtrace::trace_unsynchronized::h3ad5d899409e49ee
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:        0x1065dbdc5 - std::sys_common::backtrace::_print_fmt::hb1551f966d2dd86d
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:68:5
   3:        0x1065dbdc5 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hbd71adb7a72f4105
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:44:22
   4:        0x1066030c3 - core::fmt::rt::Argument::fmt::h4224d647cce844bf
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/fmt/rt.rs:142:9
   5:        0x1066030c3 - core::fmt::write::h30346430340bc336
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/fmt/mod.rs:1120:17
   6:        0x1065d843e - std::io::Write::write_fmt::heb3d6316c565d5b1
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/io/mod.rs:1810:15
   7:        0x1065dbb99 - std::sys_common::backtrace::_print::hc99e5bf521524ac2
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:47:5
   8:        0x1065dbb99 - std::sys_common::backtrace::print::h67e51ff2e3d5cfbd
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:34:9
   9:        0x1065dde85 - std::panicking::default_hook::{{closure}}::hc666c9a55318d1f1
  10:        0x1065ddbfe - std::panicking::default_hook::hf980b1da49948523
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:292:9
  11:        0x104fd6f64 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hf7f87bd7c35a4244
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/alloc/src/boxed.rs:2029:9
  12:        0x104fd83be - coredump::register_panic_handler::{{closure}}::h2a03491260ffa180
                               at .cargo/registry/src/index.crates.io-6f17d22bba15001f/coredump-0.1.2/src/lib.rs:215:5
  13:        0x1065de485 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h3a63db2ca77cedb5
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/alloc/src/boxed.rs:2029:9
  14:        0x1065de485 - std::panicking::rust_panic_with_hook::h683bce980186bbbe
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:783:13
  15:        0x1065de214 - std::panicking::begin_panic_handler::{{closure}}::ha6dbd11ba0ec8af1
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:657:13
  16:        0x1065dc2b9 - std::sys_common::backtrace::__rust_end_short_backtrace::h889430bddc786c98
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:171:18
  17:        0x1065ddf52 - rust_begin_unwind
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:645:5
  18:        0x10663bcb5 - core::panicking::panic_fmt::hff768cef35397791
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:72:14
  19:        0x10663c16d - core::panicking::assert_failed_inner::hc41779d852e64862
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:342:17
  20:        0x106635109 - core::panicking::assert_failed::h08df68286150560b
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:297:5
  21:        0x106402f7c - tokio::util::linked_list::LinkedList<L,<L as tokio::util::linked_list::Link>::Target>::push_front::h6e00c199c3bb503f
                               at .cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/util/linked_list.rs:130:9
  22:        0x10640e84d - tokio::runtime::time::wheel::level::Level::add_entry::h4a24c2925dc882a2
                               at .cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/runtime/time/wheel/level.rs:207:9
  23:        0x10640ecde - tokio::runtime::time::wheel::Wheel::insert::h016cc9f1112e2ab3
                               at .cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/runtime/time/wheel/mod.rs:105:13
  24:        0x106410109 - tokio::runtime::time::<impl tokio::runtime::time::handle::Handle>::reregister::h2393815bbe43b29e
                               at .cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/runtime/time/mod.rs:361:32
  25:        0x10640c9ee - tokio::runtime::time::entry::TimerEntry::reset::h2f570947accf58f9
                               at .cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/runtime/time/entry.rs:546:17
  26:        0x10640ca91 - tokio::runtime::time::entry::TimerEntry::poll_elapsed::had2ed4c224869068
                               at .cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/runtime/time/entry.rs:564:13
  27:        0x10644b6cb - tokio::time::sleep::Sleep::poll_elapsed::h40485d45d511410e
                               at .cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/time/sleep.rs:416:22
  28:        0x10644b7fc - <tokio::time::sleep::Sleep as core::future::future::Future>::poll::hd8bf0c190314fba3
                               at .cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/time/sleep.rs:448:22
  29:        0x104f1cadf - asg_updater::asg::asg_update::{{closure}}::h0e4e0fa7473f8458
                               at Git/WA/usage-util-asg-updater/rust/src/asg.rs:113:50
  30:        0x104e1336a - <mapped_futures::mapped_futures::MappedFutures<K,Fut,S> as futures_core::stream::Stream>::poll_next::h4e7dd6b901e6cf01
                               at .cargo/registry/src/index.crates.io-6f17d22bba15001f/mapped_futures-0.1.8/src/mapped_futures/mod.rs:745:17
  31:        0x104e13768 - futures_util::stream::stream::StreamExt::poll_next_unpin::h7d00d209d833f794
                               at .cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-util-0.3.30/src/stream/stream/mod.rs:1638:9
  32:        0x104f44d45 - <futures_util::stream::stream::next::Next<St> as core::future::future::Future>::poll::h38fd832dc98790a7
                               at .cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-util-0.3.30/src/stream/stream/next.rs:32:9
  33:        0x104dfb1ef - asg_updater::event::event_loop::{{closure}}::h19cf56f993579078
                               at Git/WA/usage-util-asg-updater/rust/src/event.rs:81:57
  34:        0x104fba400 - asg_updater::main::{{closure}}::h241100e0c7f77930
                               at Git/WA/usage-util-asg-updater/rust/src/main.rs:23:23
  35:        0x104efc8b2 - <core::pin::Pin<P> as core::future::future::Future>::poll::h40dba7c6b2c5f007
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/future/future.rs:124:9
  36:        0x104dc33be - tokio::runtime::scheduler::current_thread::CoreGuard::block_on::{{closure}}::{{closure}}::{{closure}}::haea4c2e392ff9436
                               at .cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/runtime/scheduler/current_thread/mod.rs:659:57
  37:        0x104dc32f4 - tokio::runtime::coop::with_budget::h3dffaa22fc1b4bac
                               at .cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/runtime/coop.rs:107:5
  38:        0x104dc32f4 - tokio::runtime::coop::budget::hfb9144f3c8e009ed
                               at .cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/runtime/coop.rs:73:5
  39:        0x104dc32f4 - tokio::runtime::scheduler::current_thread::CoreGuard::block_on::{{closure}}::{{closure}}::h1d4031b3d7e1e813
                               at .cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/runtime/scheduler/current_thread/mod.rs:659:25
  40:        0x104dc1f9e - tokio::runtime::scheduler::current_thread::Context::enter::hd3db13962e94ce0f
                               at .cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/runtime/scheduler/current_thread/mod.rs:404:19
  41:        0x104dc2bbc - tokio::runtime::scheduler::current_thread::CoreGuard::block_on::{{closure}}::h57d7b2bbb78cd438
                               at .cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/runtime/scheduler/current_thread/mod.rs:658:36
  42:        0x104dc2952 - tokio::runtime::scheduler::current_thread::CoreGuard::enter::{{closure}}::h978624809f9f6e18
                               at .cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/runtime/scheduler/current_thread/mod.rs:737:68
  43:        0x104fa5b77 - tokio::runtime::context::scoped::Scoped<T>::set::h5c46c687375402be
                               at .cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/runtime/context/scoped.rs:40:9
  44:        0x104f45416 - tokio::runtime::context::set_scheduler::{{closure}}::hc31497bc0ef498e9
                               at .cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/runtime/context.rs:176:26
  45:        0x104f93d0f - std::thread::local::LocalKey<T>::try_with::hab21e96ac6a41cbf
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/thread/local.rs:270:16
  46:        0x104f934dd - std::thread::local::LocalKey<T>::with::h96b9728a141b1ae5
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/thread/local.rs:246:9
  47:        0x104f453be - tokio::runtime::context::set_scheduler::h68b9f9d631b9b79d
                               at .cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/runtime/context.rs:176:9
  48:        0x104dc273d - tokio::runtime::scheduler::current_thread::CoreGuard::enter::hdad653fdf22c2bda
                               at .cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/runtime/scheduler/current_thread/mod.rs:737:27
  49:        0x104dc298a - tokio::runtime::scheduler::current_thread::CoreGuard::block_on::h4b2b31626abee458
                               at .cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/runtime/scheduler/current_thread/mod.rs:646:19
  50:        0x104dc1a62 - tokio::runtime::scheduler::current_thread::CurrentThread::block_on::{{closure}}::h597e1d9ab7f9b01a
                               at .cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/runtime/scheduler/current_thread/mod.rs:175:28
  51:        0x104f80873 - tokio::runtime::context::runtime::enter_runtime::h054a53a5a9f43219
                               at .cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/runtime/context/runtime.rs:65:16
  52:        0x104dc196f - tokio::runtime::scheduler::current_thread::CurrentThread::block_on::h828c6ef19337548c
                               at .cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/runtime/scheduler/current_thread/mod.rs:167:9
  53:        0x104f32cd0 - tokio::runtime::runtime::Runtime::block_on::h753f6fc9575d3029
                               at .cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.37.0/src/runtime/runtime.rs:349:47
  54:        0x104f9d4ed - asg_updater::main::heee9492b3ea0b59f
                               at Git/WA/usage-util-asg-updater/rust/src/main.rs:24:3
  55:        0x104e250be - core::ops::function::FnOnce::call_once::h466dcf36d152af53
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:250:5
  56:        0x104f30491 - std::sys_common::backtrace::__rust_begin_short_backtrace::hcb35513a23b57bed
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:155:18
  57:        0x104f278a4 - std::rt::lang_start::{{closure}}::h07f7c173ba9bac23
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/rt.rs:166:18
  58:        0x1065d16e0 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h28f55c80744bada5
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:284:13
  59:        0x1065d16e0 - std::panicking::try::do_call::h2a7711271ca00d3c
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:552:40
  60:        0x1065d16e0 - std::panicking::try::h8cfa57ed24255592
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:516:19
  61:        0x1065d16e0 - std::panic::catch_unwind::h4ba1cfc637be3672
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panic.rs:142:14
  62:        0x1065d16e0 - std::rt::lang_start_internal::{{closure}}::he9dd7d8444a0863e
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/rt.rs:148:48
  63:        0x1065d16e0 - std::panicking::try::do_call::h4f92b6155a985b32
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:552:40
  64:        0x1065d16e0 - std::panicking::try::h1810f6567656aa0f
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:516:19
  65:        0x1065d16e0 - std::panic::catch_unwind::h979a0e4ea0734504
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panic.rs:142:14
  66:        0x1065d16e0 - std::rt::lang_start_internal::hba631f1493ca29ca
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/rt.rs:148:20
  67:        0x104f27877 - std::rt::lang_start::h31c7b657328973db
                               at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/rt.rs:165:17
  68:        0x104f9d5a8 - _main

I can provide privately if helpful the binary that produced the crash, the associated core dump and the session logs. Works on my MacOS Monterey 12.7.5 with

> lldb -f bin.76013 -c core.76013

(lldb) target create "bin.76013" --core "core.76013"
Core file 'core.76013' (x86_64) was loaded.
(lldb) bt
* thread #1
  * frame #0: 0x00007ff81f5d7b5e libsystem_kernel.dylib`__kill + 10
...
Darksonn commented 1 month ago

What dependencies are you using?

chroche commented 1 month ago

Hi,

attached the full Cargo tree.

Darksonn commented 1 month ago

Sorry I don't think there's enough information here for us to do anything.

chroche commented 1 month ago

What else do you think could help? Would having the core dump do?

Darksonn commented 1 month ago

Sorry, I have no idea what to look for in a core dump.

name1e5s commented 2 weeks ago

This panic may hit #6612

chroche commented 2 weeks ago

For what it's worth, this is what I'm able to extract from the core file:

> lldb -f bin.76013 -c /cores/core.76013

(lldb) f 12
frame #12: 0x0000000106402f7c bin.76013`tokio::util::linked_list::LinkedList$LT$L$C$$LT$L$u20$as$u20$tokio..util..linked_list..Link$GT$..Target$GT$::push_front::h6e00c199c3bb503f(self=0x00007f8c19813410, val=TimerHandle @ 0x00007ff7bb0e94c0) at linked_list.rs:130:9
   127          // The value should not be dropped, it is being inserted into the list
   128          let val = ManuallyDrop::new(val);
   129          let ptr = L::as_raw(&val);
-> 130          assert_ne!(self.head, Some(ptr));
   131          unsafe {
   132              L::pointers(ptr).as_mut().set_next(self.head);
   133              L::pointers(ptr).as_mut().set_prev(None);
(lldb) f 13
frame #13: 0x000000010640e84d bin.76013`tokio::runtime::time::wheel::level::Level::add_entry::h4a24c2925dc882a2(self=0x00007f8c19813220, item=TimerHandle @ 0x00007ff7bb0e9558) at level.rs:207:9
   204      pub(crate) unsafe fn add_entry(&mut self, item: TimerHandle) {
   205          let slot = slot_for(item.cached_when(), self.level);
   206
-> 207          self.slot[slot].push_front(item);
   208
   209          self.occupied |= occupied_bit(slot);
   210      }
(lldb) f 14
frame #14: 0x000000010640ecde bin.76013`tokio::runtime::time::wheel::Wheel::insert::h016cc9f1112e2ab3(self=0x00007f8c19707c30, item=TimerHandle @ 0x00007ff7bb0e95b0) at mod.rs:105:13
   102          let level = self.level_for(when);
   103
   104          unsafe {
-> 105              self.levels[level].add_entry(item);
   106          }
   107
   108          debug_assert!({
(lldb) f 15
frame #15: 0x0000000106410109 bin.76013`tokio::runtime::time::_$LT$impl$u20$tokio..runtime..time..handle..Handle$GT$::reregister::h2393815bbe43b29e(self=0x00007f8c19707c28, unpark=0x00007f8c19707bb0, new_tick=130047, entry=NonNull<tokio::runtime::time::entry::TimerShared> @ 0x00007ff7bb0e9698) at mod.rs:361:32
   358                  // Note: We don't have to worry about racing with some other resetting
   359                  // thread, because add_entry and reregister require exclusive control of
   360                  // the timer entry.
-> 361                  match unsafe { lock.wheel.insert(entry) } {
   362                      Ok(when) => {
   363                          if lock
   364                              .next_wake
(lldb) f 16
frame #16: 0x000000010640c9ee bin.76013`tokio::runtime::time::entry::TimerEntry::reset::h2f570947accf58f9(self=Pin<&mut tokio::runtime::time::entry::TimerEntry> @ 0x00007ff7bb0e97a0, new_time=Instant @ 0x00007ff7bb0e97b0, reregister=true) at entry.rs:546:17
   543
   544          if reregister {
   545              unsafe {
-> 546                  self.driver()
   547                      .reregister(&self.driver.driver().io, tick, self.inner().into());
   548              }
   549          }
(lldb) f 17
frame #17: 0x000000010640ca91 bin.76013`tokio::runtime::time::entry::TimerEntry::poll_elapsed::had2ed4c224869068(self=Pin<&mut tokio::runtime::time::entry::TimerEntry> @ 0x00007ff7bb0e9848, cx=0x00007ff7bb1274b0) at entry.rs:564:13
   561
   562          if !self.registered {
   563              let deadline = self.deadline;
-> 564              self.as_mut().reset(deadline, true);
   565          }
   566
   567          let this = unsafe { self.get_unchecked_mut() };
(lldb) f 18
frame #18: 0x000000010644b6cb bin.76013`tokio::time::sleep::Sleep::poll_elapsed::h40485d45d511410e(self=Pin<&mut tokio::time::sleep::Sleep> @ 0x00007ff7bb0e98c8, cx=0x00007ff7bb1274b0) at sleep.rs:416:22
   413          #[cfg(any(not(tokio_unstable), not(feature = "tracing")))]
   414          let coop = ready!(crate::runtime::coop::poll_proceed(cx));
   415
-> 416          let result = me.entry.poll_elapsed(cx).map(move |r| {
   417              coop.made_progress();
   418              r
   419          });
(lldb) f 19
frame #19: 0x000000010644b7fc bin.76013`_$LT$tokio..time..sleep..Sleep$u20$as$u20$core..future..future..Future$GT$::poll::hd8bf0c190314fba3(self=Pin<&mut tokio::time::sleep::Sleep> @ 0x00007ff7bb0e9930, cx=0x00007ff7bb1274b0) at sleep.rs:448:22
   445          let _ao_span = self.inner.ctx.async_op_span.clone().entered();
   446          #[cfg(all(tokio_unstable, feature = "tracing"))]
   447          let _ao_poll_span = self.inner.ctx.async_op_poll_span.clone().entered();
-> 448          match ready!(self.as_mut().poll_elapsed(cx)) {
   449              Ok(()) => Poll::Ready(()),
   450              Err(e) => panic!("timer error: {}", e),
   451          }
(lldb) f 20
frame #20: 0x0000000104f1cadf bin.76013`asg_updater::asg::asg_update::_$u7b$$u7b$closure$u7d$$u7d$::h0e4e0fa7473f8458((null)=0x00007ff7bb1274b0) at asg.rs:113:50
   110
   111    if asg_name == TIMEOUT_STRING {
   112      trace!("Sleeping for {}s", REFRESH_INTERVAL);
-> 113      sleep(Duration::from_secs(REFRESH_INTERVAL)).await;
   114      return Ok(());
   115    }

BTW what I'm naively trying to do here is implement my own timeout into a MappedFutures::next() call (this crate), but it's likely not the best / correct way to do it (I'm new to this). Any advice greatly appreciated! :-)

Darksonn commented 2 weeks ago

That crate has a lot of unsafe code, a lot of yanked versions, and no public repository, so I'm not feeling so confident about it. Incorrect unsafe code in a third-party crate can easily lead to the error you are seeing, so based on that, that would be my first theory.

chroche commented 2 weeks ago

Yes I had a feeling too that this may be the root cause. I'm going to see if I can avoid using it.

Thanks!