frafra / frakegps

Simulate a simple GPS device with gpsd or geoclue2
https://crates.io/crates/frakegps
GNU General Public License v3.0
26 stars 3 forks source link

Crashes when clicking on the map #23

Closed tfeldmann closed 1 year ago

tfeldmann commented 1 year ago

I tried to run frakegps but got a crash when clicking on the map:

❯ frakegps
2023-03-10 14:58:04.499 frakegps[17684:13594461] -[__NSArrayI UTF8String]: unrecognized selector sent to instance 0x7fe99406dc00
fatal runtime error: Rust cannot catch foreign exceptions
[1]    17684 abort      frakegps

My machine: macOS BigSur 11.7.4

frafra commented 1 year ago

Thanks, for reporting! I will try to have a look at it soon. Have you built it with cargo? Is it a debug build?

tfeldmann commented 1 year ago

I ran cargo install frakegps. Didn't test a debug build so far.

frafra commented 1 year ago

Sorry for the delay :) I just released version 0.2.0. Could you please test it?

tfeldmann commented 1 year ago

No problem :)

2023-07-03 08:36:35.019 frakegps[24724:1747652] -[__NSArrayI UTF8String]: unrecognized selector sent to instance 0x600003dc4820
thread 'main' panicked at 'Uncaught exception <NSException: 0x6000033d7600>', /Users/tf/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wry-0.29.0/src/webview/wkwebview/mod.rs:105:37
stack backtrace:
   0:        0x1044797fc - std::backtrace_rs::backtrace::libunwind::trace::h0a647ce7e8dc2fab
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:        0x1044797fc - std::backtrace_rs::backtrace::trace_unsynchronized::hea920694a2a8ac80
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:        0x1044797fc - std::sys_common::backtrace::_print_fmt::h7b4e20c1da2ebb61
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/sys_common/backtrace.rs:65:5
   3:        0x1044797fc - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h819e9cbdf1a9e730
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/sys_common/backtrace.rs:44:22
   4:        0x104490488 - core::fmt::write::ha5e9bf3131ecb7c0
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/fmt/mod.rs:1254:17
   5:        0x104477388 - std::io::Write::write_fmt::h414ce9994bf17404
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/io/mod.rs:1698:15
   6:        0x104479610 - std::sys_common::backtrace::_print::h28d98f2094da6d1d
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/sys_common/backtrace.rs:47:5
   7:        0x104479610 - std::sys_common::backtrace::print::h8072db0bbd5bcc3d
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/sys_common/backtrace.rs:34:9
   8:        0x10447ab30 - std::panicking::default_hook::{{closure}}::h2c85c5b0c2ede151
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:269:22
   9:        0x10447a8f0 - std::panicking::default_hook::hcf2f70992d02f6fe
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:288:9
  10:        0x10447b008 - std::panicking::rust_panic_with_hook::h023af7f90b47eb8b
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:691:13
  11:        0x10447af3c - std::panicking::begin_panic_handler::{{closure}}::h14283519edc1d634
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:582:13
  12:        0x104479c1c - std::sys_common::backtrace::__rust_end_short_backtrace::hc366c0b0cef5b747
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/sys_common/backtrace.rs:150:18
  13:        0x10447acd0 - rust_begin_unwind
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:578:5
  14:        0x10449b9ac - core::panicking::panic_fmt::h324f50b29db90195
                               at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/panicking.rs:67:14
  15:        0x10440f718 - wry::webview::wkwebview::InnerWebView::new::did_receive::h09f7ce4d82dd1047
  16:        0x1c89d79d4 - <unknown>
fatal runtime error: failed to initiate panic, error 5
zsh: abort      RUST_BACKTRACE=full frakegps
frafra commented 1 year ago

Thank you :) It looks like there is a limitation when passing non-string objects from JavaScript to Rust when using some operating systems. It should be fixed in master now, commit e13e50dbd63f71930fd2e203c4b4ae68d84c3b0. I released a new version as well (0.2.1). Could you please test it?

tfeldmann commented 1 year ago

Current master build works :) Thank you!