dermesser / leveldb-rs

A reimplementation of LevelDB in Rust (no bindings).
Other
515 stars 60 forks source link

Exception 0xc00000fd encountered at address 0x7ff792ced999: Stack overflow #9

Open shangsony opened 3 years ago

shangsony commented 3 years ago

Exception 0xc00000fd encountered at address 0x7ff792ced999: Stack overflow, image

lijingwei9060 commented 3 years ago

insert following code in leveldb-rs\src\skipmap.rs

do not forget use std::rc::Rc;

impl Drop for Node {
    fn drop(&mut self) {
        // large object should drop
        if let Some(mut next) = self.next.take() {
            while let Some(child) = next.next.take() {
                next = child;
            }
        }
        unsafe {
            for skip in self.skips.iter_mut() {
                if let Some(mut next) = skip.take() {
                    while let Some(child) = (*next).next.take() {
                        next = Box::into_raw(child);
                    }
                }
            }
        }
    }
}
dermesser commented 3 years ago

can you confirm that #10 fixes this issue?