Skip to content

user-provided comparison function does not correctly implement a total order #344

@milahu

Description

@milahu

rqbit can crash at random times

thread 'tokio-runtime-worker' panicked at core/src/slice/sort/shared/smallsort.rs:865:5:
user-provided comparison function does not correctly implement a total order

stack backtrace

with RUST_BACKTRACE=1

stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::slice::sort::shared::smallsort::panic_on_ord_violation
   3: core::slice::sort::shared::smallsort::bidirectional_merge
   4: core::slice::sort::stable::quicksort::quicksort
   5: core::slice::sort::stable::quicksort::quicksort
   6: core::slice::sort::stable::quicksort::quicksort
   7: core::slice::sort::stable::drift::sort
   8: core::slice::sort::stable::driftsort_main
   9: librqbit_dht::routing_table::RoutingTable::sorted_by_distance_from
  10: librqbit_dht::dht::DhtState::on_received_message::{{closure}}
  11: librqbit_dht::dht::DhtState::on_received_message
  12: <tracing::instrument::Instrumented<T> as core::future::future::Future>::poll
  13: <core::future::poll_fn::PollFn<F> as core::future::future::Future>::poll
  14: <core::pin::Pin<P> as core::future::future::Future>::poll
  15: <core::future::poll_fn::PollFn<F> as core::future::future::Future>::poll
  16: <tracing::instrument::Instrumented<T> as core::future::future::Future>::poll
  17: tokio::runtime::task::core::Core<T,S>::poll
  18: tokio::runtime::task::harness::Harness<T,S>::poll
  19: tokio::runtime::scheduler::multi_thread::worker::Context::run_task
  20: tokio::runtime::scheduler::multi_thread::worker::Context::run
  21: tokio::runtime::context::runtime::enter_runtime
  22: tokio::runtime::scheduler::multi_thread::worker::run
  23: tokio::runtime::task::core::Core<T,S>::poll
  24: tokio::runtime::task::harness::Harness<T,S>::poll
  25: tokio::runtime::blocking::pool::Inner::run
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Aborted (core dumped)

workaround:
remove .cache/rqbit/session.json
add all torrents from .cache/rqbit/*.torrent
(not sure how long this works)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions