Skip to content

Panic: Re-org detected, should be non-empty in this scope #2189

@Tomas-M

Description

@Tomas-M

I get this error while running zingo-cli in non-interactive mode (eg. calling with zingo-cli --waitsync messages)
Using current 'stable' branch compiled from sources.

If that helps, I can provide the zingo-wallet.dat file (I have copies of all zingo-wallet.dat files before and after I run zingo-cli, including debug logs, and I can confirm that previous run of zingo-cli successfully ended with standart output - Save task shutdown successfully. Zingo CLI quit successfully.) and the subsequent run always causes this panic. So you can test with the wallet.dat file if you need to debug this.

2026-02-19T17:25:06.606467Z  INFO pepper_sync::sync: Re-org detected.

thread 'tokio-runtime-worker' panicked at /usr/src/zingolib-current/zingolib/pepper-sync/src/sync.rs:1284:10:
should be non-empty in this scope
stack backtrace:
   0:     0x555b33edcac2 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::hdcfcb6d4c8489523
   1:     0x555b33f069e3 - core::fmt::write::h8a494366950f23bb
   2:     0x555b33ed7fd3 - std::io::Write::write_fmt::h6556609fca33d0b1
   3:     0x555b33edc912 - std::sys::backtrace::BacktraceLock::print::hb2a626a81e06b2dc
   4:     0x555b33ede283 - std::panicking::default_hook::{{closure}}::h4f78485264f12d10
   5:     0x555b33ede065 - std::panicking::default_hook::h2c66fc99e962531d
   6:     0x555b33edec95 - std::panicking::rust_panic_with_hook::h33ac55f64bbd807d
   7:     0x555b33edea2a - std::panicking::begin_panic_handler::{{closure}}::h30e7cb89678a57fe
   8:     0x555b33edcfc9 - std::sys::backtrace::__rust_end_short_backtrace::hed60f27456c16ced
   9:     0x555b33ede6bd - __rustc[de2ca18b4c54d5b8]::rust_begin_unwind
  10:     0x555b33f03c20 - core::panicking::panic_fmt::h62f63d096dd276af
  11:     0x555b33f03afb - core::option::expect_failed::h091923fb77e757a1
  12:     0x555b32fe2741 - pepper_sync::sync::truncate_wallet_data::hf2226a2ac1fbc89d
  13:     0x555b32fdc12e - pepper_sync::sync::clear_wallet_data::h3ec28a5e9547513f
  14:     0x555b32fe2279 - pepper_sync::sync::truncate_wallet_data::hf2226a2ac1fbc89d
  15:     0x555b32fdd946 - pepper_sync::sync::process_scan_results::{{closure}}::hefc88dec32c0118f
  16:     0x555b32fe7ad2 - pepper_sync::sync::sync::{{closure}}::hc4d35c81067b895c
  17:     0x555b33020d5a - tokio::runtime::task::core::Core<T,S>::poll::h70eda8f5a4817a95
  18:     0x555b32da4f43 - tokio::runtime::task::raw::poll::h5c3ab6105f3834bc
  19:     0x555b33a98544 - tokio::runtime::scheduler::multi_thread::worker::Context::run_task::h66572328ec30f808
  20:     0x555b33a97a90 - tokio::runtime::scheduler::multi_thread::worker::Context::run::h1fe9ac17058796dc
  21:     0x555b33aaa8a6 - tokio::runtime::context::scoped::Scoped<T>::set::ha9a0bf55efccc784
  22:     0x555b33aaa7de - tokio::runtime::context::runtime::enter_runtime::h1d0e5d625db17f32
  23:     0x555b33a9731d - tokio::runtime::scheduler::multi_thread::worker::run::h35d52f4501a9e956
  24:     0x555b33aa01ad - <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll::haf94fb902865efbe
  25:     0x555b33a9f647 - tokio::runtime::task::core::Core<T,S>::poll::hd685ab8d4e6910c6
  26:     0x555b33a8faf1 - tokio::runtime::task::harness::Harness<T,S>::poll::h978d9813c0198524
  27:     0x555b33a94099 - tokio::runtime::blocking::pool::Inner::run::h292e80295c88a510
  28:     0x555b33aab280 - std::sys::backtrace::__rust_begin_short_backtrace::h9ed294b7c8ed8b5b
  29:     0x555b33aa38c2 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h7a4c144967e490d3
  30:     0x555b33ee1f4f - std::sys::pal::unix::thread::Thread::new::thread_start::hb6e99e73da4d28f8
  31:     0x7fd54c8a31f5 - <unknown>
  32:     0x7fd54c92389c - <unknown>
  33:                0x0 - <unknown>

thread '<unnamed>' panicked at zingolib/src/lightclient/sync.rs:114:47:
task panicked: JoinError::Panic(Id(17), "should be non-empty in this scope", ...)
stack backtrace:
   0:     0x555b33edcac2 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::hdcfcb6d4c8489523
   1:     0x555b33f069e3 - core::fmt::write::h8a494366950f23bb
   2:     0x555b33ed7fd3 - std::io::Write::write_fmt::h6556609fca33d0b1
   3:     0x555b33edc912 - std::sys::backtrace::BacktraceLock::print::hb2a626a81e06b2dc
   4:     0x555b33ede283 - std::panicking::default_hook::{{closure}}::h4f78485264f12d10
   5:     0x555b33ede065 - std::panicking::default_hook::h2c66fc99e962531d
   6:     0x555b33edec95 - std::panicking::rust_panic_with_hook::h33ac55f64bbd807d
   7:     0x555b33edea2a - std::panicking::begin_panic_handler::{{closure}}::h30e7cb89678a57fe
   8:     0x555b33edcfc9 - std::sys::backtrace::__rust_end_short_backtrace::hed60f27456c16ced
   9:     0x555b33ede6bd - __rustc[de2ca18b4c54d5b8]::rust_begin_unwind
  10:     0x555b33f03c20 - core::panicking::panic_fmt::h62f63d096dd276af
  11:     0x555b33f04046 - core::result::unwrap_failed::h95bc3f5a607b2c95
  12:     0x555b333c2ee7 - zingolib::lightclient::sync::<impl zingolib::lightclient::LightClient>::poll_sync::he892ce37462a427b
  13:     0x555b33037968 - <zingo_cli::commands::SyncCommand as zingo_cli::commands::Command>::exec::h234de0e96aaa772e
  14:     0x555b3303cb51 - zingo_cli::commands::do_user_command::h4ea2536e038665db
  15:     0x555b32ddcfb2 - std::sys::backtrace::__rust_begin_short_backtrace::h83b07d504c46a2b9
  16:     0x555b332112e8 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h76ce0ba564601457
  17:     0x555b33ee1f4f - std::sys::pal::unix::thread::Thread::new::thread_start::hb6e99e73da4d28f8
  18:     0x7fd54c8a31f5 - <unknown>
  19:     0x7fd54c92389c - <unknown>
  20:                0x0 - <unknown>

thread 'main' panicked at zingo-cli/src/lib.rs:563:14:
called `Result::unwrap()` on an `Err` value: SendError { .. }
stack backtrace:
   0:     0x555b33edcac2 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::hdcfcb6d4c8489523
   1:     0x555b33f069e3 - core::fmt::write::h8a494366950f23bb
   2:     0x555b33ed7fd3 - std::io::Write::write_fmt::h6556609fca33d0b1
   3:     0x555b33edc912 - std::sys::backtrace::BacktraceLock::print::hb2a626a81e06b2dc
   4:     0x555b33ede283 - std::panicking::default_hook::{{closure}}::h4f78485264f12d10
   5:     0x555b33ede065 - std::panicking::default_hook::h2c66fc99e962531d
   6:     0x555b33edec95 - std::panicking::rust_panic_with_hook::h33ac55f64bbd807d
   7:     0x555b33edea2a - std::panicking::begin_panic_handler::{{closure}}::h30e7cb89678a57fe
   8:     0x555b33edcfc9 - std::sys::backtrace::__rust_end_short_backtrace::hed60f27456c16ced
   9:     0x555b33ede6bd - __rustc[de2ca18b4c54d5b8]::rust_begin_unwind
  10:     0x555b33f03c20 - core::panicking::panic_fmt::h62f63d096dd276af
  11:     0x555b33f04046 - core::result::unwrap_failed::h95bc3f5a607b2c95
  12:     0x555b32d5e93f - zingo_cli::dispatch_command_or_start_interactive::h1059789e0fb1d7ab
  13:     0x555b32d60082 - zingo_cli::run_cli::hb541fcd3a4fe6572
  14:     0x555b32cf1ae5 - zingo_cli::main::h5fe045482b0d2537
  15:     0x555b32cf33e3 - std::sys::backtrace::__rust_begin_short_backtrace::h25058f0d22ca2063
  16:     0x555b32cf0f59 - std::rt::lang_start::{{closure}}::h0c0b0b980401f14f
  17:     0x555b33eceac0 - std::rt::lang_start_internal::h34f9328d113fd60a
  18:     0x555b32cf1b85 - main
  19:     0x7fd54c84124a - <unknown>
  20:     0x7fd54c841305 - __libc_start_main
  21:     0x555b32ce9ba1 - _start
  22:                0x0 - <unknown>

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions