-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"attempt to subtract with overflow" panic in DB::open
#24
Comments
Added some debugging output to /// EOF is signalled by Ok(0)
pub fn read(&mut self, dst: &mut Vec<u8>) -> Result<usize> {
let mut checksum: u32;
let mut length: u16;
let mut typ: u8;
let mut dst_offset: usize = 0;
dst.clear();
loop {
println!("self.blocksize = {}", self.blocksize);
println!("self.blk_off = {}", self.blk_off);
if self.blocksize - self.blk_off < HEADER_SIZE {
// skip to next block
self.src
.read_exact(&mut self.head_scratch[0..self.blocksize - self.blk_off])?;
self.blk_off = 0;
}
let mut bytes_read = self.src.read(&mut self.head_scratch)?;
// EOF
if bytes_read == 0 {
return Ok(0);
}
... Output
|
would you mind trying out what happens if you change this to |
There is a bug when recovering the manifest, in version_set.rs line ~693. The descriptor_log should be opened using new_with_off to recover the offset. |
This is a great find, would you mind sending a PR? (so the credit is yours) |
The text was updated successfully, but these errors were encountered: