Closed markschl closed 6 years ago
I can't reproduce this on Windows but I am able to reproduce it on Linux. I've reduced it down to a bug in slice-deque
:
extern crate slice_deque;
use slice_deque::SliceDeque;
fn main() {
let mut deque = SliceDeque::<u8>::with_capacity(4096);
let slice = unsafe {
deque.move_tail(4096);
deque.move_head(4000);
deque.move_tail(4000);
deque.move_head(4000);
// head = 8000, tail = 8096
deque.tail_head_slice()
};
for i in 0 .. slice.len() {
// segfault at i = 96
slice[i] = 0;
}
}
Thanks for reporting it in slice_dequeue. I guess if you replace 4096 with 65536 (64 KiB), the bug might appear on Windows as well.
@markschl Yeah it does, thanks for the suggestion.
Version 0.1.10
of slice_deque
has been released with this issue fixed (in Linux, Windows, and other targets).
Sorry that it took so long to fix this, but life got in the way :/
Glad you were able to get to it. I'm rerunning CI here and if it's green I'll consider this closed.
When evaluating the new slice-dequeue feature, I encountered a strange segfault. I'm not totally sure what is wrong and to be honest haven't invested a lot of time in trying to find out. It appears that it happens in
SliceDeque::tail_head_slice()
.The issue can be reproduced using this code (tested on OS X):