Checklist
Describe the bug
At Zed we run tokio_rustls in production with a few tens of thousands of active users. About once a day we see a panic with the following trace:
Notably the "slice of length 24" seems to always be that size; but the "range start index" varies considerably (from 40 - 216 in the last week).
I tried following the code, but I think there's some inlining going on that makes it tricky to decipher. I also tried to grep for magic number "24", but there was no obvious use that made sense.
Panic: range start index 40 out of range for slice of length 24
core::slice::index::slice_start_index_len_fail::heeb7c73b0ee7f95b
rustls::vecbuf::ChunkVecBuffer::write_to::he63d8bd98360b066
_$LT$tokio_rustls..client..TlsStream$LT$IO$GT$$u20$as$u20$tokio..io..async_write..AsyncWrite$GT$::poll_shutdown::he45ac55ffd33d1df
h2::proto::connection::Connection$LT$T$C$P$C$B$GT$::poll::h8d7d535d8032d8e7
_$LT$hyper..proto..h2..client..H2ClientFuture$LT$B$C$T$GT$$u20$as$u20$core..future..future..Future$GT$::poll::h945af6542e475182
tokio::runtime::task::raw::poll::h603eb9699b70c2c3
tokio::runtime::scheduler::multi_thread::worker::Context::run_task::h9f5a9bf687bfba0a
tokio::runtime::scheduler::multi_thread::worker::run::he5a038213beb3f9a
tokio::runtime::task::raw::poll::h96fd9b5e4d5c3cd2
core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::h4c6d91adc37e555d
std::sys::pal::unix::thread::Thread::new::thread_start::h1bd1b9c95010bf71
_pthread_start
thread_start
Running through symbolicate gives me:
/rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/slice/index.rs:57: core::slice::index::slice_end_index_len_fail::h19b63a1d9e216190
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rustls-0.23.20/src/verify.rs:339: _$LT$rustls..verify..DigitallySignedStruct$u20$as$u20$rustls..msgs..codec..Codec$GT$::encode::h5680ab6869e8f09f
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rustls-0.23.20/src/conn.rs:734: rustls::conn::ConnectionCommon$LT$Data$GT$::write_tls::hb05366a08db4ade5
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-rustls-0.26.1/src/common/mod.rs:116: tokio_rustls::common::Stream$LT$IO$C$C$GT$::write_io::h42c4e059532223cd
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-rustls-0.26.1/src/common/mod.rs:335: _$LT$tokio_rustls..common..Stream$LT$IO$C$C$GT$$u20$as$u20$tokio..io..async_write..AsyncWrite$GT$::poll_shutdown::h7e0b58a8058184cd
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-rustls-0.26.1/src/client.rs:242: _$LT$tokio_rustls..client..TlsStream$LT$IO$GT$$u20$as$u20$tokio..io..async_write..AsyncWrite$GT$::poll_shutdown::he45ac55ffd33d1df
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/h2-0.4.7/src/lib.rs:101: h2::proto::connection::Connection$LT$T$C$P$C$B$GT$::poll::h8d7d535d8032d8e7
/rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/task/poll.rs:147: core::task::poll::Poll$LT$core..result..Result$LT$T$C$E$GT$$GT$::map_err::h5ceef2574d2aaa7f
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/h2-0.4.7/src/client.rs:1440: _$LT$h2..client..Connection$LT$T$C$B$GT$$u20$as$u20$core..future..future..Future$GT$::poll::hed356274fee1e05c
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-util-0.3.31/src/future/either.rs:0: _$LT$futures_util..future..either..Either$LT$A$C$B$GT$$u20$as$u20$core..future..future..Future$GT$::poll::h4eb195e927548615
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hyper-1.5.1/src/proto/h2/client.rs:279: _$LT$hyper..proto..h2..client..ConnMapErr$LT$T$C$B$GT$$u20$as$u20$core..future..future..Future$GT$::poll::h81bd512687f400cc
/rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/future/future.rs:123: _$LT$core..pin..Pin$LT$P$GT$$u20$as$u20$core..future..future..Future$GT$::poll::h6ca3c4bf23a26fa0
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-util-0.3.31/src/future/future/mod.rs:558: futures_util::future::future::FutureExt::poll_unpin::he21beefe1c306e8c
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hyper-1.5.1/src/proto/h2/client.rs:344: _$LT$hyper..proto..h2..client..ConnTask$LT$T$C$B$GT$$u20$as$u20$core..future..future..Future$GT$::poll::hdd93ecff7a9541fb
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hyper-1.5.1/src/proto/h2/client.rs:401: _$LT$hyper..proto..h2..client..H2ClientFuture$LT$B$C$T$GT$$u20$as$u20$core..future..future..Future$GT$::poll::h945af6542e475182
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.42.0/src/runtime/task/core.rs:0: tokio::runtime::task::core::Core$LT$T$C$S$GT$::poll::_$u7b$$u7b$closure$u7d$$u7d$::h4a33ce4b6825c75b
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.42.0/src/loom/std/unsafe_cell.rs:16: tokio::loom::std::unsafe_cell::UnsafeCell$LT$T$GT$::with_mut::hc63d74e7bf0a2a39
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.42.0/src/runtime/task/core.rs:320: tokio::runtime::task::core::Core$LT$T$C$S$GT$::poll::hadbaebf76947c2dc
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.42.0/src/runtime/task/harness.rs:499: tokio::runtime::task::harness::poll_future::_$u7b$$u7b$closure$u7d$$u7d$::h4ee61eb3477c3612
/rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/panic/unwind_safe.rs:272: _$LT$core..panic..unwind_safe..AssertUnwindSafe$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$$LP$$RP$$GT$$GT$::call_once::hf361c7d4e456cbb6
/rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:557: std::panicking::try::do_call::hd7b2750e49d5c695
/rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:521: std::panicking::try::h67f9f24e383caf5c
/rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panic.rs:350: std::panic::catch_unwind::h6828c8e974a9acae
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.42.0/src/runtime/task/harness.rs:487: tokio::runtime::task::harness::poll_future::h277190ee29ebe2e9
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.42.0/src/runtime/task/harness.rs:209: tokio::runtime::task::harness::Harness$LT$T$C$S$GT$::poll_inner::hcedbb5d1ccac9601
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.42.0/src/runtime/task/harness.rs:154: tokio::runtime::task::harness::Harness$LT$T$C$S$GT$::poll::h51e907f6d6faf0e2
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.42.0/src/runtime/task/raw.rs:271: tokio::runtime::task::raw::poll::h603eb9699b70c2c3
/rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/cell.rs:536: core::cell::Cell$LT$T$GT$::get::hb0c9fd4827f6369e
/rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/cell.rs:1805: core::cell::BorrowRefMut::new::h07f5edc201500cb5
/rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/cell.rs:1106: core::cell::RefCell$LT$T$GT$::try_borrow_mut::hde66203c67bc1229
/rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/cell.rs:1074: core::cell::RefCell$LT$T$GT$::borrow_mut::h5976db6c47c17743
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.42.0/src/runtime/scheduler/multi_thread/worker.rs:604: tokio::runtime::scheduler::multi_thread::worker::Context::run_task::_$u7b$$u7b$closure$u7d$$u7d$::h64877d9132596777
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.42.0/src/runtime/coop.rs:107: tokio::runtime::coop::with_budget::ha72158f545d06de3
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.42.0/src/runtime/coop.rs:73: tokio::runtime::coop::budget::h4f0bf1234c287715
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.42.0/src/runtime/scheduler/multi_thread/worker.rs:595: tokio::runtime::scheduler::multi_thread::worker::Context::run_task::h9f5a9bf687bfba0a
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.42.0/src/runtime/scheduler/multi_thread/worker.rs:0: tokio::runtime::scheduler::multi_thread::worker::Context::run::hbffefde66f5b3823
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.42.0/src/runtime/scheduler/multi_thread/worker.rs:511: tokio::runtime::scheduler::multi_thread::worker::run::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::h3b1547aaf0bacbbb
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.42.0/src/runtime/context/scoped.rs:40: tokio::runtime::context::scoped::Scoped$LT$T$GT$::set::h435c7b81e425b17c
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.42.0/src/runtime/context.rs:180: tokio::runtime::context::set_scheduler::_$u7b$$u7b$closure$u7d$$u7d$::hce7d6cfb84dc1c11
/rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/thread/local.rs:283: std::thread::local::LocalKey$LT$T$GT$::try_with::h37fc6dcb9f204fbb
/rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/thread/local.rs:260: std::thread::local::LocalKey$LT$T$GT$::with::heafcadf96d857744
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.42.0/src/runtime/context.rs:180: tokio::runtime::context::set_scheduler::hc57e5c17c37c34e6
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.42.0/src/runtime/scheduler/multi_thread/worker.rs:506: tokio::runtime::scheduler::multi_thread::worker::run::_$u7b$$u7b$closure$u7d$$u7d$::h527015c71bea9116
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.42.0/src/runtime/context/runtime.rs:65: tokio::runtime::context::runtime::enter_runtime::hd720c9ca3b168db2
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.42.0/src/runtime/scheduler/multi_thread/worker.rs:498: tokio::runtime::scheduler::multi_thread::worker::run::he5a038213beb3f9a
/rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/cell.rs:536: core::cell::Cell$LT$T$GT$::get::h2c0c753932437d68
/rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/sys/thread_local/native/eager.rs:34: std::sys::thread_local::native::eager::Storage$LT$T$GT$::get::h5819b10815f90749
/rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/sys/thread_local/native/mod.rs:63: tokio::runtime::context::CONTEXT::_$u7b$$u7b$constant$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::hde166878f07fd575
/rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/ops/function.rs:250: core::ops::function::FnOnce::call_once::hcddb4b9f1f5ca4eb
/rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/thread/local.rs:282: std::thread::local::LocalKey$LT$T$GT$::try_with::h2619c9a52b9b949c
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.42.0/src/runtime/context.rs:159: tokio::runtime::context::set_current_task_id::h32f998b5bac783cc
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.42.0/src/runtime/task/core.rs:300: _$LT$tokio..runtime..task..core..TaskIdGuard$u20$as$u20$core..ops..drop..Drop$GT$::drop::hcefafdaf1333a851
/rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/ptr/mod.rs:542: core::ptr::drop_in_place$LT$tokio..runtime..task..core..TaskIdGuard$GT$::h19210109f349f5e9
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.42.0/src/runtime/task/core.rs:332: tokio::runtime::task::core::Core$LT$T$C$S$GT$::poll::_$u7b$$u7b$closure$u7d$$u7d$::h9d883018c7a9bd12
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.42.0/src/loom/std/unsafe_cell.rs:16: tokio::loom::std::unsafe_cell::UnsafeCell$LT$T$GT$::with_mut::h993ea040c8ebba5a
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.42.0/src/runtime/task/core.rs:320: tokio::runtime::task::core::Core$LT$T$C$S$GT$::poll::h1178fc907eff4bbd
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.42.0/src/runtime/task/harness.rs:499: tokio::runtime::task::harness::poll_future::_$u7b$$u7b$closure$u7d$$u7d$::h781594024af35262
/rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/panic/unwind_safe.rs:272: _$LT$core..panic..unwind_safe..AssertUnwindSafe$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$$LP$$RP$$GT$$GT$::call_once::ha29435c39e63dc34
/rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:557: std::panicking::try::do_call::h759cd84ff7ae3a62
/rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:521: std::panicking::try::h5904ff79b0d0ec41
/rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panic.rs:350: std::panic::catch_unwind::h90dad91b2b22f7ff
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.42.0/src/runtime/task/harness.rs:487: tokio::runtime::task::harness::poll_future::h5f6702402a528f80
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.42.0/src/runtime/task/harness.rs:209: tokio::runtime::task::harness::Harness$LT$T$C$S$GT$::poll_inner::h1caad0ab67326438
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.42.0/src/runtime/task/harness.rs:154: tokio::runtime::task::harness::Harness$LT$T$C$S$GT$::poll::h88007c0718999312
/Users/administrator/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.42.0/src/runtime/task/raw.rs:271: tokio::runtime::task::raw::poll::h96fd9b5e4d5c3cd2
/rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/thread/mod.rs:0: std::thread::Builder::spawn_unchecked_::_$u7b$$u7b$closure$u7d$$u7d$::hd91d28de12ca7019
/rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/ops/function.rs:250: core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::h4c6d91adc37e555d
/rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/mem/mod.rs:394: core::mem::size_of_val_raw::h29c3c0849377d6c5
/rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/alloc/layout.rs:203: core::alloc::layout::Layout::for_value_raw::hd2e32b044e704129
/rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/alloc/src/boxed.rs:1293: _$LT$alloc..boxed..Box$LT$T$C$A$GT$$u20$as$u20$core..ops..drop..Drop$GT$::drop::hbbf96842440ef897
/rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/alloc/src/boxed.rs:2070: _$LT$alloc..boxed..Box$LT$F$C$A$GT$$u20$as$u20$core..ops..function..FnOnce$LT$Args$GT$$GT$::call_once::h01276ebbe54a8110
/rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/alloc/src/boxed.rs:2070: _$LT$alloc..boxed..Box$LT$F$C$A$GT$$u20$as$u20$core..ops..function..FnOnce$LT$Args$GT$$GT$::call_once::habad1faa89d23086
/rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/sys/pal/unix/thread.rs:108: std::sys::pal::unix::thread::Thread::new::thread_start::h1bd1b9c95010bf71
libsystem_pthread.dylib _pthread_start
libsystem_pthread.dylib thread_start
To Reproduce
Applicable Version(s)
A list of versions and platforms you've tested with.
Expected behavior
A clear and concise description of what you expected to happen.
Additional context
Add any other context about the problem here.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4