Chleba / netscanner

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

Crash report #36

Closed guihkx closed 3 months ago

guihkx commented 3 months ago
"name" = "netscanner"
"operating_system" = "Arch Linux [64-bit]"
"crate_version" = "0.5.2"
"explanation" = """
Panic occurred in file 'src/components/interfaces.rs' at line 101
"""
"cause" = "index out of bounds: the len is 0 but the index is 0"
"method" = "Panic"
"backtrace" = """

   0: 0x5923bc0b7407 - <unresolved>
   1: 0x5923bc167de3 - <unresolved>
   2: 0x5923bc142772 - <unresolved>
   3: 0x5923bc110f16 - <unresolved>
   4: 0x5923bc0edc37 - <unresolved>
   5: 0x5923bc117442 - <unresolved>
   6: 0x5923bc0e3b46 - <unresolved>
   7: 0x5923bc117791 - <unresolved>
   8: 0x5923bc472a10 - <unresolved>
   9: 0x5923bc117534 - <unresolved>
  10: 0x7bcbed001e08 - <unresolved>
  11: 0x7bcbed001ecc - __libc_start_main
  12: 0x5923bc0b7985 - <unresolved>
  13:        0x0 - <unresolved>"""

This happened hours ago, and I'm not sure how "I triggered it".

I had netscanner running on background for a few hours on a terminal window, and I totally forgot about it.

When I remembered and came back to check on it, it had crashed.

Thanks.

Chleba commented 3 months ago

Hi, Thanks for the report. May I ask if this is some kind of virtual that you run it within ? This seems that You have no network interfaces available. But I really don't know how could this happen when it running a few hours and suddenly - this error ? I'll fix this panic but I'm really curious how could this happen.

guihkx commented 3 months ago

May I ask if this is some kind of virtual that you run it within

Nope. This is just my normal, home computer. It runs Arch with KDE, and the network configuration is managed by NetworkManager.

This seems that You have no network interfaces available

Hmmm, I do remember adding a new virtual network adapter because I was testing something... Maybe when I did that all interfaces were temporarily removed? I don't know, I'll check the system logs later and see if I find something to help me reproduce the crash again...

guihkx commented 3 months ago

I couldn't reproduce the crash again, but I did find a lot of network-related activity in yesterday's system logs, right before (and after) I launched netscanner:

ago 05 16:37:07 arch systemd[1]: Starting Network Manager Script Dispatcher Service...
ago 05 16:37:08 arch systemd[1]: Started Network Manager Script Dispatcher Service.
ago 05 16:37:08 arch NetworkManager[552]: <info>  [1722886628.0176] device (enp3s0): state change: ip-check -> secondaries (reason 'none', sys-iface-state: 'managed')
ago 05 16:37:08 arch NetworkManager[552]: <info>  [1722886628.0177] device (enp3s0): state change: secondaries -> activated (reason 'none', sys-iface-state: 'managed')
ago 05 16:37:08 arch NetworkManager[552]: <info>  [1722886628.0180] manager: NetworkManager state is now CONNECTED_SITE
ago 05 16:37:08 arch NetworkManager[552]: <info>  [1722886628.0182] device (enp3s0): Activation: successful, device activated.
ago 05 16:37:08 arch NetworkManager[552]: <info>  [1722886628.0199] manager: NetworkManager state is now CONNECTED_GLOBAL
ago 05 16:37:08 arch kdeconnectd[946]: 2024-08-05T16:37:08 kdeconnect.core: Failed to send mDNS query: Cannot assign requested address
ago 05 16:37:08 arch NetworkManager[552]: <info>  [1722886628.0565] audit: op="statistics" interface="enp3s0" ifindex=2 args="2000" pid=38621 uid=1000 result="success"
ago 05 16:37:09 arch NetworkManager[552]: <info>  [1722886629.8764] dhcp6 (enp3s0): activation: beginning transaction (timeout in 45 seconds)
ago 05 16:37:09 arch NetworkManager[552]: <info>  [1722886629.8769] policy: set 'Wired' (enp3s0) as default for IPv6 routing and DNS
ago 05 16:37:11 arch kernel: r8169 0000:03:00.0 enp3s0: Link is Down
ago 05 16:37:14 arch kernel: r8169 0000:03:00.0 enp3s0: Link is Up - 1Gbps/Full - flow control rx/tx
ago 05 16:37:14 arch NetworkManager[552]: <info>  [1722886634.5230] device (enp3s0): carrier: link connected
ago 05 16:37:18 arch systemd[1]: NetworkManager-dispatcher.service: Deactivated successfully.
ago 05 16:37:18 arch sudo[47666]: pam_systemd_home(sudo:auth): New sd-bus connection (system-bus-pam-systemd-home-47666) opened.
ago 05 16:37:19 arch sudo[47666]:      gui : TTY=pts/4 ; PWD=/home/gui ; USER=root ; COMMAND=/usr/bin/netscanner
ago 05 16:37:19 arch sudo[47666]: pam_unix(sudo:session): session opened for user root(uid=0) by gui(uid=1000)
ago 05 16:37:20 arch kernel: r8169 0000:03:00.0 enp3s0: entered promiscuous mode
ago 05 16:40:29 arch kernel: r8169 0000:03:00.0 enp3s0: Link is Down
ago 05 16:40:32 arch kernel: r8169 0000:03:00.0 enp3s0: Link is Up - 1Gbps/Full - flow control rx/tx
ago 05 16:40:32 arch NetworkManager[552]: <info>  [1722886832.9862] device (enp3s0): carrier: link connected
ago 05 16:40:46 arch kernel: r8169 0000:03:00.0 enp3s0: Link is Down
ago 05 16:40:49 arch NetworkManager[552]: <info>  [1722886849.3673] device (enp3s0): carrier: link connected
ago 05 16:40:49 arch kernel: r8169 0000:03:00.0 enp3s0: Link is Up - 1Gbps/Full - flow control rx/tx
ago 05 16:41:51 arch kernel: r8169 0000:03:00.0 enp3s0: Link is Down
ago 05 16:41:55 arch NetworkManager[552]: <info>  [1722886915.1016] device (enp3s0): carrier: link connected
ago 05 16:41:55 arch kernel: r8169 0000:03:00.0 enp3s0: Link is Up - 1Gbps/Full - flow control rx/tx
ago 05 16:41:59 arch kernel: r8169 0000:03:00.0 enp3s0: Link is Down
ago 05 16:42:05 arch NetworkManager[552]: <info>  [1722886925.7798] device (enp3s0): state change: activated -> unavailable (reason 'carrier-changed', sys-iface-state: 'managed')
ago 05 16:42:05 arch kernel: r8169 0000:03:00.0 enp3s0: Link is Down
ago 05 16:42:05 arch NetworkManager[552]: <info>  [1722886925.7801] dhcp6 (enp3s0): canceled DHCP transaction
ago 05 16:42:05 arch NetworkManager[552]: <info>  [1722886925.7801] dhcp6 (enp3s0): activation: beginning transaction (timeout in 45 seconds)
ago 05 16:42:05 arch NetworkManager[552]: <info>  [1722886925.7801] dhcp6 (enp3s0): state changed no lease
ago 05 16:42:05 arch NetworkManager[552]: <info>  [1722886925.8477] manager: NetworkManager state is now DISCONNECTED
ago 05 16:42:05 arch systemd[1]: Starting Network Manager Script Dispatcher Service...
ago 05 16:42:05 arch systemd[1]: Started Network Manager Script Dispatcher Service.
ago 05 16:42:06 arch NetworkManager[552]: <info>  [1722886926.7987] device (enp3s0): carrier: link connected
ago 05 16:42:06 arch kernel: r8169 0000:03:00.0 enp3s0: Link is Up - 1Gbps/Full - flow control rx/tx
ago 05 16:42:06 arch NetworkManager[552]: <info>  [1722886926.7995] device (enp3s0): state change: unavailable -> disconnected (reason 'carrier-changed', sys-iface-state: 'managed')
ago 05 16:42:06 arch NetworkManager[552]: <info>  [1722886926.8002] policy: auto-activating connection 'Wired' (ca110207-a8a4-4c0e-be5e-0812ffc6fc0c)
ago 05 16:42:06 arch NetworkManager[552]: <info>  [1722886926.8005] device (enp3s0): Activation: starting connection 'Wired' (ca110207-a8a4-4c0e-be5e-0812ffc6fc0c)
ago 05 16:42:06 arch NetworkManager[552]: <info>  [1722886926.8005] device (enp3s0): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
ago 05 16:42:06 arch kernel: r8169 0000:03:00.0 enp3s0: Link is Up - 1Gbps/Full - flow control rx/tx
ago 05 16:42:06 arch NetworkManager[552]: <info>  [1722886926.8007] manager: NetworkManager state is now CONNECTING
ago 05 16:42:06 arch NetworkManager[552]: <info>  [1722886926.8029] device (enp3s0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
ago 05 16:42:06 arch NetworkManager[552]: <info>  [1722886926.8264] device (enp3s0): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
ago 05 16:42:06 arch NetworkManager[552]: <info>  [1722886926.8272] policy: set 'Wired' (enp3s0) as default for IPv4 routing and DNS
ago 05 16:42:06 arch NetworkManager[552]: <info>  [1722886926.9705] device (enp3s0): state change: ip-config -> ip-check (reason 'none', sys-iface-state: 'managed')
ago 05 16:42:06 arch NetworkManager[552]: <info>  [1722886926.9722] device (enp3s0): state change: ip-check -> secondaries (reason 'none', sys-iface-state: 'managed')
ago 05 16:42:06 arch NetworkManager[552]: <info>  [1722886926.9724] device (enp3s0): state change: secondaries -> activated (reason 'none', sys-iface-state: 'managed')
ago 05 16:42:06 arch NetworkManager[552]: <info>  [1722886926.9727] manager: NetworkManager state is now CONNECTED_SITE
ago 05 16:42:06 arch NetworkManager[552]: <info>  [1722886926.9731] device (enp3s0): Activation: successful, device activated.
ago 05 16:42:06 arch NetworkManager[552]: <info>  [1722886926.9736] manager: NetworkManager state is now CONNECTED_GLOBAL
ago 05 16:42:06 arch kdeconnectd[946]: 2024-08-05T16:42:06 kdeconnect.core: Failed to send mDNS query: Cannot assign requested address
ago 05 16:42:08 arch NetworkManager[552]: <info>  [1722886928.4915] dhcp6 (enp3s0): activation: beginning transaction (timeout in 45 seconds)
ago 05 16:42:08 arch NetworkManager[552]: <info>  [1722886928.4921] policy: set 'Wired' (enp3s0) as default for IPv6 routing and DNS
ago 05 16:42:15 arch systemd[1]: NetworkManager-dispatcher.service: Deactivated successfully.
Chleba commented 3 months ago

Yep. Netscanner, when scanning Wifi networks using iw will have to switch periodically from station to access point, especially when you're connected to the wifi. Also using packet dump and scanning will send a lot of ARP packets, and etc. Crash probably happens because of one frame we're trying to get a list of interfaces right when the active interface link is down.

Chleba commented 3 months ago

Hi, Here is the fix: https://github.com/Chleba/netscanner/commit/81e0e8a387e9ba9f3700410d58cb9f5d05c4f3dc and it will be included in the next version. Thank You for Your report :+1: