MegaAntiCheat / client-backend

GNU General Public License v3.0
118 stars 25 forks source link

Rust panic #96

Closed AfroMonkey closed 8 months ago

AfroMonkey commented 8 months ago

When running cargo run I have a panic error.

I'm not familiar with rust, If I can attach more info, I'll be happy to do it

Install Specs

Sys Specs

Panic Error

$ RUST_BACKTRACE=full cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.06s
warning: the following packages contain code that will be rejected by a future version of Rust: nom v1.2.4
note: to see what the problems were, use the option `--future-incompat-report`, or run `cargo report future-incompatibilities --id 1`
     Running `target/debug/client_backend`
2024-01-06T20:21:17.300664Z  INFO client_backend::settings: Identified current steam user as 76561198027957879
2024-01-06T20:21:17.315837Z  WARN client_backend: Please add the following launch options to your TF2 to allow the MAC client to interface correctly with TF2.
2024-01-06T20:21:17.315852Z  WARN client_backend: Missing launch options: ["-condebug", "-conclearlog", "-usercon", "-g15"]
thread 'main' panicked at src/main.rs:86:25:
Missing required launch options in TF2 for MAC to function. Aborting...

                            (Add the command-line argument '--ignore_launch_opts' to ignore this).
stack backtrace:
   0:     0x55a706916a5c - std::backtrace_rs::backtrace::libunwind::trace::ha637c64ce894333a
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x55a706916a5c - std::backtrace_rs::backtrace::trace_unsynchronized::h47f62dea28e0c88d
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x55a706916a5c - std::sys_common::backtrace::_print_fmt::h9eef0abe20ede486
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x55a706916a5c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hed7f999df88cc644
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x55a706945d40 - core::fmt::rt::Argument::fmt::h1539a9308b8d058d
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/fmt/rt.rs:142:9
   5:     0x55a706945d40 - core::fmt::write::h3a39390d8560d9c9
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/fmt/mod.rs:1120:17
   6:     0x55a7069137bf - std::io::Write::write_fmt::h5fc9997dfe05f882
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/io/mod.rs:1762:15
   7:     0x55a706916844 - std::sys_common::backtrace::_print::h894006fb5c6f3d45
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x55a706916844 - std::sys_common::backtrace::print::h23a2d212c6fff936
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x55a706917ec7 - std::panicking::default_hook::{{closure}}::h8a1d2ee00185001a
  10:     0x55a706917c2f - std::panicking::default_hook::h6038f2eba384e475
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:292:9
  11:     0x55a706918348 - std::panicking::rust_panic_with_hook::h2b5517d590cab22e
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:779:13
  12:     0x55a7069181f9 - std::panicking::begin_panic_handler::{{closure}}::h233112c06e0ef43e
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:649:13
  13:     0x55a706916f26 - std::sys_common::backtrace::__rust_end_short_backtrace::h6e893f24d7ebbff8
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys_common/backtrace.rs:170:18
  14:     0x55a706917f92 - rust_begin_unwind
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:645:5
  15:     0x55a7058bb2d5 - core::panicking::panic_fmt::hbf0e066aabfa482c
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/panicking.rs:72:14
  16:     0x55a705a40c5d - client_backend::main::hc7873a20e058c53f
                               at /home/moy/git/client-backend/src/main.rs:86:25
  17:     0x55a70597ba0b - core::ops::function::FnOnce::call_once::h0d911ea78f6cdf82
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/ops/function.rs:250:5
  18:     0x55a705b2bb5e - std::sys_common::backtrace::__rust_begin_short_backtrace::h1888f84bdfc07f45
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys_common/backtrace.rs:154:18
  19:     0x55a705ac6ca1 - std::rt::lang_start::{{closure}}::h075122f88fc1aaff
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/rt.rs:167:18
  20:     0x55a70690ccf7 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::hd95060ecd5e1ca24
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/ops/function.rs:284:13
  21:     0x55a70690ccf7 - std::panicking::try::do_call::h6e8cf51db32a6e4b
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:552:40
  22:     0x55a70690ccf7 - std::panicking::try::h3a52eefe24fe3c29
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:516:19
  23:     0x55a70690ccf7 - std::panic::catch_unwind::h24c28c23c02c3841
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panic.rs:142:14
  24:     0x55a70690ccf7 - std::rt::lang_start_internal::{{closure}}::h705d3c9cbc06ef47
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/rt.rs:148:48
  25:     0x55a70690ccf7 - std::panicking::try::do_call::ha21f52ba13158470
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:552:40
  26:     0x55a70690ccf7 - std::panicking::try::h5581346bf6aeb1f8
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:516:19
  27:     0x55a70690ccf7 - std::panic::catch_unwind::h7919645a6b72e25b
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panic.rs:142:14
  28:     0x55a70690ccf7 - std::rt::lang_start_internal::h12de51168669836e
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/rt.rs:148:20
  29:     0x55a705ac6c7a - std::rt::lang_start::h75810a667438179d
                               at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/rt.rs:166:17
  30:     0x55a705a436be - main
  31:     0x7ff7ca758cd0 - <unknown>
  32:     0x7ff7ca758d8a - __libc_start_main
  33:     0x55a7058bbc05 - _start
  34:                0x0 - <unknown>
Seercat3160 commented 8 months ago

As shown in the error message (the lines with WARN client_backend), the TF2 launch options required for MAC to work are not detected in your Steam. Make sure you've added them (-condebug -conclearlog -usercon -g15) to your Steam launch options for TF2 and try running the program again. If you have the launch options and you still get the error, please follow up here.

For the maintainers: I believe it should be considered whether in situations like this, the client can be cleanly exited with a message rather than calling a panic!, such as by propagating error types back to the main function.

AfroMonkey commented 8 months ago

I don't think the warning is related, the game wasn't even launched. However, I add the launch options and still have the issue

Conni243 commented 8 months ago

add --ignore_launch_opts after cargo run like this: cargo run --ignore_launch_opts

Other people had the same issue and fixed it using this

AfroMonkey commented 8 months ago

It works, thanks

cargo run -- --ignore_launch_opts