Closed Rikorose closed 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:
(signal: 11, SIGSEGV: invalid memory reference)
Vec<u8>
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
Data get's inserted without segfault
I get an
(signal: 11, SIGSEGV: invalid memory reference)
error when trying to insert into sled. I am using serde/bincode to get aVec<u8>
of my struct. Relevant code is:Probably due to an unaligned move:
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 laterbt 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