Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intermittent Panic when connecting to Websockets server after refresh #26977

Closed
KallynGowdy opened this issue Jun 18, 2020 · 5 comments
Closed

Intermittent Panic when connecting to Websockets server after refresh #26977

KallynGowdy opened this issue Jun 18, 2020 · 5 comments

Comments

@KallynGowdy
Copy link
Contributor

@KallynGowdy KallynGowdy commented Jun 18, 2020

Details

Servo sometimes crashes during a WebSockets connection to a Socket.io server. In particular, it seems to happen during a reload and not during a fresh start.

Might be related to #26097 (comment), but I'm not sure.

Error Message:

index out of bounds: the len is 0 but the index is 7992 (thread LayoutThread PipelineId { namespace_id: PipelineNamespaceId(1), index: PipelineIndex(2) }, at /Users/kallyngowdy/.cargo/registry/src/github.com-1ecc6299db9ec823/addr2line-0.12.1/src/lib.rs:995)

Reproduction Steps

  1. Clone this repo: https://github.com/casual-simulation/casualos
    • git clone https://github.com/casual-simulation/casualos
  2. Checkout the servo-fixes branch.
    • cd casualos
    • git checkout servo-fixes
  3. Follow the setup instructions in DEVELOPERS.md
    • i.e. Basic Node.js setup with Docker.
  4. Run the server.
    • npm run watch
  5. Open a new terminal and go to your servo folder.
  6. Open servo to http://localhost:3000
    • ./mach run http://localhost:3000 --devtools 6000
  7. Wait for it to finish loading.
    • You should see a dark blue background with a wireframe cube in the middle.
    • Clicking around will move the cube around.
  8. Click the wireframe cube.
  9. Select "Blank Bot" from the menu.
  10. Drag the white cube out of the wireframe cube.
  11. Refresh the page.
    • There seems to be a separate issue where refreshing the screen without interacting with the page will cause the Layout thread to be lost.
      • Layout thread disconnected.: "SendError(..)" (thread ScriptThread PipelineId { namespace_id: PipelineNamespaceId(1), index: PipelineIndex(1) }, at components/script/dom/window.rs:1699)
    • That is why steps 8, 9, and 10 exist.
  12. The error should happen.

System Details

Operating System: MacOS 10.15.4

Servo Version: 1b55ab5

Rustc Version: rustc 1.45.0-nightly (a74d1862d 2020-05-14)

Logs

Crash Logs
called `Result::unwrap()` on an `Err` value: () (thread <unnamed>, at components/script/dom/websocket.rs:233)
   0: backtrace::backtrace::libunwind::trace
             at /Users/kallyngowdy/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.49/src/backtrace/libunwind.rs:95
      backtrace::backtrace::trace_unsynchronized
             at /Users/kallyngowdy/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.49/src/backtrace/mod.rs:66
   1: <servo::backtrace::Print as core::fmt::Debug>::fmt
             at /Users/kallyngowdy/YetiCode/servo/ports/winit/backtrace.rs:49
   2: core::fmt::write
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libcore/fmt/mod.rs:1069
   3: std::io::Write::write_fmt
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/io/mod.rs:1537
   4: servo::backtrace::print
             at /Users/kallyngowdy/YetiCode/servo/ports/winit/backtrace.rs:17
   5: servo::main::{{closure}}
             at /Users/kallyngowdy/YetiCode/servo/ports/winit/main2.rs:166
   6: std::panicking::rust_panic_with_hook
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/panicking.rs:481
   7: rust_begin_unwind
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/panicking.rs:385
   8: core::panicking::panic_fmt
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libcore/panicking.rs:89
   9: core::option::expect_none_failed
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libcore/option.rs:1272
  10: core::result::Result<T,E>::unwrap
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libcore/result.rs:1005
  11: script::dom::websocket::WebSocket::Constructor::{{closure}}
             at /Users/kallyngowdy/YetiCode/servo/components/script/dom/websocket.rs:233
  12: <alloc::boxed::Box<F> as core::ops::function::FnMut<A>>::call_mut
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/liballoc/boxed.rs:1041
  13: ipc_channel::router::Router::run
             at /Users/kallyngowdy/.cargo/registry/src/github.com-1ecc6299db9ec823/ipc-channel-0.14.1/src/router.rs:198
  14: ipc_channel::router::RouterProxy::new::{{closure}}
             at /Users/kallyngowdy/.cargo/registry/src/github.com-1ecc6299db9ec823/ipc-channel-0.14.1/src/router.rs:50
  15: std::sys_common::backtrace::__rust_begin_short_backtrace
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/sys_common/backtrace.rs:130
  16: std::thread::Builder::spawn_unchecked::{{closure}}::{{closure}}
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/thread/mod.rs:475
  17: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/panic.rs:318
  18: std::panicking::try::do_call
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/panicking.rs:297
  19: ___rust_try
  20: std::panicking::try
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/panicking.rs:274
  21: std::panic::catch_unwind
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/panic.rs:394
  22: std::thread::Builder::spawn_unchecked::{{closure}}
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/thread/mod.rs:474
  23: core::ops::function::FnOnce::call_once{{vtable.shim}}
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libcore/ops/function.rs:232
  24: <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/liballoc/boxed.rs:1034
      <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/liballoc/boxed.rs:1034
      std::sys::unix::thread::Thread::new::thread_start
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/sys/unix/thread.rs:87
  25: __pthread_start
[2020-06-18T16:43:29Z ERROR servo] called `Result::unwrap()` on an `Err` value: ()
Unexpected script channel panic in constellation: RecvError (thread Constellation, at /Users/kallyngowdy/YetiCode/servo/components/constellation/constellation.rs:1364)
   0: backtrace::backtrace::libunwind::trace
             at /Users/kallyngowdy/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.49/src/backtrace/libunwind.rs:95
      backtrace::backtrace::trace_unsynchronized
             at /Users/kallyngowdy/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.49/src/backtrace/mod.rs:66
   1: <servo::backtrace::Print as core::fmt::Debug>::fmt
             at /Users/kallyngowdy/YetiCode/servo/ports/winit/backtrace.rs:49
   2: core::fmt::write
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libcore/fmt/mod.rs:1069
   3: std::io::Write::write_fmt
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/io/mod.rs:1537
   4: servo::backtrace::print
             at /Users/kallyngowdy/YetiCode/servo/ports/winit/backtrace.rs:17
   5: servo::main::{{closure}}
             at /Users/kallyngowdy/YetiCode/servo/ports/winit/main2.rs:166
   6: std::panicking::rust_panic_with_hook
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/panicking.rs:481
   7: rust_begin_unwind
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/panicking.rs:385
   8: core::panicking::panic_fmt
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libcore/panicking.rs:89
   9: core::option::expect_none_failed
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libcore/option.rs:1272
  10: core::result::Result<T,E>::expect
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libcore/result.rs:963
  11: constellation::constellation::Constellation<Message,LTF,STF,SWF>::handle_request
             at /Users/kallyngowdy/YetiCode/servo/components/constellation/constellation.rs:1364
  12: constellation::constellation::Constellation<Message,LTF,STF,SWF>::run
             at /Users/kallyngowdy/YetiCode/servo/components/constellation/constellation.rs:961
  13: constellation::constellation::Constellation<Message,LTF,STF,SWF>::start::{{closure}}
             at /Users/kallyngowdy/YetiCode/servo/components/constellation/constellation.rs:948
  14: std::sys_common::backtrace::__rust_begin_short_backtrace
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/sys_common/backtrace.rs:130
  15: std::thread::Builder::spawn_unchecked::{{closure}}::{{closure}}
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/thread/mod.rs:475
  16: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/panic.rs:318
  17: std::panicking::try::do_call
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/panicking.rs:297
  18: ___rust_try
  19: std::panicking::try
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/panicking.rs:274
  20: std::panic::catch_unwind
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/panic.rs:394
  21: std::thread::Builder::spawn_unchecked::{{closure}}
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/thread/mod.rs:474
  22: core::ops::function::FnOnce::call_once{{vtable.shim}}
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libcore/ops/function.rs:232
  23: <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/liballoc/boxed.rs:1034
      <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/liballoc/boxed.rs:1034
      std::sys::unix::thread::Thread::new::thread_start
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/sys/unix/thread.rs:87
  24: __pthread_start
called `Result::unwrap()` on an `Err` value: RecvError (thread LayoutThread PipelineId { namespace_id: PipelineNamespaceId(1), index: PipelineIndex(2) }, at components/layout_thread/lib.rs:679)
[2020-06-18T16:43:30Z ERROR servo] Unexpected script channel panic in constellation: RecvError
   0: backtrace::backtrace::libunwind::trace
             at /Users/kallyngowdy/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.49/src/backtrace/libunwind.rs:95
      backtrace::backtrace::trace_unsynchronized
             at /Users/kallyngowdy/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.49/src/backtrace/mod.rs:66
   1: <servo::backtrace::Print as core::fmt::Debug>::fmt
             at /Users/kallyngowdy/YetiCode/servo/ports/winit/backtrace.rs:49
   2: core::fmt::write
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libcore/fmt/mod.rs:1069
   3: std::io::Write::write_fmt
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/io/mod.rs:1537
   4: servo::backtrace::print
             at /Users/kallyngowdy/YetiCode/servo/ports/winit/backtrace.rs:17
   5: servo::main::{{closure}}
             at /Users/kallyngowdy/YetiCode/servo/ports/winit/main2.rs:166
   6: std::panicking::rust_panic_with_hook
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/panicking.rs:481
   7: rust_begin_unwind
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/panicking.rs:385
   8: core::panicking::panic_fmt
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libcore/panicking.rs:89
   9: core::option::expect_none_failed
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libcore/option.rs:1272
index out of bounds: the len is 0 but the index is 7992 (thread LayoutThread PipelineId { namespace_id: PipelineNamespaceId(1), index: PipelineIndex(2) }, at /Users/kallyngowdy/.cargo/registry/src/github.com-1ecc6299db9ec823/addr2line-0.12.1/src/lib.rs:995)
   0: backtrace::backtrace::libunwind::trace
             at /Users/kallyngowdy/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.49/src/backtrace/libunwind.rs:95
      backtrace::backtrace::trace_unsynchronized
             at /Users/kallyngowdy/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.49/src/backtrace/mod.rs:66
   1: <servo::backtrace::Print as core::fmt::Debug>::fmt
             at /Users/kallyngowdy/YetiCode/servo/ports/winit/backtrace.rs:49
   2: core::fmt::write
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libcore/fmt/mod.rs:1069
   3: std::io::Write::write_fmt
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/io/mod.rs:1537
   4: servo::backtrace::print
             at /Users/kallyngowdy/YetiCode/servo/ports/winit/backtrace.rs:17
   5: servo::main::{{closure}}
             at /Users/kallyngowdy/YetiCode/servo/ports/winit/main2.rs:166
   6: std::panicking::rust_panic_with_hook
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/panicking.rs:481
   7: rust_begin_unwind
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/panicking.rs:385
   8: core::panicking::panic_fmt
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libcore/panicking.rs:89
   9: core::panicking::panic_bounds_check
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libcore/panicking.rs:65
  10: <usize as core::slice::SliceIndex<[T]>>::index
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libcore/slice/mod.rs:2872
  11: core::slice::<impl core::ops::index::Index<I> for [T]>::index
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libcore/slice/mod.rs:2732
  12: <alloc::vec::Vec<T> as core::ops::index::Index<I>>::index
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/liballoc/vec.rs:1945
  13: addr2line::FrameIter<R>::next
             at /Users/kallyngowdy/.cargo/registry/src/github.com-1ecc6299db9ec823/addr2line-0.12.1/src/lib.rs:995
  14: backtrace::symbolize::gimli::resolve::{{closure}}
             at /Users/kallyngowdy/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.49/src/symbolize/gimli.rs:555
  15: backtrace::symbolize::gimli::Cache::with_global
             at /Users/kallyngowdy/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.49/src/symbolize/gimli.rs:461
  16: backtrace::symbolize::gimli::resolve
             at /Users/kallyngowdy/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.49/src/symbolize/gimli.rs:541
  17: backtrace::symbolize::resolve_frame_unsynchronized
             at /Users/kallyngowdy/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.49/src/symbolize/mod.rs:178
  18: <servo::backtrace::Print as core::fmt::Debug>::fmt::{{closure}}
             at /Users/kallyngowdy/YetiCode/servo/ports/winit/backtrace.rs:58
  19: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libcore/ops/function.rs:274
  20: backtrace::backtrace::libunwind::trace::trace_fn
             at /Users/kallyngowdy/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.49/src/backtrace/libunwind.rs:107
  21: __Unwind_Backtrace
  22: backtrace::backtrace::libunwind::trace
             at /Users/kallyngowdy/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.49/src/backtrace/libunwind.rs:95
      backtrace::backtrace::trace_unsynchronized
             at /Users/kallyngowdy/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.49/src/backtrace/mod.rs:66
  23: <servo::backtrace::Print as core::fmt::Debug>::fmt
             at /Users/kallyngowdy/YetiCode/servo/ports/winit/backtrace.rs:49
  24: core::fmt::write
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libcore/fmt/mod.rs:1069
  25: std::io::Write::write_fmt
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/io/mod.rs:1537
  26: servo::backtrace::print
             at /Users/kallyngowdy/YetiCode/servo/ports/winit/backtrace.rs:17
  27: servo::main::{{closure}}
             at /Users/kallyngowdy/YetiCode/servo/ports/winit/main2.rs:166
  28: std::panicking::rust_panic_with_hook
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/panicking.rs:481
  29: rust_begin_unwind
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/panicking.rs:385
  30: core::panicking::panic_fmt
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libcore/panicking.rs:89
  31: core::option::expect_none_failed
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libcore/option.rs:1272
  32: core::result::Result<T,E>::unwrap
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libcore/result.rs:1005
  33: layout_thread::LayoutThread::handle_request
             at /Users/kallyngowdy/YetiCode/servo/components/layout_thread/lib.rs:679
  34: layout_thread::LayoutThread::start
             at /Users/kallyngowdy/YetiCode/servo/components/layout_thread/lib.rs:595
  35: <layout_thread::LayoutThread as layout_traits::LayoutThreadFactory>::create::{{closure}}::{{closure}}
             at /Users/kallyngowdy/YetiCode/servo/components/layout_thread/lib.rs:342
  36: profile_traits::mem::ProfilerChan::run_with_memory_reporting
             at /Users/kallyngowdy/YetiCode/servo/components/profile_traits/mem.rs:88
  37: <layout_thread::LayoutThread as layout_traits::LayoutThreadFactory>::create::{{closure}}
             at /Users/kallyngowdy/YetiCode/servo/components/layout_thread/lib.rs:340
  38: std::sys_common::backtrace::__rust_begin_short_backtrace
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/sys_common/backtrace.rs:130
  39: std::thread::Builder::spawn_unchecked::{{closure}}::{{closure}}
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/thread/mod.rs:475
  40: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/panic.rs:318
  41: std::panicking::try::do_call
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/panicking.rs:297
  42: ___rust_try
  43: std::panicking::try
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/panicking.rs:274
  44: std::panic::catch_unwind
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/panic.rs:394
  45: std::thread::Builder::spawn_unchecked::{{closure}}
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/thread/mod.rs:474
  46: core::ops::function::FnOnce::call_once{{vtable.shim}}
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libcore/ops/function.rs:232
  47: <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/liballoc/boxed.rs:1034
      <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/liballoc/boxed.rs:1034
      std::sys::unix::thread::Thread::new::thread_start
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/sys/unix/thread.rs:87
  48: __pthread_start
[2020-06-18T16:43:31Z ERROR servo] index out of bounds: the len is 0 but the index is 7992
thread panicked while panicking. aborting.
Stack trace for thread "LayoutThread PipelineId { namespace_id: PipelineNamespaceId(1), index: PipelineIndex(2) }"
   0: backtrace::backtrace::libunwind::trace
             at /Users/kallyngowdy/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.49/src/backtrace/libunwind.rs:95
      backtrace::backtrace::trace_unsynchronized
             at /Users/kallyngowdy/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.49/src/backtrace/mod.rs:66
   1: <servo::backtrace::Print as core::fmt::Debug>::fmt
             at /Users/kallyngowdy/YetiCode/servo/ports/winit/backtrace.rs:49
   2: core::fmt::write
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libcore/fmt/mod.rs:1069
   3: std::io::Write::write_fmt
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/io/mod.rs:1537
   4: servo::backtrace::print
             at /Users/kallyngowdy/YetiCode/servo/ports/winit/backtrace.rs:17
   5: servo::install_crash_handler::handler
             at /Users/kallyngowdy/YetiCode/servo/ports/winit/main2.rs:67
   6: __sigtramp
   7: std::panicking::rust_panic_with_hook
   8: rust_begin_unwind
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/panicking.rs:385
   9: core::panicking::panic_fmt
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libcore/panicking.rs:89
  10: core::panicking::panic_bounds_check
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libcore/panicking.rs:65
  11: <usize as core::slice::SliceIndex<[T]>>::index
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libcore/slice/mod.rs:2872
  12: core::slice::<impl core::ops::index::Index<I> for [T]>::index
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libcore/slice/mod.rs:2732
  13: <alloc::vec::Vec<T> as core::ops::index::Index<I>>::index
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/liballoc/vec.rs:1945
  14: addr2line::FrameIter<R>::next
             at /Users/kallyngowdy/.cargo/registry/src/github.com-1ecc6299db9ec823/addr2line-0.12.1/src/lib.rs:995
  15: backtrace::symbolize::gimli::resolve::{{closure}}
             at /Users/kallyngowdy/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.49/src/symbolize/gimli.rs:555
  16: backtrace::symbolize::gimli::Cache::with_global
             at /Users/kallyngowdy/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.49/src/symbolize/gimli.rs:461
  17: backtrace::symbolize::gimli::resolve
             at /Users/kallyngowdy/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.49/src/symbolize/gimli.rs:541
  18: backtrace::symbolize::resolve_frame_unsynchronized
             at /Users/kallyngowdy/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.49/src/symbolize/mod.rs:178
  19: <servo::backtrace::Print as core::fmt::Debug>::fmt::{{closure}}
             at /Users/kallyngowdy/YetiCode/servo/ports/winit/backtrace.rs:58
  20: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libcore/ops/function.rs:274
  21: backtrace::backtrace::libunwind::trace::trace_fn
             at /Users/kallyngowdy/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.49/src/backtrace/libunwind.rs:107
  22: __Unwind_Backtrace
  23: backtrace::backtrace::libunwind::trace
             at /Users/kallyngowdy/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.49/src/backtrace/libunwind.rs:95
      backtrace::backtrace::trace_unsynchronized
             at /Users/kallyngowdy/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.49/src/backtrace/mod.rs:66
  24: <servo::backtrace::Print as core::fmt::Debug>::fmt
             at /Users/kallyngowdy/YetiCode/servo/ports/winit/backtrace.rs:49
  25: core::fmt::write
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libcore/fmt/mod.rs:1069
  26: std::io::Write::write_fmt
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/io/mod.rs:1537
  27: servo::backtrace::print
             at /Users/kallyngowdy/YetiCode/servo/ports/winit/backtrace.rs:17
  28: servo::main::{{closure}}
             at /Users/kallyngowdy/YetiCode/servo/ports/winit/main2.rs:166
  29: std::panicking::rust_panic_with_hook
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/panicking.rs:481
  30: rust_begin_unwind
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/panicking.rs:385
  31: core::panicking::panic_fmt
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libcore/panicking.rs:89
  32: core::option::expect_none_failed
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libcore/option.rs:1272
  33: core::result::Result<T,E>::unwrap
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libcore/result.rs:1005
  34: layout_thread::LayoutThread::handle_request
             at /Users/kallyngowdy/YetiCode/servo/components/layout_thread/lib.rs:679
  35: layout_thread::LayoutThread::start
             at /Users/kallyngowdy/YetiCode/servo/components/layout_thread/lib.rs:595
  36: <layout_thread::LayoutThread as layout_traits::LayoutThreadFactory>::create::{{closure}}::{{closure}}
             at /Users/kallyngowdy/YetiCode/servo/components/layout_thread/lib.rs:342
  37: profile_traits::mem::ProfilerChan::run_with_memory_reporting
             at /Users/kallyngowdy/YetiCode/servo/components/profile_traits/mem.rs:88
  38: <layout_thread::LayoutThread as layout_traits::LayoutThreadFactory>::create::{{closure}}
             at /Users/kallyngowdy/YetiCode/servo/components/layout_thread/lib.rs:340
  39: std::sys_common::backtrace::__rust_begin_short_backtrace
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/sys_common/backtrace.rs:130
  40: std::thread::Builder::spawn_unchecked::{{closure}}::{{closure}}
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/thread/mod.rs:475
  41: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/panic.rs:318
  42: std::panicking::try::do_call
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/panicking.rs:297
  43: ___rust_try
  44: std::panicking::try
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/panicking.rs:274
  45: std::panic::catch_unwind
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/panic.rs:394
  46: std::thread::Builder::spawn_unchecked::{{closure}}
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/thread/mod.rs:474
  47: core::ops::function::FnOnce::call_once{{vtable.shim}}
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libcore/ops/function.rs:232
  48: <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/liballoc/boxed.rs:1034
      <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/liballoc/boxed.rs:1034
      std::sys::unix::thread::Thread::new::thread_start
             at /rustc/a74d1862d4d87a56244958416fd05976c58ca1a8/src/libstd/sys/unix/thread.rs:87
  49: __pthread_start
Servo exited with return value 4
@jdm
Copy link
Member

@jdm jdm commented Jun 18, 2020

I tried to follow those steps and ended up with:

Error: ENOENT: no such file or directory, stat '/Users/jdm/src/casualos/src/aux-server/aux-web/dist/player.html'

when loading localhost:3000 in Firefox.

@KallynGowdy
Copy link
Contributor Author

@KallynGowdy KallynGowdy commented Jun 18, 2020

@jdm that will happen if the front-end build hasn't finished yet. It's a big project, so it might take a bit. You'll see a bunch of reloads and then a big output asset list which should include player.html.

@jdm
Copy link
Member

@jdm jdm commented Jun 18, 2020

My mistake, I forgot to set up the docker file sharing. I'm seeing something that looks like content now.

@jdm jdm added the C-reproduced label Jun 18, 2020
@jdm
Copy link
Member

@jdm jdm commented Jun 18, 2020

This looks like a straightforward fix, which I'm in the process of testing: this code runs off the script thread, and shouldn't make any assumptions that the thread it wants to send events to is still alive. The unwrap calls aren't appropriate there and are causing a panic, which ends up bringing down the rest of the browser in a cascade.

@jdm
Copy link
Member

@jdm jdm commented Jun 18, 2020

diff --git a/components/script/dom/websocket.rs b/components/script/dom/websocket.rs
index 89aeda77eb..9d2f6c5dd3 100644
--- a/components/script/dom/websocket.rs
+++ b/components/script/dom/websocket.rs
@@ -68,7 +68,7 @@ mod close_code {
     pub const TLS_FAILED: u16 = 1015;
 }
 
-pub fn close_the_websocket_connection(
+fn close_the_websocket_connection(
     address: Trusted<WebSocket>,
     task_source: &WebsocketTaskSource,
     canceller: &TaskCanceller,
@@ -81,12 +81,11 @@ pub fn close_the_websocket_connection(
         code: code,
         reason: Some(reason),
     };
-    task_source
-        .queue_with_canceller(close_task, &canceller)
-        .unwrap();
+    let _ = task_source
+        .queue_with_canceller(close_task, &canceller);
 }
 
-pub fn fail_the_websocket_connection(
+fn fail_the_websocket_connection(
     address: Trusted<WebSocket>,
     task_source: &WebsocketTaskSource,
     canceller: &TaskCanceller,
@@ -97,9 +96,8 @@ pub fn fail_the_websocket_connection(
         code: Some(close_code::ABNORMAL),
         reason: None,
     };
-    task_source
-        .queue_with_canceller(close_task, &canceller)
-        .unwrap();
+    let _ = task_source
+        .queue_with_canceller(close_task, &canceller);
 }
 
 #[dom_struct]
@@ -221,18 +219,16 @@ impl WebSocket {
                         address: address.clone(),
                         protocol_in_use,
                     };
-                    task_source
-                        .queue_with_canceller(open_thread, &canceller)
-                        .unwrap();
+                    let _ = task_source
+                        .queue_with_canceller(open_thread, &canceller);
                 },
                 WebSocketNetworkEvent::MessageReceived(message) => {
                     let message_thread = MessageReceivedTask {
                         address: address.clone(),
                         message: message,
                     };
-                    task_source
-                        .queue_with_canceller(message_thread, &canceller)
-                        .unwrap();
+                    let _ = task_source
+                        .queue_with_canceller(message_thread, &canceller);
                 },
                 WebSocketNetworkEvent::Fail => {
                     fail_the_websocket_connection(address.clone(), &task_source, &canceller);

This makes the panic disappear for me, and gives me a page I can interact with after reloading. I'm going to try to write an automated test that tickles this as well.

@jdm jdm self-assigned this Jun 18, 2020
@jdm jdm added the C-has-patch label Jun 18, 2020
@jdm jdm mentioned this issue Jun 19, 2020
4 of 4 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants
You can’t perform that action at this time.