Chleba / netscanner

Terminal Network scanner & diagnostic tool with modern TUI
MIT License
865 stars 20 forks source link

crash: called `Option::unwrap()` on a `None` value #6

Closed glitsj16 closed 8 months ago

glitsj16 commented 8 months ago

Hi, I noticed this package entering the AUR and gave it a try. I needed to change from stable to nightly channel to build netscanner. Obviously nothing needed changing using the netscanner-bin package.

But on both the app crashes with the below report:

$ cat netscanner.crash.report ``` "name" = "netscanner" "operating_system" = "Arch Linux Rolling Release [64-bit]" "crate_version" = "0.4.0" "explanation" = """ Panic occurred in file 'src/components/interfaces.rs' at line 103 """ "cause" = "called `Option::unwrap()` on a `None` value" "method" = "Panic" "backtrace" = """ 0: 0x5b9aca5ac5f3 - 1: 0x5b9aca5ac486 - 2: 0x5b9aca718517 - 3: 0x5b9aca71928e - 4: 0x5b9aca73660f - 5: 0x5b9aca732eaf - 6: 0x5b9aca6b7a0d - 7: 0x5b9aca6b8e4f - 8: 0x5b9aca6bad6d - 9: 0x5b9aca6b2ef8 - 10: 0x5b9aca6b2638 - 11: 0x5b9aca6b2a6a - 12: 0x5b9aca7a1666 - 13: 0x5b9aca7a0bda - 14: 0x5b9aca8222b1 - 15: 0x5b9aca7b99a8 - 16: 0x5b9aca851644 - 17: 0x5b9aca851593 - 18: 0x5b9aca8518e2 - 19: 0x5b9acbd57791 - 20: 0x5b9aca8518b6 - 21: 0x5b9aca7b726d - 22: 0x7b6d8c4bbcd0 - 23: 0x7b6d8c4bbd8a - __libc_start_main 24: 0x5b9aca5acd85 - 25: 0x0 - """ ```

Hope you can figure out what went wrong. Feel free to ping if I can present anything else that can help debugging. I use iwd BTW.

Chleba commented 8 months ago

Hi, Thank You for opening this Issue. netscanner is using external third-party applications for getting WiFi information. For Linux iw and for MacOS airport. I will try to implement a parsing case for iwd but now you may try to make an alias for iwd to iw. That may help for now. In the future, I will make better parsing and handling errors from parsing those outputs. In the next version of course.

Chleba commented 8 months ago

Added a fix for handling unwrapping parsed values for interfaces in this commit - https://github.com/Chleba/netscanner/commit/cd1f1f3ddce9fd1bcc00e7edaa37106a3e4a1021. Hopefully, that will help.

glitsj16 commented 8 months ago

try to make an alias for iwd to iw

iw is already present on Arch Linux:

$ pacman -Q iw
iw 6.7-1

It's this package from the core repo.

FYI, I've build from git and netscanner still crashed with the exact same report... Thanks for looking into it though!

netscanner is using external third-party applications for getting WiFi information. For Linux iw ...

In that case the AUR packages need to add iw to the depends() array...

orhun commented 8 months ago

In that case the AUR packages need to add iw to the depends() array...

Done!