boxdot / gurk-rs

Signal Messenger client for terminal
GNU Affero General Public License v3.0
458 stars 33 forks source link

Crash upon receiving messages #176

Closed h3artbl33d closed 1 month ago

h3artbl33d commented 1 year ago

Hi,

Thank you for this project - wonderful work! I have installed this on OpenBSD. The installation itself went pretty smooth. Linking to the primary device did too and I can send messages. However, gurk crashes as soon as a message is received. Upon restarting gurk it shows only my messages in the conversation, not the received ones. I tried this with 1:1 messaging and in groups.

Although I would like to help debug this issue, there doesn't seem to be logging - and I am (currently) too unfamiliar with rust to create some debugging options myself.

Platform: OpenBSD 7.2-current on amd64
OS version: OpenBSD 7.2-beta (GENERIC.MP) #659: Mon Aug  1 18:25:34 MDT 2022
Rust version: 1.62.0
Gurk version: 
gurk v0.2.5-dev (https://github.com/boxdot/gurk-rs#4b9c454b):
    gurk

Is there anything I can do to help sort this out?

boxdot commented 1 year ago

I could take a look, however I would need some instructions how to run OpenBSD. Is there an easy way for me to run it from within Linux/Fedora?

ruesch commented 3 months ago

I have the same problem with OpenBSD:

OpenBSD 7.5-current (GENERIC.MP) #18: Sun Apr  7 07:53:25 MDT 2024
rustc 1.77.1
gurk 0.4.3

As soon as I receive an incoming message, the client crashes.

2024-04-08T12:10:16.700810Z ERROR panic: thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { kind: Uncategorized, message: "no current exe available (short)" }': /home/cr/.cargo/registry/src/index.crates.io-6f17d22bba15001f/notify-rust-4.11.0/src/notification.rs:24

However, a notify-send from xterm works. According to the error message, there seems to be a problem with notify-rust. However, I have no idea how to debug and fix this. I don't have the knowledge of Rust to do this.

boxdot commented 3 months ago

Look like OpenBSD does not return the name of the current exe (gurk) in this code:

// Returns the name of the current executable, used as a default for `Notification.appname`.
fn exe_name() -> String {
    std::env::current_exe()
        .unwrap()
        .file_name()
        .unwrap()
        .to_str()
        .unwrap()
        .to_owned()
}

Any reason why this is the case on OpenBSD (I never used it myself)?

This seems to be this issue: https://github.com/rust-lang/rust/issues/60560

@ruesch Could you please try to run gurk by specifying relative or absolute path, like ./gurk?

ruesch commented 3 months ago

@ruesch Could you please try to run gurk by specifying relative or absolute path, like ./gurk?

Ha, awesome. :-) With ./gurk from the .cargo/bin directory it now also works with the notification. No more crash. Thanks a lot. I can live and work with that. Finally a working Signal Client under OpenBSD. The workaround via a virtual machine has always been very cumbersome.