atom-archive / xray

An experimental next-generation Electron-based text editor
MIT License
8.47k stars 237 forks source link

panic at index out of bounds #171

Open flappyBug opened 5 years ago

flappyBug commented 5 years ago

How to reproduce?

build & run RUST_BACKTRACE=1 XRAY_SRC_PATH=. script/xray ., open xray_ui/lib/app.js with the editor, then panic occurs.

thread 'main' panicked at 'index out of bounds: the len is 29 but the index is 29', libcore/slice/mod.rs:2460:10
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
   1: std::sys_common::backtrace::print
   2: std::panicking::default_hook::{{closure}}
   3: std::panicking::default_hook
   4: std::panicking::rust_panic_with_hook
   5: std::panicking::continue_panic_fmt
   6: rust_begin_unwind
   7: core::panicking::panic_fmt
   8: core::panicking::panic_bounds_check
   9: <xray_core::buffer_view::BufferView as xray_core::window::View>::render
  10: <xray_core::window::WindowUpdateStream as futures::stream::Stream>::poll
  11: <futures::stream::map::Map<S, F> as futures::stream::Stream>::poll
  12: <futures::sink::send_all::SendAll<T, U> as futures::future::Future>::poll
  13: <futures::future::chain::Chain<A, B, C>>::poll
  14: futures::task_impl::std::set
  15: <futures::task_impl::Spawn<T>>::poll_future_notify
  16: tokio::executor::current_thread::CurrentRunner::set_spawn
  17: <tokio::executor::current_thread::scheduler::Scheduler<U>>::tick
  18: <scoped_tls::ScopedKey<T>>::set
  19: <std::thread::local::LocalKey<T>>::with
  20: <std::thread::local::LocalKey<T>>::with
  21: <std::thread::local::LocalKey<T>>::with
  22: tokio_core::reactor::Core::poll
  23: xray_server::main
  24: std::rt::lang_start::{{closure}}
  25: std::panicking::try::do_call
  26: __rust_maybe_catch_panic
  27: std::rt::lang_start_internal
  28: main
chambaw commented 5 years ago

Help