spacejam / sled

the champagne of beta embedded databases
Apache License 2.0
8.18k stars 383 forks source link

i686-unknown-linux-musl: paniced at "range end index out of range for slice of length" #1427

Open JasonHonor opened 2 years ago

JasonHonor commented 2 years ago
  1. expected result no panic
  2. actual result thread 'main' panicked at 'range end index 108 out of range for slice of length 30'
  3. sled version 0.34.7
  4. rustc version 1.64
  5. operating system manjaro-linux
  6. minimal code sample that helps to reproduce the issue
    
    use gluesql::*;
    use gluesql::prelude::{Glue,SledStorage};
    use memory_storage::MemoryStorage;
    use std::time::Instant; // timer

fn main() { let storage = SledStorage::new("data/doc-db").unwrap(); //let storage = MemoryStorage::Load("data/doc-db"); let mut glue = Glue::new(storage); let sqls = vec![ "DROP TABLE IF EXISTS Glue;", "CREATE TABLE Glue (id INTEGER);", "INSERT INTO Glue VALUES (100);", "INSERT INTO Glue VALUES (200);", "SELECT * FROM Glue WHERE id > 100;", ];

let sql2 = vec![
    "INSERT INTO Glue VALUES(103)",
];

let timer = Instant::now();
for pos in 0 ..100 {
    for sql in sqls.clone() {
        let output = glue.execute(sql).unwrap();
        println!("EXEC:{:?}", output)
    }
}
print!("100 times Stress durtaion={}ms\n",timer.elapsed().as_millis());

}

1. logs, panic messages, stack traces

stack backtrace: 0: 0x8262a4d - std::backtrace_rs::backtrace::libunwind::trace::hacdcb670ad14d1cc at /rustc/01af5040fdada6ef8f1b749cda798d80a8590b2c/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5 1: 0x8262a4d - std::backtrace_rs::backtrace::trace_unsynchronized::he44e32767eadb9f7 at /rustc/01af5040fdada6ef8f1b749cda798d80a8590b2c/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5 2: 0x8262a4d - std::sys_common::backtrace::_print_fmt::h9564b1bae3159642 at /rustc/01af5040fdada6ef8f1b749cda798d80a8590b2c/library/std/src/sys_common/backtrace.rs:66:5 3: 0x8262a4d - ::fmt::hd498cf570799d2a7 at /rustc/01af5040fdada6ef8f1b749cda798d80a8590b2c/library/std/src/sys_common/backtrace.rs:45:22 4: 0x829737c - core::fmt::write::h86824d589f85c1bc at /rustc/01af5040fdada6ef8f1b749cda798d80a8590b2c/library/core/src/fmt/mod.rs:1209:17 5: 0x825fb1b - std::io::Write::write_fmt::h5f5f2e2b78c8ae65 at /rustc/01af5040fdada6ef8f1b749cda798d80a8590b2c/library/std/src/io/mod.rs:1679:15 6: 0x8264117 - std::sys_common::backtrace::_print::hd839be088a2bb178 at /rustc/01af5040fdada6ef8f1b749cda798d80a8590b2c/library/std/src/sys_common/backtrace.rs:48:5 7: 0x8264117 - std::sys_common::backtrace::print::h13a34bd3c20704aa at /rustc/01af5040fdada6ef8f1b749cda798d80a8590b2c/library/std/src/sys_common/backtrace.rs:35:9 8: 0x8264117 - std::panicking::default_hook::{{closure}}::h4cda2a079a7af85a at /rustc/01af5040fdada6ef8f1b749cda798d80a8590b2c/library/std/src/panicking.rs:267:22 9: 0x8263e34 - std::panicking::default_hook::hd170f92111745c80 at /rustc/01af5040fdada6ef8f1b749cda798d80a8590b2c/library/std/src/panicking.rs:286:9 10: 0x82647e1 - std::panicking::rust_panic_with_hook::h04b634ce011e5e0e at /rustc/01af5040fdada6ef8f1b749cda798d80a8590b2c/library/std/src/panicking.rs:669:13 11: 0x82646eb - std::panicking::begin_panic_handler::{{closure}}::hfdee776a0c170c45 at /rustc/01af5040fdada6ef8f1b749cda798d80a8590b2c/library/std/src/panicking.rs:560:13 12: 0x8262eca - std::sys_common::backtrace::__rust_end_short_backtrace::h096cae08396bd4cc at /rustc/01af5040fdada6ef8f1b749cda798d80a8590b2c/library/std/src/sys_common/backtrace.rs:138:18 13: 0x82643c3 - rust_begin_unwind at /rustc/01af5040fdada6ef8f1b749cda798d80a8590b2c/library/std/src/panicking.rs:556:5 14: 0x804b230 - core::panicking::panic_fmt::h19308cfbb14004fc at /rustc/01af5040fdada6ef8f1b749cda798d80a8590b2c/library/core/src/panicking.rs:142:14 15: 0x8298f3f - core::slice::index::slice_end_index_len_fail_rt::h7e2c262a034bcf0c at /rustc/01af5040fdada6ef8f1b749cda798d80a8590b2c/library/core/src/slice/index.rs:76:5 16: 0x804b392 - core::slice::index::slice_end_index_len_fail::h840877921c4f7738 at /rustc/01af5040fdada6ef8f1b749cda798d80a8590b2c/library/core/src/slice/index.rs:69:9 17: 0x8101d84 - <core::ops::range::Range as core::slice::index::SliceIndex<[T]>>::index::h5c846d7b66cb9d2d at /rustc/01af5040fdada6ef8f1b749cda798d80a8590b2c/library/core/src/slice/index.rs:392:13 18: 0x810354f - <core::ops::range::RangeTo as core::slice::index::SliceIndex<[T]>>::index::hc76d74019d247f6f at /rustc/01af5040fdada6ef8f1b749cda798d80a8590b2c/library/core/src/slice/index.rs:439:9 19: 0x8173a0a - core::slice::index::<impl core::ops::index::Index for [T]>::index::hecba03f8bc734262 at /rustc/01af5040fdada6ef8f1b749cda798d80a8590b2c/library/core/src/slice/index.rs:18:9 20: 0x80d6b21 - ::deserialize::h08fd71d076d475d9