kahing / catfs

Cache AnyThing filesystem written in Rust
Apache License 2.0
851 stars 54 forks source link

thread '<unnamed>' panicked at 'ino 0x0000000000005dc6 refcnt 1 deref 2', #25

Open yiding opened 5 years ago

yiding commented 5 years ago

I consistently get this panic when using catfs (with a backing sshfs). The accesses that were going on at the time were concurrent reads.

This is on fedora linux 30.

thread '<unnamed>' panicked at 'ino 0x0000000000005dc6 refcnt 1 deref 2', src/catfs/inode.rs:325:13
stack backtrace:
   0:     0x5567456c48d3 - std::sys::unix::backtrace::tracing::imp::unwind_backtrace::h50ebfb8734a81144
                               at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
   1:     0x5567456c009b - std::sys_common::backtrace::_print::hc7fdae4fb6b58d2d
                               at src/libstd/sys_common/backtrace.rs:71
   2:     0x5567456c3516 - std::panicking::default_hook::{{closure}}::hc55d0892611a29ff
                               at src/libstd/sys_common/backtrace.rs:59
                               at src/libstd/panicking.rs:197
   3:     0x5567456c32a9 - std::panicking::default_hook::h3c8a3df5d3469668
                               at src/libstd/panicking.rs:211
   4:     0x5567456c3c1f - std::panicking::rust_panic_with_hook::h24c9a1c35b1f49cc
                               at src/libstd/panicking.rs:474
   5:     0x5567456c37a1 - std::panicking::continue_panic_fmt::h8ed9632bdd4b9299
                               at src/libstd/panicking.rs:381
   6:     0x5567456c36ee - std::panicking::begin_panic_fmt::h000a944fb20c1b89
                               at src/libstd/panicking.rs:336
   7:     0x55674523a9f8 - catfs::catfs::inode::Inode::deref::ha80f5d680059df59
                               at src/catfs/inode.rs:325
   8:     0x55674527b818 - catfs::catfs::CatFS::forget::he60bc4926a9150db
                               at src/catfs/mod.rs:497
   9:     0x5567452b10b2 - <catfs::pcatfs::PCatFS as fuse::Filesystem>::forget::heaa21df26af5b057
                               at src/pcatfs/mod.rs:114
  10:     0x55674529efae - fuse::request::Request::dispatch::h8a112763bca046d5
                               at /home/yiding/.cargo/registry/src/github.com-1ecc6299db9ec823/fuse-0.3.1/src/request.rs:152
  11:     0x5567452a6b2c - fuse::request::dispatch::h04448e37e6d4b14e
                               at /home/yiding/.cargo/registry/src/github.com-1ecc6299db9ec823/fuse-0.3.1/src/request.rs:34
  12:     0x55674523fbb0 - fuse::session::Session<FS>::run::hb63d616c2d340913
                               at /home/yiding/.cargo/registry/src/github.com-1ecc6299db9ec823/fuse-0.3.1/src/session.rs:79
  13:     0x55674529c0c6 - catfs::main_internal::{{closure}}::he583d75e88ea67ec
                               at src/main.rs:252
  14:     0x556745240162 - std::sys_common::backtrace::__rust_begin_short_backtrace::h701448e976ab0c85
                               at /rustc/3c235d5600393dfe6c36eeed34042efad8d4f26e/src/libstd/sys_common/backtrace.rs:136
  15:     0x5567452b37f4 - std::thread::Builder::spawn_unchecked::{{closure}}::{{closure}}::hda067f3acb6e46b0
                               at /rustc/3c235d5600393dfe6c36eeed34042efad8d4f26e/src/libstd/thread/mod.rs:470
  16:     0x556745259cd4 - <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h68ddc649c0763ecb
                               at /rustc/3c235d5600393dfe6c36eeed34042efad8d4f26e/src/libstd/panic.rs:309
  17:     0x556745259c37 - std::panicking::try::do_call::h88297ddea77f2617
                               at /rustc/3c235d5600393dfe6c36eeed34042efad8d4f26e/src/libstd/panicking.rs:293
  18:     0x5567456c7109 - __rust_maybe_catch_panic
                               at src/libpanic_unwind/lib.rs:87
  19:     0x556745259b18 - std::panicking::try::h9ebff07a775c52f5
                               at /rustc/3c235d5600393dfe6c36eeed34042efad8d4f26e/src/libstd/panicking.rs:272
  20:     0x556745259d64 - std::panic::catch_unwind::h9fefc47ce2c1cb0d
                               at /rustc/3c235d5600393dfe6c36eeed34042efad8d4f26e/src/libstd/panic.rs:388
  21:     0x5567452b32db - std::thread::Builder::spawn_unchecked::{{closure}}::h33b8858a911913a8
                               at /rustc/3c235d5600393dfe6c36eeed34042efad8d4f26e/src/libstd/thread/mod.rs:469
  22:     0x556745208ab2 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h5c4bbb01fcb79527
                               at /rustc/3c235d5600393dfe6c36eeed34042efad8d4f26e/src/libcore/ops/function.rs:231
  23:     0x5567456b7a0e - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::h4cac16ae2114a837
                               at /rustc/3c235d5600393dfe6c36eeed34042efad8d4f26e/src/liballoc/boxed.rs:702
  24:     0x5567456c67df - std::sys::unix::thread::Thread::new::thread_start::h2adc1b80820f790e
                               at /rustc/3c235d5600393dfe6c36eeed34042efad8d4f26e/src/liballoc/boxed.rs:702
                               at src/libstd/sys_common/thread.rs:14
                               at src/libstd/sys/unix/thread.rs:80
  25:     0x7fc8442705a1 - start_thread
  26:     0x7fc844183162 - __clone
  27:                0x0 - <unknown>
gaul commented 4 years ago

@yiding Could you try cherry-picking #34, compiling with rust nightly, and building with RUSTFLAGS="-Z sanitizer=thread" cargo build? This may uncover a race condition.

gaul commented 3 years ago

Please test with the latest master.

yiding commented 3 years ago

I no longer have a setup that can make use of this so I can't really test. IIRC, I was doing some multi-threaded compilation of a large project when that occurred. Feel free to close.