tokio-rs / bytes

Utilities for working with bytes
MIT License
1.91k stars 288 forks source link

bug assertion failed: self.remaining() >= 1' #569

Closed langzime closed 2 years ago

langzime commented 2 years ago

explanation = ''' Panic occurred in file '/root/.cargo/registry/src/github.com-1ecc6299db9ec823/bytes-1.2.1/src/buf/buf_impl.rs' at line 288 ''' cause = 'assertion failed: self.remaining() >= 1' method = 'Panic' backtrace = '''

0: 0x564026e262dd - core::panicking::panic::h467ee1bf554babeb at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/core/src/panicking.rs:48 1: 0x564026f77908 - ::get_uint_lenenc::h169ef9c296a06cb3 2: 0x564026f971f1 - <rbdc_mysql::protocol::statement::row::BinaryRow as rbdc::io::decode::Decode<&[rbdc_mysql::result_set::MySqlColumn]>>::decode_with::h8399b94c62593bf7 3: 0x564026f846b1 - <core::future::from_generator::GenFuture as core::future::future::Future>::poll::h9a0f5b689d144373 4: 0x564026f6cda0 - <futures_util::future::future::fuse::Fuse as core::future::future::Future>::poll::h05a1a4796a90996a 5: 0x564026f96e73 - <rbdc::ext::async_stream::TryAsyncStream as futures_core::stream::Stream>::poll_next::hfb85934d4f598af8 6: 0x564026f7e454 - <core::future::from_generator::GenFuture as core::future::future::Future>::poll::h266bc21deeefd3dd 7: 0x564026f6ce40 - <futures_util::future::future::fuse::Fuse as core::future::future::Future>::poll::h61d6a4993f3bc921 8: 0x564026f96e73 - <rbdc::ext::async_stream::TryAsyncStream as futures_core::stream::Stream>::poll_next::hfb85934d4f598af8 9: 0x564026f60bc0 - <futures_util::stream::try_stream::try_filter_map::TryFilterMap<St,Fut,F> as futures_core::stream::Stream>::poll_next::hccbea7b9e74be286 10: 0x564026f605de - <futures_util::stream::try_stream::try_collect::TryCollect<St,C> as core::future::future::Future>::poll::h2055b949e973eef8 11: 0x564026f8810c - <core::future::from_generator::GenFuture as core::future::future::Future>::poll::hd1a5ee1ff41ac3db 12: 0x56402701c0fb - <core::future::from_generator::GenFuture as core::future::future::Future>::poll::h4e276440558ae85e 13: 0x56402701b66c - <core::future::from_generator::GenFuture as core::future::future::Future>::poll::h01965840dacb0f7d 14: 0x56402701d52a - <core::future::from_generator::GenFuture as core::future::future::Future>::poll::h76e086df9b13ac91 15: 0x56402701ece5 - <core::future::from_generator::GenFuture as core::future::future::Future>::poll::h8f7eb1bb8fe47013 16: 0x564026eb741d - web_start::xxxx_handler::{{closure}}::h7a09ff32a7ae0468 17: 0x564026eb354a - <core::future::from_generator::GenFuture as core::future::future::Future>::poll::h2fb19531f7042064 18: 0x564026ea4354 - <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll::hd6567f7ec1bc9a6a 19: 0x564026e9a299 - <axum::handler::future::IntoServiceFuture as core::future::future::Future>::poll::hb6d4d39bdb11512b 20: 0x564026f00d52 - <tower::util::oneshot::Oneshot<S,Req> as core::future::future::Future>::poll::he8b16696398da69e 21: 0x564026f3330c - <tower_http::trace::future::ResponseFuture<Fut,C,OnResponseT,OnBodyChunkT,OnEosT,OnFailureT> as core::future::future::Future>::poll::hb174760e0ce201f8 22: 0x564026ecdeb0 - <tower_http::map_response_body::ResponseFuture<Fut,F> as core::future::future::Future>::poll::h9d9fd6acd4ac82cb 23: 0x564026f00d52 - <tower::util::oneshot::Oneshot<S,Req> as core::future::future::Future>::poll::he8b16696398da69e 24: 0x564026ec3ea4 - hyper::proto::h1::dispatch::Dispatcher<D,Bs,I,T>::poll_loop::h9d0a7ff93207fc7b 25: 0x564026ec15dd - hyper::proto::h1::dispatch::Dispatcher<D,Bs,I,T>::poll_catch::hb771022621a48631 26: 0x564026f32d7a - <hyper::server::conn::upgrades::UpgradeableConnection<I,S,E> as core::future::future::Future>::poll::hc8db73a7e124918d 27: 0x564026ece2e5 - <hyper::server::server::new_svc::NewSvcTask<I,N,S,E,W> as core::future::future::Future>::poll::h08987c213b16205d 28: 0x564026f01abc - <core::panic::unwind_safe::AssertUnwindSafe as core::ops::function::FnOnce<()>>::call_once::hbae63c70e49fcf9b 29: 0x564026f39dea - tokio::runtime::task::harness::Harness<T,S>::poll::h961ba5f38507ae34 30: 0x564027276195 - std::thread::local::LocalKey::with::hf40b53b1cb7f77ca 31: 0x56402728e5a1 - tokio::runtime::thread_pool::worker::Context::run_task::h00511a6d3362bd14 32: 0x56402728d74e - tokio::runtime::thread_pool::worker::Context::run::h8b559b2ed96b34ce 33: 0x564027277467 - tokio::macros::scoped_tls::ScopedKey::set::h644cb268db194c69 34: 0x56402728d0d9 - tokio::runtime::thread_pool::worker::run::h787a4419de614fd6 35: 0x564027282fe1 - <tokio::runtime::blocking::task::BlockingTask as core::future::future::Future>::poll::h07fffbf2c78c7270 36: 0x5640272747b9 - tokio::runtime::task::harness::Harness<T,S>::poll::hb722a908495cae64 37: 0x564027272c55 - tokio::runtime::blocking::pool::Inner::run::hf861eb3fe956ca4d 38: 0x5640272783d2 - std::sys_common::backtrace::__rust_begin_short_backtrace::hbe6d564773b67100 39: 0x564027278b8f - core::ops::function::FnOnce::call_once{{vtable.shim}}::h62228945f5daa953 40: 0x5640272d7823 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce>::call_once::h1680342795a2dc08 at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library/alloc/src/boxed.rs:1951

Darksonn commented 2 years ago

The get_u8 method panics if the thing you're calling it on is empty. This is not a bug in bytes. It's either a bug in your code, or in rbdc_mysql.

langzime commented 2 years ago

think you!