AppFlowy-IO / AppFlowy

Bring projects, wikis, and teams together with AI. AppFlowy is an AI collaborative workspace where you achieve more without losing control of your data. The best open source alternative to Notion.
https://www.appflowy.io
GNU Affero General Public License v3.0
56.89k stars 3.72k forks source link

[Bug] rust panic when flowy_user::services::db::UserDB::open_collab_db #5691

Closed allanGoldZhiKang closed 1 month ago

allanGoldZhiKang commented 3 months ago

Bug Description

thread '' panicked at library/core/src/panicking.rs:220:5: unsafe precondition(s) violated: ptr::copy_nonoverlapping requires that both pointer arguments are aligned and non-null and the specified memory ranges do not overlap stack backtrace: 0: rust_begin_unwind at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/panicking.rs:652:5 1: core::panicking::panic_nounwind_fmt::runtime at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/panicking.rs:110:18 2: core::panicking::panic_nounwind_fmt at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/panicking.rs:120:5 3: core::panicking::panic_nounwind at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/panicking.rs:220:5 4: rocksdb::transactions::transaction_db::TransactionDB::open_cf_descriptors_internal 5: rocksdb::transactions::transaction_db::TransactionDB::open_cf at /Users/allan/.cargo/git/checkouts/rust-rocksdb-00c8fca3e809007a/21cf4a2/src/transactions/transaction_db.rs:200:9 6: rocksdb::transactions::transaction_db::TransactionDB::open at /Users/allan/.cargo/git/checkouts/rust-rocksdb-00c8fca3e809007a/21cf4a2/src/transactions/transaction_db.rs:179:9 7: collab_plugins::local_storage::rocksdb::kv_impl::KVTransactionDBRocksdbImpl::open at /Users/allan/.cargo/git/checkouts/appflowy-collab-494188f9dbf24ecc/5048762/collab-plugins/src/local_storage/rocksdb/kv_impl.rs:69:23 8: flowy_user::services::db::UserDB::open_collab_db at /Users/allan/Downloads/test/AppFlowy/frontend/rust-lib/flowy-user/src/services/db.rs:208:20 9: flowy_user::services::db::UserDB::backup_or_restore at /Users/allan/Downloads/test/AppFlowy/frontend/rust-lib/flowy-user/src/services/db.rs:68:22 10: flowy_user::user_manager::manager::UserManager::prepare_backup::{{closure}} at /Users/allan/Downloads/test/AppFlowy/frontend/rust-lib/flowy-user/src/user_manager/manager.rs:533:5 11: flowy_user::user_manager::manager::UserManager::init_with_callback::{{closure}}::{{closure}}::{{closure}} at /Users/allan/Downloads/test/AppFlowy/frontend/rust-lib/flowy-user/src/user_manager/manager.rs:162:37 12: flowy_user::user_manager::manager::UserManager::init_with_callback::{{closure}}::{{closure}} at /Users/allan/Downloads/test/AppFlowy/frontend/rust-lib/flowy-user/src/user_manager/manager.rs:124:3 13: <tracing::instrument::Instrumented as core::future::future::Future>::poll at /Users/allan/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tracing-0.1.40/src/instrument.rs:321:9 14: flowy_user::user_manager::manager::UserManager::init_with_callback::{{closure}} at /Users/allan/Downloads/test/AppFlowy/frontend/rust-lib/flowy-user/src/user_manager/manager.rs:124:3 15: flowy_core::AppFlowyCore::init::{{closure}}::{{closure}} at /Users/allan/Downloads/test/AppFlowy/frontend/rust-lib/flowy-core/src/lib.rs:253:10 16: <tracing::instrument::Instrumented as core::future::future::Future>::poll at /Users/allan/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tracing-0.1.40/src/instrument.rs:321:9 17: flowy_core::AppFlowyCore::init::{{closure}} at /Users/allan/Downloads/test/AppFlowy/frontend/rust-lib/flowy-core/src/lib.rs:102:3 18: flowy_core::AppFlowyCore::new::{{closure}} at /Users/allan/Downloads/test/AppFlowy/frontend/rust-lib/flowy-core/src/lib.rs:95:33 19: dart_ffi::init_sdk::{{closure}} at /Users/allan/Downloads/test/AppFlowy/frontend/rust-lib/dart-ffi/src/lib.rs:103:64 20: <tracing::instrument::Instrumented as core::future::future::Future>::poll at /Users/allan/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tracing-0.1.40/src/instrument.rs:321:9 21: tokio::runtime::park::CachedParkThread::block_on::{{closure}} at /Users/allan/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.0/src/runtime/park.rs:281:63 22: tokio::runtime::coop::with_budget at /Users/allan/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.0/src/runtime/coop.rs:107:5 23: tokio::runtime::coop::budget at /Users/allan/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.0/src/runtime/coop.rs:73:5 24: tokio::runtime::park::CachedParkThread::block_on at /Users/allan/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.0/src/runtime/park.rs:281:31 25: tokio::runtime::context::blocking::BlockingRegionGuard::block_on at /Users/allan/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.0/src/runtime/context/blocking.rs:66:9 26: tokio::runtime::scheduler::multi_thread::MultiThread::block_on::{{closure}} at /Users/allan/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.0/src/runtime/scheduler/multi_thread/mod.rs:87:13 27: tokio::runtime::context::runtime::enter_runtime at /Users/allan/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.0/src/runtime/context/runtime.rs:65:16 28: tokio::runtime::scheduler::multi_thread::MultiThread::block_on at /Users/allan/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.0/src/runtime/scheduler/multi_thread/mod.rs:86:9 29: tokio::runtime::runtime::Runtime::block_on at /Users/allan/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.38.0/src/runtime/runtime.rs:349:45 30: lib_dispatch::runtime::AFPluginRuntime::block_on at /Users/allan/Downloads/test/AppFlowy/frontend/rust-lib/lib-dispatch/src/runtime.rs:85:5 31: init_sdk at /Users/allan/Downloads/test/AppFlowy/frontend/rust-lib/dart-ffi/src/lib.rs:102:29 note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace. thread caused non-unwinding panic. aborting. Lost connection to device.

Exited.

How to Reproduce

Just AF-destop: Clean + Rebuild All

Expected Behavior

run well

Please give me a hand, thank you @LucasXu0

Operating System

macOS Monterey 12.6

AppFlowy Version(s)

6d0c9f7 · 4 days ago

Screenshots

No response

Additional Context

No response

Xazin commented 3 months ago

This is an issue with rust-rocksdb, it's resolved in their latest version, but because we rely on a fork it's not up-to-date.

LucasXu0 commented 3 months ago

I'll sync their latest commit into the fork repo.

notandyvee commented 2 months ago

@LucasXu0 do you know when this will be merged? Because I pulled 0.6.4 and I had the same issue. Or are there instructions with how to use the forked repo?

Xazin commented 1 month ago

This was resolved in an earlier version :+1: