spacejam / sled

the champagne of beta embedded databases
Apache License 2.0
8.2k stars 384 forks source link

SIGSEGV on db.insert() #1407

Closed Rikorose closed 2 years ago

Rikorose commented 2 years ago

I get an (signal: 11, SIGSEGV: invalid memory reference) error when trying to insert into sled. I am using serde/bincode to get a Vec<u8> of my struct. Relevant code is:

pub fn cache_sample(&self, key: u64, sample: &Sample<Complex32>) -> Result<()> {
    let data: Vec<u8> = bincode::serde::encode_to_vec(sample, self.config)?;
    dbg!(data.len());
    let key: &[u8; 8] = unsafe { transmute(key) };
    dbg!();
    self.db.insert(key, data)?;  // Segfault
    dbg!();
    Ok(())
}

Probably due to an unaligned move:

#0  __memmove_avx_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:397

expected result

Data get's inserted without segfault

actual result

coredumpctl gdb ``` $ coredumpctl gdb PID: 182393 (df-6896915b79b2) UID: 1000 (hendrik) GID: 1000 (hendrik) Signal: 11 (SEGV) Timestamp: Tue 2022-04-19 07:39:17 CEST (21s ago) Command Line: /home/hendrik/projects/DeepFilterNet/target/debug/deps/df-6896915b79b2d3b2 cached_valid --nocapture Executable: /home/hendrik/projects/DeepFilterNet/target/debug/deps/df-6896915b79b2d3b2 Control Group: /user.slice/user-1000.slice/user@1000.service/app.slice/app-foot.slice/app-foot-174148.scope Unit: user@1000.service User Unit: app-foot-174148.scope Slice: user-1000.slice Owner UID: 1000 (hendrik) Boot ID: 45f817c8a33e45158dc335f9184cee1f Machine ID: fef964380b2449f7aa6d9beaddc5719b Hostname: T480s Storage: /var/lib/systemd/coredump/core.df-6896915b79b2.1000.45f817c8a33e45158dc335f9184cee1f.182393.1650346757000000.zst (present) Disk Size: 3.4M Message: Process 182393 (df-6896915b79b2) of user 1000 dumped core. Found module /home/hendrik/projects/DeepFilterNet/target/debug/deps/df-6896915b79b2d3b2 with build-id: 679998eb7eaa108c08774a515966f5392a06ebe3 Found module linux-vdso.so.1 with build-id: 1e289edaaab9e832320ae02a0c5d0953c38b2de1 Found module libz.so.1 with build-id: 5903f5c355c264403e4e7cdc66779584425ca3b8 Found module libsz.so.2 with build-id: c69bcb83945ff4e25be01fc8e04ffb0545d1308e Found module ld-linux-x86-64.so.2 with build-id: 0414018caaea84ae28b5cac3374e2de68eaeecf8 Found module libc.so.6 with build-id: 5d63c4327ba6cdd1e8b99eb1c0a9f056a98c67e1 Found module libm.so.6 with build-id: 1586854d78f3048d2f112e36b97e6db246b60fa0 Found module libgcc_s.so.1 with build-id: 0028b8616fa79ea1496e4812c3fc9c7bf9607a56 Found module libhdf5.so.103 with build-id: db9f5d317e0b2f95e9115f7525d441a1e59c594b Stack trace of thread 182394: #0 0x00007f82d402d9d5 __memcpy_avx_unaligned_erms (libc.so.6 + 0x1829d5) #1 0x000055d23faaac39 n/a (/home/hendrik/projects/DeepFilterNet/target/debug/deps/df-6896915b79b2d3b2 + 0xef9c39) GNU gdb (GDB) Fedora 11.2-2.fc35 Copyright (C) 2022 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from /home/hendrik/projects/DeepFilterNet/target/debug/deps/df-6896915b79b2d3b2... [New LWP 182394] [New LWP 182398] [New LWP 182402] [New LWP 182406] [New LWP 182399] [New LWP 182393] [New LWP 182403] [New LWP 182395] [New LWP 182409] [New LWP 182401] [New LWP 182396] [New LWP 182397] [New LWP 182410] [New LWP 182407] [New LWP 182408] [New LWP 182405] [New LWP 182400] [New LWP 182404] This GDB supports auto-downloading debuginfo from the following URLs: https://debuginfod.fedoraproject.org/ [I]Enable debuginfod for this session? (y or [n]) y Debuginfod has been enabled. To make this setting permanent, add 'set debuginfod enabled on' to .gdbinit. Downloading separate debug info for /lib64/libgcc_s.so.1... Downloading separate debug info for /home/hendrik/.cache/debuginfod_client/0028b8616fa79ea1496e4812c3fc9c7bf9607a56/debuginfo... Downloading separate debug info for /lib64/libz.so.1... [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Core was generated by `/home/hendrik/projects/DeepFilterNet/target/debug/deps/df-6896915b79b2d3b2 cach'. Program terminated with signal SIGSEGV, Segmentation fault. #0 __memmove_avx_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:397 397 movq -8(%rsi,%rdx), %rcx [Current thread is 1 (Thread 0x7f82d3e81640 (LWP 182394))] warning: Missing auto-load script at offset 0 in section .debug_gdb_scripts of file /home/hendrik/projects/DeepFilterNet/target/debug/deps/df-6896915b79b2d3b2. Use `info auto-load python-scripts [REGEXP]' to list them. ```
bt full ```gdb #0 __memmove_avx_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:397 No locals. #1 0x000055d23faaac39 in core::intrinsics::copy_nonoverlapping (src=0xa56583de412d4fea, dst=0x7f82d3e788ba, count=8) at /rustc/4e8fb743ccbec27344b2dd42de7057f41d4ebfdd/library/core/src/intrinsics.rs:2104 No locals. #2 0x000055d23f6eba3f in core::slice::{impl#0}::copy_from_slice (self=..., src=...) at /rustc/4e8fb743ccbec27344b2dd42de7057f41d4ebfdd/library/core/src/slice/mod.rs:3175 No locals. #3 0x000055d23f76656d in sled::ivec::IVec::inline (slice=...) at /home/hendrik/.cargo/registry/src/github.com-1ecc6299db9ec823/sled-0.34.7/src/ivec.rs:113 data = [0 ] #4 0x000055d23f7666ec in sled::ivec::{impl#5}::from (slice=...) at /home/hendrik/.cargo/registry/src/github.com-1ecc6299db9ec823/sled-0.34.7/src/ivec.rs:161 No locals. #5 0x000055d23f74bd71 in sled::node::Node::node_kv_pair (self=0x7f82cc011fb8, key=...) at /home/hendrik/.cargo/registry/src/github.com-1ecc6299db9ec823/sled-0.34.7/src/node.rs:593 No locals. #6 0x000055d23f739a5d in sled::tree::Tree::insert_inner (self=0x7f82d3e7e5c8, key=..., value=..., guard=0x7f82d3e79578) at /home/hendrik/.cargo/registry/src/github.com-1ecc6299db9ec823/sled-0.34.7/src/tree.rs:188 subscriber_reservation = core::option::Option::None node_view = sled::pagecache::NodeView (sled::pagecache::PageView {read: crossbeam_epoch::atomic::Shared {data: 140199745767440, _marker: core::marker::PhantomData<(&(), *const sled::pagecache::Page)>}, entry: 0x7f82d02b0020}) pid = 2 _measure = sled::metrics::Measure {_start: 0, _pd: core::marker::PhantomData<&()>} #7 0x000055d23ef6355f in sled::tree::Tree::insert<&[u8; 8], &[u8]> (self=0x7f82d3e7e5c8, key=0xa56583de412d4fea b, value=...) at /home/hendrik/.cargo/registry/src/github.com-1ecc6299db9ec823/sled-0.34.7/src/tree.rs:164 _cc = sled::concurrency_control::Protector::None(0x7f8290000c90) guard = sled::Guard {inner: crossbeam_epoch::guard::Guard {local: 0x7f82cc008530}, readset: alloc::vec::Vec {buf: alloc::raw_vec::RawVec {ptr: core::ptr::unique::Unique {pointer: 0x8, _marker: core::marker::PhantomData}, cap: 0, alloc: alloc::alloc::Global}, len: 0}, writeset: alloc::vec::Vec {buf: alloc::raw_vec::RawVec {ptr: core::ptr::unique::Unique {pointer: 0x8, _marker: core::marker::PhantomData}, cap: 0, alloc: alloc::alloc::Global}, len: 0}} value = sled::ivec::IVec (sled::ivec::IVecInner::Remote(sled::arc::Arc<[u8]> {ptr: *mut sled::arc::ArcInner<[u8]> {data_ptr: 0x7f8287dda010, length: 1192854}})) #8 0x000055d23f2a5bb1 in df::cache::ValidCache::cache_sample (self=0x7f82d3e7e5a8, key=11918076979505352682, sample=0x7f82d3e7c7f0) at libDF/src/cache.rs:70 key = 0xa56583de412d4fea b n_enc = 1192854 data = alloc::vec::Vec {buf: alloc::raw_vec::RawVec {ptr: core::ptr::unique::Unique {pointer: 0x7f8287efe010, _marker: core::marker::PhantomData}, cap: 67108864, alloc: alloc::alloc::Global}, len: 67108864} #9 0x000055d23f351f25 in df::reexport_dataset_modules::dataset::{impl#19}::get_sample (self=0x7f82d3e7e420, idx=0, seed=...) at libDF/src/dataset.rs:773 sample = df::reexport_dataset_modules::dataset::Sample> {speech: ndarray::ArrayBase>, ndarray::dimension::dim::Dim> {data: ndarray::data_repr::OwnedRepr> {ptr: core::ptr::non_null::NonNull> {pointer: 0x7f82cc1ad1b0}, len: 48100, capacity: 48100}, ptr: core::ptr::non_null::NonNull> {pointer: 0x7f82cc1ad1b0}, dim: ndarray::dimension::dim::Dim {index: ndarray::dimension::dynindeximpl::IxDynImpl (ndarray::dimension::dynindeximpl::IxDynRepr::Inline(3, [1, 100, 481, 0]))}, strides: ndarray::dimension::dim::Dim {index: ndarray::dimension::dynindeximpl::IxDynImpl (ndarray::dimension::dynindeximpl::IxDynRepr::Inline(3, [48100, 481, 1, 0]))}}, noise: ndarray::ArrayBase>, ndarray::dimension::dim::Dim> {data: ndarray::data_repr::OwnedRepr> {ptr: core::ptr::non_null::NonNull> {pointer: 0x7f82cc20b0e0}, len: 48100, capacity: 48100}, ptr: core::ptr::non_null::NonNull> {pointer: 0x7f82cc20b0e0}, dim: ndarray::dimension::dim::Dim {index: ndarray::dimension::dynindeximpl::IxDynImpl (ndarray::dimension::dynindeximpl::IxDynRepr::Inline(3, [1, 100, 481, 0]))}, strides: ndarray::dimension::dim::Dim {index: ndarray::dimension::dynindeximpl::IxDynImpl (ndarray::dimension::dynindeximpl::IxDynRepr::Inline(3, [48100, 481, 1, 0]))}}, noisy: ndarray::ArrayBase>, ndarray::dimension::dim::Dim> {data: ndarray::data_repr::OwnedRepr> {ptr: core::ptr::non_null::NonNull> {pointer: 0x7f82cc269010}, len: 48100, capacity: 48100}, ptr: core::ptr::non_null::NonNull> {pointer: 0x7f82cc269010}, dim: ndarray::dimension::dim::Dim {index: ndarray::dimension::dynindeximpl::IxDynImpl (ndarray::dimension::dynindeximpl::IxDynRepr::Inline(3, [1, 100, 481, 0]))}, strides: ndarray::dimension::dim::Dim {index: ndarray::dimension::dynindeximpl::IxDynImpl (ndarray::dimension::dynindeximpl::IxDynRepr::Inline(3, [48100, 481, 1, 0]))}}, feat_erb: core::option::Option, ndarray::dimension::dim::Dim>>::Some(ndarray::ArrayBase, ndarray::dimension::dim::Dim> {data: ndarray::data_repr::OwnedRepr {ptr: core::ptr::non_null::NonNull {pointer: 0x7f82cc0be930}, len: 3200, capacity: 3200}, ptr: core::ptr::non_null::NonNull {pointer: 0x7f82cc0be930}, dim: ndarray::dimension::dim::Dim {index: ndarray::dimension::dynindeximpl::IxDynImpl (ndarray::dimension::dynindeximpl::IxDynRepr::Inline(3, [1, 100, 32, 0]))}, strides: ndarray::dimension::dim::Dim {index: ndarray::dimension::dynindeximpl::IxDynImpl (ndarray::dimension::dynindeximpl::IxDynRepr::Inline(3, [3200, 32, 1, 0]))}}), feat_spec: core::option::Option>, ndarray::dimension::dim::Dim>>::Some(ndarray::ArrayBase>, ndarray::dimension::dim::Dim> {data: ndarray::data_repr::OwnedRepr> {ptr: core::ptr::non_null::NonNull> {pointer: 0x7f82cc0c1b40}, len: 3200, capacity: 3200}, ptr: core::ptr::non_null::NonNull> {pointer: 0x7f82cc0c1b40}, dim: ndarray::dimension::dim::Dim {index: ndarray::dimension::dynindeximpl::IxDynImpl (ndarray::dimension::dynindeximpl::IxDynRepr::Inline(3, [1, 100, 32, 0]))}, strides: ndarray::dimension::dim::Dim {index: ndarray::dimension::dynindeximpl::IxDynImpl (ndarray::dimension::dynindeximpl::IxDynRepr::Inline(3, [3200, 32, 1, 0]))}}), max_freq: 24000, snr: 20, gain: 0, idx: 0} spec = core::option::Option>, ndarray::dimension::dim::Dim>>::Some(ndarray::ArrayBase>, ndarray::dimension::dim::Dim> {data: ndarray::data_repr::OwnedRepr> {ptr: core::ptr::non_null::NonNull> {pointer: 0x7f82cc0c1b40}, len: 3200, capacity: 3200}, ptr: core::ptr::non_null::NonNull> {pointer: 0x7f82cc0c1b40}, dim: ndarray::dimension::dim::Dim {index: ndarray::dimension::dynindeximpl::IxDynImpl (ndarray::dimension::dynindeximpl::IxDynRepr::Inline(3, [1, 100, 32, 0]))}, strides: ndarray::dimension::dim::Dim {index: ndarray::dimension::dynindeximpl::IxDynImpl (ndarray::dimension::dynindeximpl::IxDynRepr::Inline(3, [3200, 32, 1, 0]))}}) erb = core::option::Option, ndarray::dimension::dim::Dim>>::Some(ndarray::ArrayBase, ndarray::dimension::dim::Dim> {data: ndarray::data_repr::OwnedRepr {ptr: core::ptr::non_null::NonNull {pointer: 0x7f82cc0be930}, len: 3200, capacity: 3200}, ptr: core::ptr::non_null::NonNull {pointer: 0x7f82cc0be930}, dim: ndarray::dimension::dim::Dim {index: ndarray::dimension::dynindeximpl::IxDynImpl (ndarray::dimension::dynindeximpl::IxDynRepr::Inline(3, [1, 100, 32, 0]))}, strides: ndarray::dimension::dim::Dim {index: ndarray::dimension::dynindeximpl::IxDynImpl (ndarray::dimension::dynindeximpl::IxDynRepr::Inline(3, [3200, 32, 1, 0]))}}) noisy = ndarray::ArrayBase>, ndarray::dimension::dim::Dim<[usize; 3]>> {data: ndarray::data_repr::OwnedRepr> {ptr: core::ptr::non_null::NonNull> {pointer: 0x7f82cc269010}, len: 48100, capacity: 48100}, ptr: core::ptr::non_null::NonNull> {pointer: 0x7f82cc269010}, dim: ndarray::dimension::dim::Dim<[usize; 3]> {index: [1, 100, 481]}, strides: ndarray::dimension::dim::Dim<[usize; 3]> {index: [48100, 481, 1]}} noise = ndarray::ArrayBase>, ndarray::dimension::dim::Dim<[usize; 3]>> {data: ndarray::data_repr::OwnedRepr> {ptr: core::ptr::non_null::NonNull> {pointer: 0x7f82cc20b0e0}, len: 48100, capacity: 48100}, ptr: core::ptr::non_null::NonNull> {pointer: 0x7f82cc20b0e0}, dim: ndarray::dimension::dim::Dim<[usize; 3]> {index: [1, 100, 481]}, strides: ndarray::dimension::dim::Dim<[usize; 3]> {index: [48100, 481, 1]}} speech = ndarray::ArrayBase>, ndarray::dimension::dim::Dim<[usize; 3]>> {data: ndarray::data_repr::OwnedRepr> {ptr: core::pt[I]--Type for more, q to quit, c to continue without paging--c r::non_null::NonNull> {pointer: 0x7f82cc1ad1b0}, len: 48100, capacity: 48100}, ptr: core::ptr::non_null::NonNull> {pointer: 0x7f82cc1ad1b0}, dim: ndarray::dimension::dim::Dim<[usize; 3]> {index: [1, 100, 481]}, strides: ndarray::dimension::dim::Dim<[usize; 3]> {index: [48100, 481, 1]}} state = df::DFState {sr: 48000, frame_size: 480, window_size: 960, freq_size: 481, fft_forward: alloc::sync::Arc> {ptr: core::ptr::non_null::NonNull>> {pointer: *const alloc::sync::ArcInner> {pointer: 0x7f82cc0baf50, vtable: 0x55d23fdf1cc8}}, phantom: core::marker::PhantomData>>}, fft_inverse: alloc::sync::Arc> {ptr: core::ptr::non_null::NonNull>> {pointer: *const alloc::sync::ArcInner> {pointer: 0x7f82cc0bb850, vtable: 0x55d23fdf1da8}}, phantom: core::marker::PhantomData>>}, window: alloc::vec::Vec {buf: alloc::raw_vec::RawVec {ptr: core::ptr::unique::Unique {pointer: 0x7f82cc0bda20, _marker: core::marker::PhantomData}, cap: 960, alloc: alloc::alloc::Global}, len: 960}, wnorm: 0.00104166672, erb: alloc::vec::Vec {buf: alloc::raw_vec::RawVec {ptr: core::ptr::unique::Unique {pointer: 0x7f82cc0bd910, _marker: core::marker::PhantomData}, cap: 32, alloc: alloc::alloc::Global}, len: 32}, analysis_mem: alloc::vec::Vec {buf: alloc::raw_vec::RawVec {ptr: core::ptr::unique::Unique {pointer: 0x7f82cc0bc9f0, _marker: core::marker::PhantomData}, cap: 480, alloc: alloc::alloc::Global}, len: 480}, analysis_scratch: alloc::vec::Vec, alloc::alloc::Global> {buf: alloc::raw_vec::RawVec, alloc::alloc::Global> {ptr: core::ptr::unique::Unique> {pointer: 0x4, _marker: core::marker::PhantomData>}, cap: 0, alloc: alloc::alloc::Global}, len: 0}, synthesis_mem: alloc::vec::Vec {buf: alloc::raw_vec::RawVec {ptr: core::ptr::unique::Unique {pointer: 0x7f82cc0bd180, _marker: core::marker::PhantomData}, cap: 480, alloc: alloc::alloc::Global}, len: 480}, synthesis_scratch: alloc::vec::Vec, alloc::alloc::Global> {buf: alloc::raw_vec::RawVec, alloc::alloc::Global> {ptr: core::ptr::unique::Unique> {pointer: 0x4, _marker: core::marker::PhantomData>}, cap: 0, alloc: alloc::alloc::Global}, len: 0}} nb_erb = 32 sample = df::reexport_dataset_modules::dataset::Sample {speech: ndarray::ArrayBase, ndarray::dimension::dim::Dim> {data: ndarray::data_repr::OwnedRepr {ptr: core::ptr::non_null::NonNull {pointer: 0x7f82cc17e3a0}, len: 48000, capacity: 48000}, ptr: core::ptr::non_null::NonNull {pointer: 0x7f82cc17e3a0}, dim: ndarray::dimension::dim::Dim {index: ndarray::dimension::dynindeximpl::IxDynImpl (ndarray::dimension::dynindeximpl::IxDynRepr::Inline(2, [1, 48000, 0, 0]))}, strides: ndarray::dimension::dim::Dim {index: ndarray::dimension::dynindeximpl::IxDynImpl (ndarray::dimension::dynindeximpl::IxDynRepr::Inline(2, [48000, 1, 0, 0]))}}, noise: ndarray::ArrayBase, ndarray::dimension::dim::Dim> {data: ndarray::data_repr::OwnedRepr {ptr: core::ptr::non_null::NonNull {pointer: 0x7f82cc0f1960}, len: 48000, capacity: 48000}, ptr: core::ptr::non_null::NonNull {pointer: 0x7f82cc0f1960}, dim: ndarray::dimension::dim::Dim {index: ndarray::dimension::dynindeximpl::IxDynImpl (ndarray::dimension::dynindeximpl::IxDynRepr::Inline(2, [1, 48000, 0, 0]))}, strides: ndarray::dimension::dim::Dim {index: ndarray::dimension::dynindeximpl::IxDynImpl (ndarray::dimension::dynindeximpl::IxDynRepr::Inline(2, [48000, 1, 0, 0]))}}, noisy: ndarray::ArrayBase, ndarray::dimension::dim::Dim> {data: ndarray::data_repr::OwnedRepr {ptr: core::ptr::non_null::NonNull {pointer: 0x7f82cc3253b0}, len: 48000, capacity: 48000}, ptr: core::ptr::non_null::NonNull {pointer: 0x7f82cc3253b0}, dim: ndarray::dimension::dim::Dim {index: ndarray::dimension::dynindeximpl::IxDynImpl (ndarray::dimension::dynindeximpl::IxDynRepr::Inline(2, [1, 48000, 0, 0]))}, strides: ndarray::dimension::dim::Dim {index: ndarray::dimension::dynindeximpl::IxDynImpl (ndarray::dimension::dynindeximpl::IxDynRepr::Inline(2, [48000, 1, 0, 0]))}}, feat_erb: core::option::Option, ndarray::dimension::dim::Dim>>::None, feat_spec: core::option::Option>, ndarray::dimension::dim::Dim>>::None, max_freq: 24000, snr: 20, gain: 0, idx: 0} hash = 11918076979505352682 #10 0x000055d23f2275a3 in df::reexport_dataset_modules::dataset::tests::test_cached_valid_dataset () at libDF/src/dataset.rs:1984 idx = 0 iter = core::ops::range::Range {start: 1, end: 3} iter = core::ops::range::Range {start: 1, end: 2} seed = 42 iter = core::array::iter::IntoIter {data: [core::mem::maybe_uninit::MaybeUninit {uninit: (), value: core::mem::manually_drop::ManuallyDrop {value: 42}}, core::mem::maybe_uninit::MaybeUninit {uninit: (), value: core::mem::manually_drop::ManuallyDrop {value: 43}}], alive: core::ops::range::Range {start: 1, end: 2}} ds_len = 3 val_ds = df::reexport_dataset_modules::dataset::FftDataset {ds: df::reexport_dataset_modules::dataset::TdDataset {config: alloc::vec::Vec {buf: alloc::raw_vec::RawVec {ptr: core::ptr::unique::Unique {pointer: 0x7f82cc007bb0, _marker: core::marker::PhantomData}, cap: 4, alloc: alloc::alloc::Global}, len: 2}, hdf5_handles: alloc::vec::Vec {buf: alloc::raw_vec::RawVec {ptr: core::ptr::unique::Unique {pointer: 0x7f82cc007de0, _marker: core::marker::PhantomData}, cap: 4, alloc: alloc::alloc::Global}, len: 2}, max_samples: 48000, sr: 48000, ds_keys: alloc::vec::Vec<(df::reexport_dataset_modules::dataset::DsType, usize, alloc::vec::Vec), alloc::alloc::Global> {buf: alloc::raw_vec::RawVec<(df::reexport_dataset_modules::dataset::DsType, usize, alloc::vec::Vec), alloc::alloc::Global> {ptr: core::ptr::unique::Unique<(df::reexport_dataset_modules::dataset::DsType, usize, alloc::vec::Vec)> {pointer: 0x7f82cc007b00, _marker: core::marker::PhantomData<(df::reexport_dataset_modules::dataset::DsType, usize, alloc::vec::Vec)>}, cap: 4, alloc: alloc::alloc::Global}, len: 2}, ds_split: df::reexport_dataset_modules::dataset::Split::Valid, sp_keys: alloc::vec::Vec<(usize, alloc::string::String), alloc::alloc::Global> {buf: alloc::raw_vec::RawVec<(usize, alloc::string::String), alloc::alloc::Global> {ptr: core::ptr::unique::Unique<(usize, alloc::string::String)> {pointer: 0x7f82cc003af0, _marker: core::marker::PhantomData<(usize, alloc::string::String)>}, cap: 4, alloc: alloc::alloc::Global}, len: 3}, ns_keys: alloc::vec::Vec<(usize, alloc::string::String), alloc::alloc::Global> {buf: alloc::raw_vec::RawVec<(usize, alloc::string::String), alloc::alloc::Global> {ptr: core::ptr::unique::Unique<(usize, alloc::string::String)> {pointer: 0x7f82cc0b4430, _marker: core::marker::PhantomData<(usize, alloc::string::String)>}, cap: 6, alloc: alloc::alloc::Global}, len: 6}, rir_keys: alloc::vec::Vec<(usize, alloc::string::String), alloc::alloc::Global> {buf: alloc::raw_vec::RawVec<(usize, alloc::string::String), alloc::alloc::Global> {ptr: core::ptr::unique::Unique<(usize, alloc::string::String)> {pointer: 0x8, _marker: core::marker::PhantomData<(usize, alloc::string::String)>}, cap: 0, alloc: alloc::alloc::Global}, len: 0}, snrs: alloc::vec::Vec {buf: alloc::raw_vec::RawVec {ptr: core::ptr::unique::Unique {pointer: 0x7f82cc007f50, _marker: core::marker::PhantomData}, cap: 6, alloc: alloc::alloc::Global}, len: 6}, gains: alloc::vec::Vec {buf: alloc::raw_vec::RawVec {ptr: core::ptr::unique::Unique {pointer: 0x7f82cc007f70, _marker: core::marker::PhantomData}, cap: 3, alloc: alloc::alloc::Global}, len: 3}, p_fill_speech: 0, sp_transforms: df::reexport_dataset_modules::augmentations::Compose {transforms: alloc::vec::Vec, alloc::alloc::Global> {buf: alloc::raw_vec::RawVec, alloc::alloc::Global> {ptr: core::ptr::unique::Unique> {pointer: 0x7f82cc003690, _marker: core::marker::PhantomData>}, cap: 4, alloc: alloc::alloc::Global}, len: 4}}, ns_transforms: df::reexport_dataset_modules::augmentations::Compose {transforms: alloc::vec::Vec, alloc::alloc::Global> {buf: alloc::raw_vec::RawVec, alloc::alloc::Global> {ptr: core::ptr::unique::Unique> {pointer: 0x7f82cc002810, _marker: core::marker::PhantomData>}, cap: 4, alloc: alloc::alloc::Global}, len: 4}}, reverb: df::reexport_dataset_modules::augmentations::RandReverbSim {prob_speech: 0, prob_noise: 0, prob_resample: 0, prob_decay: 0, sr: 48000}, seed: 42, ds_len: 3, logger: core::option::Option>::None}, fft_size: 960, hop_size: 480, nb_erb: core::option::Option::Some(32), nb_spec: core::option::Option::Some(32), norm_alpha: core::option::Option::None, min_nb_freqs: core::option::Option::None, cache: core::option::Option::Some(df::cache::ValidCache {db: sled::db::Db {context: sled::context::Context {config: sled::config::RunningConfig {inner: sled::config::Config (sled::arc::Arc {ptr: 0x7f82cc001290}), file: sled::arc::Arc {ptr: 0x7f82cc008480}}, flusher: sled::arc::Arc>> {ptr: 0x7f82cc001fb0}, pagecache: sled::arc::Arc {ptr: 0x7f82cc0014c0}}, default: sled::tree::Tree (sled::arc::Arc {ptr: 0x7f82cc033d50}), tenants: sled::arc::Arc>>> {ptr: 0x7f82cc033df0}}, config: bincode::config::Configuration {_e: core::marker::PhantomData, _i: core::marker::PhantomData, _a: core::marker::PhantomData, _l: core::marker::PhantomData}, hash: 5297491010474216136, n_samples: 3, max_size: 0})} builder = df::reexport_dataset_modules::dataset::DatasetBuilder {ds_dir: alloc::string::String {vec: alloc::vec::Vec {buf: alloc::raw_vec::RawVec {ptr: core::ptr::unique::Unique {pointer: 0x7f82cc000d40, _marker: core::marker::PhantomData}, cap: 10, alloc: alloc::alloc::Global}, len: 10}}, sr: 48000, fft_size: core::option::Option::Some(960), datasets: core::option::Option::None, max_len_s: core::option::Option::Some(1), hop_size: core::option::Option::Some(480), nb_erb: core::option::Option::Some(32), nb_spec: core::option::Option::Some(32), norm_alpha: core::option::Option::None, p_reverb: core::option::Option::None, p_fill_speech: core::option::Option::None, seed: core::option::Option::None, min_nb_freqs: core::option::Option::None, global_sampling_f: core::option::Option::None, snrs: core::option::Option>::None, gains: core::option::Option>::None, cache_valid: false, num_threads: core::option::Option::None, logger: core::option::Option>::None} cfg = df::reexport_dataset_modules::dataset::DatasetConfigJson {train: alloc::vec::Vec {buf: alloc::raw_vec::RawVec {ptr: core::ptr::unique::Unique {pointer: 0x7f82cc002fe0, _marker: core::marker::PhantomData}, cap: 4, alloc: alloc::alloc::Global}, len: 2}, valid: alloc::vec::Vec {buf: alloc::raw_vec::RawVec {ptr: core::ptr::unique::Unique {pointer: 0x7f82cc003250, _marker: core::marker::PhantomData}, cap: 4, alloc: alloc::alloc::Global}, len: 2}, test: alloc::vec::Vec {buf: alloc::raw_vec::RawVec {ptr: core::ptr::unique::Unique {pointer: 0x7f82cc002d90, _marker: core::marker::PhantomData}, cap: 4, alloc: alloc::alloc::Global}, len: 2}} ds_dir = "../assets/" sr = 48000 norm_alpha = core::option::Option::None nb_spec = core::option::Option::Some(32) nb_erb = core::option::Option::Some(32) hop_size = core::option::Option::Some(480) fft_size = 960 #11 0x000055d23eefc023 in df::reexport_dataset_modules::dataset::tests::test_cached_valid_dataset::{closure#0} () at libDF/src/dataset.rs:1944 No locals. #12 0x000055d23f374bfe in core::ops::function::FnOnce::call_once () at /rustc/4e8fb743ccbec27344b2dd42de7057f41d4ebfdd/library/core/src/ops/function.rs:227 No locals. #13 0x000055d23f863bf3 in core::ops::function::FnOnce::call_once () at /rustc/4e8fb743ccbec27344b2dd42de7057f41d4ebfdd/library/core/src/ops/function.rs:227 No locals. #14 test::__rust_begin_short_backtrace () at library/test/src/lib.rs:575 No locals. #15 0x000055d23f8628d7 in alloc::boxed::{impl#44}::call_once<(), (dyn core::ops::function::FnOnce<(), Output=()> + core::marker::Send), alloc::alloc::Global> () at /rustc/4e8fb743ccbec27344b2dd42de7057f41d4ebfdd/library/alloc/src/boxed.rs:1854 No locals. #16 core::panic::unwind_safe::{impl#23}::call_once<(), alloc::boxed::Box<(dyn core::ops::function::FnOnce<(), Output=()> + core::marker::Send), alloc::alloc::Global>> () at /rustc/4e8fb743ccbec27344b2dd42de7057f41d4ebfdd/library/core/src/panic/unwind_safe.rs:271 No locals. #17 std::panicking::try::do_call + core::marker::Send), alloc::alloc::Global>>, ()> () at /rustc/4e8fb743ccbec27344b2dd42de7057f41d4ebfdd/library/std/src/panicking.rs:492 No locals. #18 std::panicking::try<(), core::panic::unwind_safe::AssertUnwindSafe + core::marker::Send), alloc::alloc::Global>>> () at /rustc/4e8fb743ccbec27344b2dd42de7057f41d4ebfdd/library/std/src/panicking.rs:456 No locals. #19 std::panic::catch_unwind + core::marker::Send), alloc::alloc::Global>>, ()> () at /rustc/4e8fb743ccbec27344b2dd42de7057f41d4ebfdd/library/std/src/panic.rs:137 No locals. #20 test::run_test_in_process () at library/test/src/lib.rs:598 No locals. #21 test::run_test::run_test_inner::{closure#0} () at library/test/src/lib.rs:492 No locals. #22 0x000055d23f86bc31 in test::run_test::run_test_inner::{closure#1} () at library/test/src/lib.rs:519 No locals. #23 std::sys_common::backtrace::__rust_begin_short_backtrace () at /rustc/4e8fb743ccbec27344b2dd42de7057f41d4ebfdd/library/std/src/sys_common/backtrace.rs:122 No locals. #24 0x000055d23f83887f in std::thread::{impl#0}::spawn_unchecked_::{closure#1}::{closure#0} () at /rustc/4e8fb743ccbec27344b2dd42de7057f41d4ebfdd/library/std/src/thread/mod.rs:498 No locals. #25 core::panic::unwind_safe::{impl#23}::call_once<(), std::thread::{impl#0}::spawn_unchecked_::{closure#1}::{closure_env#0}> () at /rustc/4e8fb743ccbec27344b2dd42de7057f41d4ebfdd/library/core/src/panic/unwind_safe.rs:271 No locals. #26 std::panicking::try::do_call>, ()> () at /rustc/4e8fb743ccbec27344b2dd42de7057f41d4ebfdd/library/std/src/panicking.rs:492 No locals. #27 std::panicking::try<(), core::panic::unwind_safe::AssertUnwindSafe>> () at /rustc/4e8fb743ccbec27344b2dd42de7057f41d4ebfdd/library/std/src/panicking.rs:456 No locals. #28 std::panic::catch_unwind>, ()> () at /rustc/4e8fb743ccbec27344b2dd42de7057f41d4ebfdd/library/std/src/panic.rs:137 No locals. #29 std::thread::{impl#0}::spawn_unchecked_::{closure#1} () at /rustc/4e8fb743ccbec27344b2dd42de7057f41d4ebfdd/library/std/src/thread/mod.rs:497 No locals. #30 core::ops::function::FnOnce::call_once, ()> () at /rustc/4e8fb743ccbec27344b2dd42de7057f41d4ebfdd/library/core/src/ops/function.rs:227 No locals. #31 0x000055d23fbdb6b3 in alloc::boxed::{impl#44}::call_once<(), dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global> () at /rustc/4e8fb743ccbec27344b2dd42de7057f41d4ebfdd/library/alloc/src/boxed.rs:1854 No locals. #32 alloc::boxed::{impl#44}::call_once<(), alloc::boxed::Box, alloc::alloc::Global>, alloc::alloc::Global> () at /rustc/4e8fb743ccbec27344b2dd42de7057f41d4ebfdd/library/alloc/src/boxed.rs:1854 No locals. #33 std::sys::unix::thread::{impl#2}::new::thread_start () at library/std/src/sys/unix/thread.rs:108 No locals. #34 0x00007f82d3f38b1a in start_thread (arg=) at pthread_create.c:443 ret = pd = out = unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140731617050144, -8637168340601416729, 140199877678656, 2, 140199878428736, 0, 8585896051178984423, 8585895815134565351}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}} not_first_call = #35 0x00007f82d3fbd660 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81 No locals. ```

sled version

0.34.7

rustc version

rustc 1.60.0 (7737e0b5c 2022-04-04)

operating system

Fedora 35 x86

minimal code sample that helps to reproduce the issue

See above

logs, panic messages, stack traces

See above

Rikorose commented 2 years ago

My bad, the problem was let key: &[u8; 8] = unsafe { transmute(key) };

Closing.