daa84 / neovim-lib

Rust library for Neovim clients
GNU Lesser General Public License v3.0
192 stars 26 forks source link

Lib panics on `find_sender` method #38

Open DrBluefall opened 4 years ago

DrBluefall commented 4 years ago

Here's the stacktrace:

[Neocord] ERR (channel 3/stderr):   File "rust:src/libcore/macros/mod.rs", line 15, in core::option::Option<T>::unwrap
  File "/Users/prismarine/.cargo/registry/src/github.com-1ecc6299db9ec823/neovim-lib-0.6.1/src/rpc/client.rs", line 292, in neovim_lib::rpc::client::find_sender
    let pos = queue.iter().position(|req| req.0 == msgid).unwrap();
  File "/Users/prismarine/.cargo/registry/src/github.com-1ecc6299db9ec823/neovim-lib-0.6.1/src/rpc/client.rs", line 270, in neovim_lib::rpc::client::Client<R,W>::dispatch_thread::{{closure}}
    let sender = find_sender(&queue, msgid);
  File "rust:src/libstd/sys_common/backtrace.rs", line 136, in std::sys_common::backtrace::__rust_begin_short_backtrace
  File "rust:src/libstd/thread/mod.rs", line 469, in std::thread::Builder::spawn_unchecked::{{closure}}::{{closure}}
  File "rust:src/libstd/panic.rs", line 318, in <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
  File "rust:src/libstd/panicking.rs", line 292, in std::panicking::try::do_call
  File "src/libpanic_unwind/lib.rs", line 78, in __rust_maybe_catch_panic
  File "rust:src/libstd/panicking.rs", line 270, in std::panicking::try
  File "rust:src/libstd/panic.rs", line 394, in std::panic::catch_unwind
  File "rust:src/libstd/thread/mod.rs", line 468, in std::thread::Builder::spawn_unchecked::{{closure}}
  File "rust:src/libcore/ops/function.rs", line 232, in core::ops::function::FnOnce::call_once{{vtable.shim}}
  File "rust:src/liballoc/boxed.rs", line 1022, in <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once
  File "rust:src/liballoc/boxed.rs", line 1022, in <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once
  File "src/libstd/sys_common/thread.rs", line 13, in std::sys_common::thread::start_thread
  File "src/libstd/sys/unix/thread.rs", line 80, in std::sys::unix::thread::Thread::new::thread_start
  File "<unknown>", line 0, in <unknown>

The application panicked (crashed).
  called `Option::unwrap()` on a `None` value
in rust:src/libcore/macros/mod.rs, line 15
thread: <unnamed>

Code to duplicate can be seen at my plugin repository: https://github.com/DrBluefall/Neocord

Rust ver.: 1.41.0-nightly