CympleTech / chamomile

Lightweight p2p library. Support build robust connection on decentralized network.
Apache License 2.0
113 stars 18 forks source link

Cannot run `permissionless` example #24

Closed qualterz closed 1 year ago

qualterz commented 2 years ago

Just tried to run one of the examples.

Backtrace ```bash λ ~/Downloads/chamomile/ main RUST_BACKTRACE=1 cargo run --example permissionless 127.0.0.1:8000 Finished dev [unoptimized + debuginfo] target(s) in 0.14s Running `target/debug/examples/permissionless '127.0.0.1:8000'` thread 'main' panicked at 'failed to set global default subscriber: SetGlobalDefaultError { _no_construct: () }', /home/nimda/.cargo/registry/src/github.com-1ecc6299db9ec823/tracing-subscriber-0.3.14/src/util.rs:91:14 stack backtrace: 0: rust_begin_unwind 1: core::panicking::panic_fmt 2: core::result::unwrap_failed 3: core::result::Result::expect at /builddir/build/BUILD/rustc-1.62.0-src/library/core/src/result.rs:1035:23 4: tracing_subscriber::util::SubscriberInitExt::init at /home/nimda/.cargo/registry/src/github.com-1ecc6299db9ec823/tracing-subscriber-0.3.14/src/util.rs:90:9 5: console_subscriber::builder::Builder::init at /home/nimda/.cargo/registry/src/github.com-1ecc6299db9ec823/console-subscriber-0.1.6/src/builder.rs:346:9 6: console_subscriber::builder::init at /home/nimda/.cargo/registry/src/github.com-1ecc6299db9ec823/console-subscriber-0.1.6/src/builder.rs:533:5 7: permissionless::main::{{closure}} at ./examples/permissionless.rs:7:5 8: as core::future::future::Future>::poll at /builddir/build/BUILD/rustc-1.62.0-src/library/core/src/future/mod.rs:91:19 9: as core::future::future::Future>::poll at /home/nimda/.cargo/registry/src/github.com-1ecc6299db9ec823/tracing-0.1.35/src/instrument.rs:272:9 10: tokio::park::thread::CachedParkThread::block_on::{{closure}} at /home/nimda/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.0/src/park/thread.rs:263:54 11: tokio::coop::with_budget::{{closure}} at /home/nimda/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.0/src/coop.rs:102:9 12: std::thread::local::LocalKey::try_with at /builddir/build/BUILD/rustc-1.62.0-src/library/std/src/thread/local.rs:445:16 13: std::thread::local::LocalKey::with at /builddir/build/BUILD/rustc-1.62.0-src/library/std/src/thread/local.rs:421:9 14: tokio::coop::with_budget at /home/nimda/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.0/src/coop.rs:95:5 15: tokio::coop::budget at /home/nimda/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.0/src/coop.rs:72:5 16: tokio::park::thread::CachedParkThread::block_on at /home/nimda/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.0/src/park/thread.rs:263:31 17: tokio::runtime::enter::Enter::block_on at /home/nimda/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.0/src/runtime/enter.rs:152:13 18: tokio::runtime::thread_pool::ThreadPool::block_on at /home/nimda/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.0/src/runtime/thread_pool/mod.rs:90:9 19: tokio::runtime::Runtime::block_on at /home/nimda/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.0/src/runtime/mod.rs:484:43 20: permissionless::main at ./examples/permissionless.rs:60:5 21: core::ops::function::FnOnce::call_once at /builddir/build/BUILD/rustc-1.62.0-src/library/core/src/ops/function.rs:248:5 ```
Full backtrace ```bash λ ~/Downloads/chamomile/ main RUST_BACKTRACE=full cargo run --example permissionless 127.0.0.1:8000 Finished dev [unoptimized + debuginfo] target(s) in 0.14s Running `target/debug/examples/permissionless '127.0.0.1:8000'` thread 'main' panicked at 'failed to set global default subscriber: SetGlobalDefaultError { _no_construct: () }', /home/nimda/.cargo/registry/src/github.com-1ecc6299db9ec823/tracing-subscriber-0.3.14/src/util.rs:91:14 stack backtrace: 0: 0x55ed7b47c96d - ::fmt::h23ccc882a731fbd2 1: 0x55ed7b49ec3c - core::fmt::write::hfa7c8ef1632cb66d 2: 0x55ed7b477281 - std::io::Write::write_fmt::h25599615a879f3c1 3: 0x55ed7b47e165 - std::panicking::default_hook::{{closure}}::h4e55e182b98c2bdb 4: 0x55ed7b47ddd9 - std::panicking::default_hook::haf55aabe5a854e67 5: 0x55ed7b47e738 - std::panicking::rust_panic_with_hook::h062980c33c10341b 6: 0x55ed7b47e5e7 - std::panicking::begin_panic_handler::{{closure}}::hb0e308c246d86e22 7: 0x55ed7b47ce24 - std::sys_common::backtrace::__rust_end_short_backtrace::h1ca03a770cddc17f 8: 0x55ed7b47e319 - rust_begin_unwind 9: 0x55ed7a36f033 - core::panicking::panic_fmt::ha831adb2c8e704a1 10: 0x55ed7a36f123 - core::result::unwrap_failed::ha14b8d7acf8b64a0 11: 0x55ed7a5db2ca - core::result::Result::expect::h164dda76cf95bcd7 at /builddir/build/BUILD/rustc-1.62.0-src/library/core/src/result.rs:1035:23 12: 0x55ed7a4da4b7 - tracing_subscriber::util::SubscriberInitExt::init::h2e69def373645d45 at /home/nimda/.cargo/registry/src/github.com-1ecc6299db9ec823/tracing-subscriber-0.3.14/src/util.rs:90:9 13: 0x55ed7a6a934f - console_subscriber::builder::Builder::init::hee415da29f990fe5 at /home/nimda/.cargo/registry/src/github.com-1ecc6299db9ec823/console-subscriber-0.1.6/src/builder.rs:346:9 14: 0x55ed7a6aa0f3 - console_subscriber::builder::init::h5f5350d624741eda at /home/nimda/.cargo/registry/src/github.com-1ecc6299db9ec823/console-subscriber-0.1.6/src/builder.rs:533:5 15: 0x55ed7a402702 - permissionless::main::{{closure}}::h94b67aafc2bdcee1 at /mnt/storage/Downloads/chamomile/examples/permissionless.rs:7:5 16: 0x55ed7a3fe79b - as core::future::future::Future>::poll::hb83645c193a2df7d at /builddir/build/BUILD/rustc-1.62.0-src/library/core/src/future/mod.rs:91:19 17: 0x55ed7a3f5fbf - as core::future::future::Future>::poll::hd2a132a05cd0f5b8 at /home/nimda/.cargo/registry/src/github.com-1ecc6299db9ec823/tracing-0.1.35/src/instrument.rs:272:9 18: 0x55ed7a449400 - tokio::park::thread::CachedParkThread::block_on::{{closure}}::h31000afaf1c9072f at /home/nimda/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.0/src/park/thread.rs:263:54 19: 0x55ed7a4a6070 - tokio::coop::with_budget::{{closure}}::hc2d9d351c4239170 at /home/nimda/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.0/src/coop.rs:102:9 20: 0x55ed7a4a5a96 - std::thread::local::LocalKey::try_with::he76beafb8d671a29 at /builddir/build/BUILD/rustc-1.62.0-src/library/std/src/thread/local.rs:445:16 21: 0x55ed7a4a554d - std::thread::local::LocalKey::with::h91e043711161342c at /builddir/build/BUILD/rustc-1.62.0-src/library/std/src/thread/local.rs:421:9 22: 0x55ed7a449270 - tokio::coop::with_budget::h3ad72dc3cceae9ea at /home/nimda/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.0/src/coop.rs:95:5 23: 0x55ed7a449270 - tokio::coop::budget::h03a02cae92aed21f at /home/nimda/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.0/src/coop.rs:72:5 24: 0x55ed7a449270 - tokio::park::thread::CachedParkThread::block_on::h874408082e60ddd7 at /home/nimda/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.0/src/park/thread.rs:263:31 25: 0x55ed7a46fbd6 - tokio::runtime::enter::Enter::block_on::h4305445dc37b185e at /home/nimda/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.0/src/runtime/enter.rs:152:13 26: 0x55ed7a401db9 - tokio::runtime::thread_pool::ThreadPool::block_on::hccba8273e8ddd709 at /home/nimda/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.0/src/runtime/thread_pool/mod.rs:90:9 27: 0x55ed7a36f9b5 - tokio::runtime::Runtime::block_on::ha23298339cc46ea6 at /home/nimda/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.20.0/src/runtime/mod.rs:484:43 28: 0x55ed7a4c9f82 - permissionless::main::h48a647e330bcd8a8 at /mnt/storage/Downloads/chamomile/examples/permissionless.rs:60:5 29: 0x55ed7a4bac0b - core::ops::function::FnOnce::call_once::h41fc2f4d7d0022bb at /builddir/build/BUILD/rustc-1.62.0-src/library/core/src/ops/function.rs:248:5 30: 0x55ed7a45852e - std::sys_common::backtrace::__rust_begin_short_backtrace::h96402e75acdc44c7 at /builddir/build/BUILD/rustc-1.62.0-src/library/std/src/sys_common/backtrace.rs:122:18 31: 0x55ed7a405171 - std::rt::lang_start::{{closure}}::h4bbf6843c82df052 at /builddir/build/BUILD/rustc-1.62.0-src/library/std/src/rt.rs:145:18 32: 0x55ed7b47258e - std::rt::lang_start_internal::ha3452024dbd70b60 33: 0x55ed7a405140 - std::rt::lang_start::hbb1c9173ec75aec9 at /builddir/build/BUILD/rustc-1.62.0-src/library/std/src/rt.rs:144:17 34: 0x55ed7a4ca07c - main 35: 0x7f49eb1ab550 - __libc_start_call_main 36: 0x7f49eb1ab609 - __libc_start_main_alias_1 37: 0x55ed7a36f325 - _start 38: 0x0 - ```
sunhuachuang commented 2 years ago

Yeah, that is caused by trace (not work well in the machine), you can comment https://github.com/CympleTech/chamomile/blob/main/examples/permissionless.rs#L6

sunhuachuang commented 1 year ago

I think this can be closed, if still have problems, feel free to reopen.