magic-wormhole / magic-wormhole.rs

Rust implementation of Magic Wormhole, with new features and enhancements
European Union Public License 1.2
737 stars 81 forks source link

Port forwarding crashes #167

Closed pvonmoradi closed 1 year ago

pvonmoradi commented 2 years ago

wormhole-rs forward connect crashes between peers: Ubuntu x64 and Android aarch64, both using version 0.5 of wormhole-rs.

RUST_BACKTRACE=1 wormhole-rs forward open
[WARN ] This is an unstable feature. Make sure that your peer is running the exact same version of the program as you.
[INFO ] Connected to rendezvous server.
[INFO ] Code copied to clipboard

This wormhole's code is: [xxx]
On the other computer, please run: [xxx]

wormhole forward connect 

[INFO ] Found peer on the rendezvous server.
The application panicked (crashed).
Message:  You may only use a Wormhole instance with the correct AppVersion type!
Location: /home/ubuntu/magic-wormhole.rs/src/forwarding.rs:146

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                ⋮ 7 frames hidden ⋮
   8: core::panicking::panic_display::a
      at <unknown source file>:<unknown line>
   9: core::panicking::panic_str::b
      at <unknown source file>:<unknown line>
  10: core::option::expect_failed::c
      at <unknown source file>:<unknown line>
  11: magic_wormhole::forwarding::serve::{{closure}}::d
      at <unknown source file>:<unknown line>
  12: std::thread::local::LocalKey<T>::with::e
      at <unknown source file>:<unknown line>
  13: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::f
      at <unknown source file>:<unknown line>
  14: async_task::raw::RawTask<F,T,S>::run::g
      at <unknown source file>:<unknown line>
  15: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h
      at <unknown source file>:<unknown line>
  16: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::i
      at <unknown source file>:<unknown line>
  17: async_io::driver::block_on::j
      at <unknown source file>:<unknown line>
  18: async_global_executor::threading::thread_main_loop::k
      at <unknown source file>:<unknown line>
  19: std::sys_common::backtrace::__rust_begin_short_backtrace::l
      at <unknown source file>:<unknown line>
  20: core::ops::function::FnOnce::call_once{{vtable.shim}}::m
      at <unknown source file>:<unknown line>
  21: std::sys::unix::thread::Thread::new::thread_start::n
      at <unknown source file>:<unknown line>
  22: start_thread<unknown>
      at /build/glibc-CVJwZb/glibc-2.27/nptl/pthread_create.c:463
  23: clone<unknown>
      at /build/glibc-CVJwZb/glibc-2.27/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Tested both ways.

piegamesde commented 2 years ago

Wow, that's a weird one. I looked at the relevant code and there is no apparent reason why it should fail like this. Just to make sure I understand the error:

Is that correct?

pvonmoradi commented 2 years ago

The crash always happens on the Android side

No, it happens on both sides.

Port forwarding Ubuntu<->Ubuntu works fine

No, I just tested with two terminal on same machine. Same crash.

piegamesde commented 2 years ago

Ah, okay. I tried it out and could reproduce it. This should be a lot easier to debug than what I initially feared ^^

piegamesde commented 2 years ago

Oh well, what a stupid bug. Please try out #170, it should work now