Skip to content
This repository has been archived by the owner on Jul 23, 2019. It is now read-only.

Xray panics when scrolling too fast while editing README.md #156

Open
jasikpark opened this issue Oct 22, 2018 · 7 comments
Open

Xray panics when scrolling too fast while editing README.md #156

jasikpark opened this issue Oct 22, 2018 · 7 comments

Comments

@jasikpark
Copy link

Building on macOS Mojave - 10.14 on a MacBook Pro 2016 13" with Touchbar.

$ XRAY_SRC_PATH=. RUST_BACKTRACE=1 script/xray .
$ thread 'main' panicked at 'index out of bounds: the len is 30 but the index is 30', /Users/travis/build/rust-lang/rust/src/libcore/slice/mod.rs:2049:10
note: Run with `RUST_BACKTRACE=1` for a backtrace.
$ node --version
$ v8.9.3
$ rustc --version
$ rustc 1.30.0-nightly (33b923fd4 2018-08-18)
$ nvm list
$          v8.9.3
$ ->     v10.12.0
$          system
$ default -> node (-> v10.12.0)
$ node -> stable (-> v10.12.0) (default)
$ stable -> 10.12 (-> v10.12.0) (default)
$ iojs -> N/A (default)
$ lts/* -> lts/carbon (-> N/A)
$ lts/argon -> v4.9.1 (-> N/A)
$ lts/boron -> v6.14.4 (-> N/A)
$ lts/carbon -> v8.12.0 (-> N/A)
@jasikpark jasikpark changed the title Xray panics when scrolling too fast when README.md is open. Xray panics when scrolling too fast while editing README.md Oct 22, 2018
@jasikpark
Copy link
Author

In the contributing thing, it said to open a PR if you can, but I'm just dipping my toes into contributing so far, so I have no clue what's going wrong.

@nathansobo
Copy link

That's okay, thanks for the report. We're actually focused in other areas right now and may not be back around to that part of the code for some time, but I'll leave this open.

@jasikpark
Copy link
Author

Could you maybe point me in the general direction of where I could poke around to find the bug?

@nathansobo
Copy link

If you can launch the subprocess with the RUST_BACKTRACE=1 environment variable assignment that would be a good place to start figuring out what's going on. When the Electron app starts, if it doesn't detect the Xray server listening on a domain socket, it launches it here. That could be a good place to fill in that environment variable to get some more insight as to the source of the error. If you post it back I can take a look and help you interpret it. Thanks for your interest.

@jasikpark
Copy link
Author

i’ll try running with RUST_BACKTRACE=1 where the server is started - since running it from build/xray hasn’t showed anything.

@jasikpark jasikpark reopened this Oct 23, 2018
@nathansobo
Copy link

Make sure you're running script/build without the --release flag launching the app with xray_debug to run a development version of the server binary. Otherwise the stack trace will be obfuscated by release optimizations.

@jasikpark
Copy link
Author

Calebs-MacBook-Pro-2:xray calebjasik$ RUST_BACKTRACE=1 XRAY_SRC_PATH=. script/xray_debug .
Calebs-MacBook-Pro-2:xray calebjasik$ thread 'main' panicked at 'index out of bounds: the len is 30 but the index is 30', /Users/travis/build/rust-lang/rust/src/libcore/slice/mod.rs:2049:10
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::print
             at libstd/sys_common/backtrace.rs:71
             at libstd/sys_common/backtrace.rs:59
   2: std::panicking::default_hook::{{closure}}
             at libstd/panicking.rs:211
   3: std::panicking::default_hook
             at libstd/panicking.rs:227
   4: <std::panicking::begin_panic::PanicPayload<A> as core::panic::BoxMeUp>::get
             at libstd/panicking.rs:475
   5: std::panicking::continue_panic_fmt
             at libstd/panicking.rs:390
   6: std::panicking::try::do_call
             at libstd/panicking.rs:325
   7: core::ptr::drop_in_place
             at libcore/panicking.rs:77
   8: core::ptr::drop_in_place
             at libcore/panicking.rs:59
   9: <&'b usize as core::ops::arith::Add<&'a usize>>::add
             at /Users/travis/build/rust-lang/rust/src/libcore/slice/mod.rs:2049
  10: core::num::ptr_try_from_impls::<impl core::convert::TryFrom<usize> for u8>::try_from
             at /Users/travis/build/rust-lang/rust/src/libcore/slice/mod.rs:1917
  11: <std::collections::hash::map::DefaultResizePolicy as core::clone::Clone>::clone
             at /Users/travis/build/rust-lang/rust/src/liballoc/vec.rs:1725
  12: xray_core::buffer_view::BufferView::updated
             at xray_core/src/buffer_view.rs:1018
  13: xray_core::app::ServiceError::WorkspaceNotFound
             at xray_core/src/window.rs:206
  14: <futures::stream::map::Map<S, F> as futures::stream::Stream>::poll
             at /Users/calebjasik/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.21/src/stream/map.rs:78
  15: <futures::stream::map_err::MapErr<S, F> as futures::stream::Stream>::poll
             at /Users/calebjasik/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.21/src/stream/map_err.rs:78
  16: <futures::stream::fuse::Fuse<S> as futures::stream::Stream>::poll
             at /Users/calebjasik/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.21/src/stream/fuse.rs:48
  17: <futures::sink::send_all::SendAll<T, U> as futures::future::Future>::poll
             at /Users/calebjasik/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.21/src/sink/send_all.rs:75
  18: <futures::future::chain::Chain<A, B, C>>::poll
             at /Users/calebjasik/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.21/src/future/chain.rs:26
  19: <futures::future::then::Then<A, B, F> as futures::future::Future>::poll
             at /Users/calebjasik/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.21/src/future/then.rs:32
  20: alloc::alloc::dealloc
             at /Users/calebjasik/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.21/src/future/mod.rs:113
  21: std::sys::unix::mutex::Mutex::destroy
             at /Users/calebjasik/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.21/src/task_impl/mod.rs:289
  22: std::sys::unix::mutex::Mutex::destroy
             at /Users/calebjasik/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.21/src/task_impl/mod.rs:363
  23: futures::task_impl::std::BorrowedUnpark::new
             at /Users/calebjasik/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.21/src/task_impl/std/mod.rs:78
  24: std::sys::unix::mutex::Mutex::destroy
             at /Users/calebjasik/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.21/src/task_impl/mod.rs:363
  25: std::sys::unix::mutex::Mutex::destroy
             at /Users/calebjasik/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-0.1.21/src/task_impl/mod.rs:289
  26: core::ptr::swap_nonoverlapping_bytes
             at /Users/calebjasik/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.1.5/src/executor/current_thread/scheduler.rs:343
  27: core::ptr::swap_nonoverlapping_bytes
             at /Users/calebjasik/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.1.5/src/executor/current_thread/scheduler.rs:323
  28: tokio::executor::current_thread::CURRENT::__init
             at /Users/calebjasik/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.1.5/src/executor/current_thread/mod.rs:657
  29: <tokio::runtime::task_executor::TaskExecutor as core::clone::Clone>::clone
             at /Users/calebjasik/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.1.5/src/executor/current_thread/mod.rs:689
  30: tokio::executor::current_thread::CURRENT::__init
             at /Users/calebjasik/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.1.5/src/executor/current_thread/mod.rs:656
  31: <tokio::runtime::task_executor::TaskExecutor as core::clone::Clone>::clone
             at /Users/travis/build/rust-lang/rust/src/libstd/thread/local.rs:294
  32: <tokio::runtime::task_executor::TaskExecutor as core::clone::Clone>::clone
             at /Users/travis/build/rust-lang/rust/src/libstd/thread/local.rs:248
  33: tokio::executor::current_thread::CURRENT::__init
             at /Users/calebjasik/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.1.5/src/executor/current_thread/mod.rs:655
  34: core::ptr::swap_nonoverlapping_bytes
             at /Users/calebjasik/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.1.5/src/executor/current_thread/scheduler.rs:323
  35: tokio::executor::current_thread::CURRENT::__init
             at /Users/calebjasik/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.1.5/src/executor/current_thread/mod.rs:541
  36: tokio::executor::current_thread::CURRENT::__init
             at /Users/calebjasik/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-0.1.5/src/executor/current_thread/mod.rs:483
  37: tokio_core::reactor::Core::poll::{{closure}}::{{closure}}::{{closure}}::{{closure}}
             at /Users/calebjasik/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.17/src/reactor/mod.rs:298
  38: core::cmp::impls::<impl core::cmp::Ord for usize>::cmp
             at /Users/calebjasik/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-0.1.1/src/lib.rs:155
  39: tokio_core::reactor::Core::poll::{{closure}}::{{closure}}::{{closure}}
             at /Users/calebjasik/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.17/src/reactor/mod.rs:297
  40: <tokio_reactor::Handle as core::clone::Clone>::clone
             at /Users/calebjasik/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-timer-0.2.1/src/timer/handle.rs:64
  41: <tokio::runtime::task_executor::TaskExecutor as core::clone::Clone>::clone
             at /Users/travis/build/rust-lang/rust/src/libstd/thread/local.rs:294
  42: <tokio::runtime::task_executor::TaskExecutor as core::clone::Clone>::clone
             at /Users/travis/build/rust-lang/rust/src/libstd/thread/local.rs:248
  43: <tokio_reactor::Handle as core::clone::Clone>::clone
             at /Users/calebjasik/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-timer-0.2.1/src/timer/handle.rs:56
  44: tokio_core::reactor::Core::poll::{{closure}}::{{closure}}
             at /Users/calebjasik/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.17/src/reactor/mod.rs:275
  45: tokio_reactor::CURRENT_REACTOR::__init
             at /Users/calebjasik/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-executor-0.1.2/src/global.rs:176
  46: <tokio::runtime::task_executor::TaskExecutor as core::clone::Clone>::clone
             at /Users/travis/build/rust-lang/rust/src/libstd/thread/local.rs:294
  47: <tokio::runtime::task_executor::TaskExecutor as core::clone::Clone>::clone
             at /Users/travis/build/rust-lang/rust/src/libstd/thread/local.rs:248
  48: tokio_reactor::CURRENT_REACTOR::__init
             at /Users/calebjasik/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-executor-0.1.2/src/global.rs:150
  49: tokio_core::reactor::Core::poll::{{closure}}
             at /Users/calebjasik/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.17/src/reactor/mod.rs:274
  50: core::ptr::swap_nonoverlapping_bytes
             at /Users/calebjasik/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-reactor-0.1.1/src/lib.rs:207
  51: <tokio::runtime::task_executor::TaskExecutor as core::clone::Clone>::clone
             at /Users/travis/build/rust-lang/rust/src/libstd/thread/local.rs:294
  52: <tokio::runtime::task_executor::TaskExecutor as core::clone::Clone>::clone
             at /Users/travis/build/rust-lang/rust/src/libstd/thread/local.rs:248
  53: core::ptr::swap_nonoverlapping_bytes
             at /Users/calebjasik/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-reactor-0.1.1/src/lib.rs:199
  54: <core::fmt::Arguments<'a> as core::clone::Clone>::clone
             at /Users/calebjasik/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.17/src/reactor/mod.rs:273
  55: tokio_core::reactor::Core::run
             at /Users/calebjasik/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-core-0.1.17/src/reactor/mod.rs:248
  56: xray_server::main
             at xray_server/src/main.rs:51
  57: std::rt::lang_start::{{closure}}
             at /Users/travis/build/rust-lang/rust/src/libstd/rt.rs:74
  58: std::panicking::try::do_call
             at libstd/rt.rs:59
             at libstd/panicking.rs:310
  59: panic_unwind::dwarf::eh::read_encoded_pointer
             at libpanic_unwind/lib.rs:102
  60: std::net::parser::Parser::read_socket_addr::{{closure}}
             at libstd/panicking.rs:289
             at libstd/panic.rs:392
             at libstd/rt.rs:58
  61: std::rt::lang_start
             at /Users/travis/build/rust-lang/rust/src/libstd/rt.rs:74
  62: xray_server::main

here's the backtrace, i'll be looking through it

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants