SeekStorm: Crashing with Index out of bounds or range out of range for slice of length

This is a very cool product!

I setup a local test and when I do searches I randomly get index out of bounds error such as this:

thread ‘tokio-runtime-worker’ panicked at /Users/andy/Downloads/SeekStorm-main 3/src/seekstorm/intersection.rs:936:38: index out of bounds: the len is 521 but the index is 521 stack backtrace: 0: _rust_begin_unwind 1: core::panicking::panic_fmt 2: core::panicking::panic_bounds_check 3: seekstorm::intersection::intersection_docid::{{closure}}.4929 4: seekstorm::intersection::intersection_blockid::{{closure}}.4926 5: <alloc::sync::Arc<tokio::sync::rwlock::RwLockseekstorm::index::Index> as seekstorm::search::Search>::search::{{closure}}.4905 6: seekstorm_server::api_endpoints::query_index_api::{{closure}}.4893 7: seekstorm_server::http_server::http_request_handler::{{closure}}.4853 8: <hyper::server::conn::upgrades::UpgradeableConnection<I,S,E> as core::future::future::Future>::poll 9: <hyper::server::server::new_svc::NewSvcTask<I,N,S,E,W> as core::future::future::Future>::poll 10: tokio::runtime::task::core::Core<T,S>::poll 11: tokio::runtime::task::raw::poll 12: tokio::runtime::scheduler::multi_thread::worker::Context::run_task 13: tokio::runtime::task::raw::poll note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace. zsh: abort RUST_BACKTRACE=1 ./seekstorm_server local_ip=“0.0.0.0” local_port=8020

or range end index out of range errors.

thread ‘tokio-runtime-worker’ panicked at /Users/andy/Downloads/SeekStorm-main 3/src/seekstorm/utils.rs:103:28: range end index 5970246 out of range for slice of length 2604 stack backtrace: 0: _rust_begin_unwind 1: core::panicking::panic_fmt 2: core::slice::index::slice_end_index_len_fail 3: seekstorm::intersection::intersection_docid::{{closure}}.4929 4: seekstorm::intersection::intersection_blockid::{{closure}}.4926 5: <alloc::sync::Arc<tokio::sync::rwlock::RwLockseekstorm::index::Index> as seekstorm::search::Search>::search::{{closure}}.4905 6: seekstorm_server::api_endpoints::query_index_api::{{closure}}.4893 7: seekstorm_server::http_server::http_request_handler::{{closure}}.4853 8: <hyper::server::conn::upgrades::UpgradeableConnection<I,S,E> as core::future::future::Future>::poll 9: <hyper::server::server::new_svc::NewSvcTask<I,N,S,E,W> as core::future::future::Future>::poll 10: tokio::runtime::task::core::Core<T,S>::poll 11: tokio::runtime::task::raw::poll 12: tokio::runtime::scheduler::multi_thread::worker::Context::run_task 13: tokio::runtime::task::raw::poll note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace. zsh: abort RUST_BACKTRACE=1 ./seekstorm_server local_ip=“0.0.0.0” local_port=8020

Format of my data is like this:

{“address”: “123 N 4TH ST, DUPO, IL”, “postcode”: “61234”} {“address”: “456 N 2ND ST, DUPO, IL”, “postcode”: “12345”} {“address”: “789 N 5TH ST, DUPO, IL”, “postcode”: “12345”}

I am new to Rust so I am having a bit of trouble figuring out the errors. Thank you for your help I really appreciate it.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (9 by maintainers)

Commits related to this issue

Most upvoted comments

Exceptions should be fixed with commit afd2e8f (all relevant changes are within intersection.rs).

Please let me know if the fix works for you. Thanks.