Skip to content

Sniffnet 1.3.2 crashes with error: user-provided comparison function does not correctly implement a total order #675

Closed

Description

@koshikas

Is there an existing issue for this?

  • I have searched the existing issues.

What's the problem?

Sniffnet 1.3.2 crashes after selecting the network adapter and starting the analysis, the application crashes. i get following stack trace;

thread 'main' panicked at core/src/slice/sort/shared/smallsort.rs:865:5:
user-provided comparison function does not correctly implement a total order
stack backtrace:
0: 0x5f7b55bb4af9 -
1: 0x5f7b55511183 -
2: 0x5f7b55b7f302 -
3: 0x5f7b55bb9f32 -
4: 0x5f7b55bb9c7b -
5: 0x5f7b55bb99cf -
6: 0x5f7b55a5d001 -
7: 0x5f7b55bba1f9 -
8: 0x5f7b55bb9fd5 -
9: 0x5f7b55bb9f69 -
10: 0x5f7b55bb9f5c -
11: 0x5f7b553cf0ff -
12: 0x5f7b553cf77a -
13: 0x5f7b555b150f -
14: 0x5f7b555b37ff -
15: 0x5f7b555b2fc0 -
16: 0x5f7b555b2fc0 -
17: 0x5f7b555b26f4 -
18: 0x5f7b55b487fe -
19: 0x5f7b5542d8fb -
20: 0x5f7b554399da -
21: 0x5f7b55b5787a -
22: 0x5f7b55ada978 -
23: 0x5f7b554379f4 -
24: 0x5f7b55a5ab86 -
25: 0x5f7b5544c386 -
26: 0x5f7b55a5840e -
27: 0x794584f2ce08 -
28: 0x794584f2cecc - __libc_start_main
29: 0x5f7b554250d5 -
30: 0x0 -

after downgrading to Sniffnet 1.3.1, everything works as it should.

How did you install the app?

downloaded one of the provided packages

Operating System

Linux

Additional context

System:
Kernel: 6.12.8-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 14.2.1
clocksource: tsc avail: hpet,acpi_pm
parameters: BOOT_IMAGE=/boot/vmlinuz-6.12-x86_64
root=UUID=e0d878c7-******* rw
lsm=landlock,lockdown,yama,apparmor,bpf quiet rd.udev.log_level=3
i915.fastboot=1 audit=0 ipv6.disable=1 i8042.nomux=1 nowatchdog
Desktop: KDE Plasma v: 6.2.5 tk: Qt v: N/A info: frameworks v: 6.9.0
wm: kwin_x11 tools: avail: xtrlock vt: 2 dm: SDDM Distro: Manjaro
base: Arch Linux
Machine:
Type: Portable System: Dell product: Inspiron 5520 v: A14
serial: Chassis: type: 8 v: A14
serial:
Mobo: Dell model: 0XWH1P v: A00 serial:
CPU:
Info: model: Intel Core i7-3612QM bits: 64 type: MT MCP arch: Ivy Bridge
gen: core 3 level: v2 built: 2012-15 process: Intel 22nm family: 6
model-id: 0x3A (58) stepping: 9 microcode: 0x21
Topology: cpus: 1x dies: 1 clusters: 4 cores: 4 threads: 8 tpc: 2
smt: enabled cache: L1: 256 KiB desc: d-4x32 KiB; i-4x32 KiB L2: 1024 KiB
desc: 4x256 KiB L3: 6 MiB desc: 1x6 MiB
Speed (MHz): avg: 1200 min/max: 1200/2100 scaling: driver: intel_cpufreq
governor: schedutil cores: 1: 1200 2: 1200 3: 1200 4: 1200 5: 1200 6: 1200
7: 1200 8: 1200 bogomips: 33536
Flags: avx ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
Device-1: Intel 3rd Gen Core processor Graphics vendor: Dell driver: i915
v: kernel arch: Gen-7 process: Intel 22nm built: 2012-13 ports:
active: LVDS-1 empty: DP-1,HDMI-A-1,VGA-1 bus-ID: 00:02.0
chip-ID: 8086:0166 class-ID: 0300
Device-2: Advanced Micro Devices [AMD/ATI] Thames [Radeon HD 7500M/7600M
Series] vendor: Dell driver: radeon v: kernel alternate: amdgpu
arch: TeraScale-2 code: Evergreen process: TSMC 32-40nm built: 2009-15
pcie: gen: 1 speed: 2.5 GT/s lanes: 8 link-max: gen: 2 speed: 5 GT/s
lanes: 16 bus-ID: 01:00.0 chip-ID: 1002:6840 class-ID: 0300 temp: 48.0 C
Device-3: Microdia Laptop_Integrated_Webcam_HD driver: uvcvideo type: USB
rev: 2.0 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 4-1.5:7
chip-ID: 0c45:644a class-ID: 0e02
Display: x11 server: X.Org v: 21.1.15 with: Xwayland v: 24.1.4
compositor: kwin_x11 driver: X: loaded: intel,radeon unloaded: modesetting
alternate: fbdev,vesa dri: i965,r600 gpu: i915 display-ID: :0 screens: 1
Screen-1: 0 s-res: 1366x768 s-dpi: 96 s-size: 361x203mm (14.21x7.99")
s-diag: 414mm (16.31")
Monitor-1: LVDS-1 mapped: LVDS1 model: LG Display 0x033a built: 2012
res: 1366x768 hz: 60 dpi: 102 gamma: 1.2 size: 340x190mm (13.39x7.48")
diag: 395mm (15.5") ratio: 16:9 modes: 1366x768
API: EGL v: 1.5 hw: drv: intel crocus drv: amd r600 platforms: device: 0
drv: crocus device: 1 drv: r600 device: 2 drv: swrast gbm: drv: crocus
surfaceless: drv: crocus x11: drv: crocus inactive: wayland
API: OpenGL v: 4.5 compat-v: 4.2 vendor: intel mesa v: 24.2.7-arch1.1
glx-v: 1.4 direct-render: yes renderer: Mesa Intel HD Graphics 4000 (IVB GT2)
device-ID: 8086:0166 memory: 1.46 GiB unified: yes
API: Vulkan v: 1.4.303 layers: N/A device: 0 type: integrated-gpu
name: Intel HD Graphics 4000 (IVB GT2) driver: N/A device-ID: 8086:0166
surfaces: xcb,xlib
Audio:
Device-1: Intel 7 Series/C216 Family High Definition Audio vendor: Dell
driver: snd_hda_intel v: kernel bus-ID: 00:1b.0 chip-ID: 8086:1e20
class-ID: 0403
API: ALSA v: k6.12.8-1-MANJARO status: kernel-api with: aoss
type: oss-emulator tools: alsactl,alsamixer,amixer
Server-1: PipeWire v: 1.2.7 status: active with: 1: pipewire-pulse
status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
4: pw-jack type: plugin tools: pactl,pw-cat,pw-cli,wpctl
Network:
Device-1: Realtek RTL810xE PCI Express Fast Ethernet vendor: Dell
driver: r8169 v: kernel pcie: gen: 1 speed: 2.5 GT/s lanes: 1 port: 2000
bus-ID: 07:00.0 chip-ID: 10ec:8136 class-ID: 0200
IF: enp7s0 state: down mac:
Device-2: Intel Centrino Wireless-N 2230 driver: iwlwifi v: kernel pcie:
gen: 1 speed: 2.5 GT/s lanes: 1 bus-ID: 08:00.0 chip-ID: 8086:0887
class-ID: 0280
IF: wlp8s0 state: up mac:
Info: services: NetworkManager, sshd, systemd-timesyncd, wpa_supplicant
Bluetooth:
Device-1: Intel Centrino Bluetooth Wireless Transceiver driver: btusb v: 0.8
type: USB rev: 2.0 speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 2-1.5:3
chip-ID: 8087:07da class-ID: e001
Report: btmgmt ID: hci0 rfk-id: 1 state: down bt-service: enabled,running
rfk-block: hardware: no software: yes address: bt-v: 4.0 lmp-v: 6
status: discoverable: no pairing: no
Info:
Memory: total: 8 GiB available: 7.63 GiB used: 3.23 GiB (42.3%)
Processes: 244 Power: uptime: 2h 14m states: freeze,mem,disk suspend: deep
avail: s2idle wakeups: 0 hibernate: platform avail: shutdown, reboot,
suspend, test_resume image: 3.03 GiB services: org_kde_powerdevil,
thermald, upowerd Init: systemd v: 257 default: graphical tool: systemctl
Packages: pm: pacman pkgs: 1812 libs: 387 tools: octopi,pamac,yay
Compilers: gcc: 14.2.1 Shell: Bash v: 5.2.37 running-in: konsole inxi: 3.3.36

Activity

  1. GyulyVGC commented on Jan 8, 2025

    @GyulyVGC
    Owner

    It seems something related to Rust 1.81 new sorting implementations.

    Unfortunately I'm not able to reproduce this on any of my machines, but I'll try to find a fix.

  2. changed the title [-]Sniffnet 1.3.2 crashes with just before starting the analysis[/-] [+]Sniffnet 1.3.2 crashes with error: `user-provided comparison function does not correctly implement a total order`[/+] on Jan 8, 2025
  3. koshikas commented on Jan 8, 2025

    @koshikas
    Author

    It seems something related to Rust 1.81 new sorting implementations.

    Unfortunately I'm not able to reproduce this on any of my machines, but I'll try to find a fix.

    no issues, i've reverted to 1.3.1, and it is functioning fine. let me know if i can help with more debugging from my end.

    Thanks!

  4. GyulyVGC commented on Jan 8, 2025

    @GyulyVGC
    Owner

    Yes, I'll need your help to test once I come up with a potential fix.

    Thanks very much 👍

  5. neogeographica commented on Feb 4, 2025

    @neogeographica

    Same thing experienced on my system, FWIW.

    Because of issue #635 I launched sniffnet as:

    ICED_BACKEND=tiny-skia sniffnet
    

    and then it failed with

    thread 'main' panicked at core/src/slice/sort/shared/smallsort.rs:865:5:
    user-provided comparison function does not correctly implement a total order
    

    as per above.

    My OS is Pop!_OS 22.04.

    v1.3.1 doesn't experience the error.

  6. GyulyVGC commented on Feb 4, 2025

    @GyulyVGC
    Owner

    Hey guys when does this error happen? In which screen of the application?

    I'm asking this to understand where is the comparison function to fix.

  7. neogeographica commented on Feb 4, 2025

    @neogeographica

    As soon as it launches and tries to create a GUI window. I don't remember seeing much of what that window was supposed to be, but judging from the behavior of 1.3.1 when it launches, it's either an initial "no traffic has been detect yet" message or else the Overview window for the main/default adapter.

  8. GyulyVGC commented on Feb 4, 2025

    @GyulyVGC
    Owner

    Oh ok, if it's happening before you see anything, then it is the page where you have to select network adapters an filters.

  9. GyulyVGC commented on Feb 4, 2025

    @GyulyVGC
    Owner

    This is even more strange now as @koshikas is having this issue in the overview page instead.

  10. neogeographica commented on Feb 4, 2025

    @neogeographica

    As mentioned above it could well be the overview page since that seems to be the first page it launches into. It doesn't explicitly ask me to choose an adapter first. The "no traffic yet" message displays for a split second then it goes straight to overview.

  11. GyulyVGC commented on Feb 4, 2025

    @GyulyVGC
    Owner

    Oh ok sorry there was a misunderstanding.
    I thought it was happening as soon as you started the app.

    Ok so the problem is in the overview page for you as well.
    I'm guessing it's because of the way hosts are being sorted.
    I'll check again for possible fixes, and I hope to find an OS where I'm able to replicate the issue.

  12. GyulyVGC commented on Feb 4, 2025

    @GyulyVGC
    Owner

    I've built a new binary for you guys to test, find the links here (at the bottom of the page).

    This is using the latest dependencies and Rust version.
    I didn't change sort strategy since it already seems correct to me, I hope this was a problem solved with the newest Rust release.


    For reference this is the piece of code used to sort items:

    pub fn compare(&self, other: &Self, sort_type: SortType, chart_type: ChartType) -> Ordering {
        match chart_type {                                                                       
            ChartType::Packets => match sort_type {                                              
                SortType::Ascending => self.tot_packets().cmp(&other.tot_packets()),             
                SortType::Descending => other.tot_packets().cmp(&self.tot_packets()),            
                SortType::Neutral => other.final_timestamp.cmp(&self.final_timestamp),           
            },                                                                                   
            ChartType::Bytes => match sort_type {                                                
                SortType::Ascending => self.tot_bytes().cmp(&other.tot_bytes()),                 
                SortType::Descending => other.tot_bytes().cmp(&self.tot_bytes()),                
                SortType::Neutral => other.final_timestamp.cmp(&self.final_timestamp),           
            },                                                                                   
        }                                                                                        
    }                                                                                            

    As you can see I'm using cmp which implements total ordering, so I can't seem to find the root of the issue.

  13. koshikas commented on Feb 4, 2025

    @koshikas
    Author

    I've built a new binary for you guys to test, find the links here (at the bottom of the page).

    just tried small issue on archlinux we are running libpcap 1.10.5. and the build you provided seems to be looking for libpcap 0.8.x. is there any way get libpcap further upstream to build at your end

    error i get with your build;
    ./sniffnet: error while loading shared libraries: libpcap.so.0.8: cannot open shared object file: No such file or directory

  14. GyulyVGC commented on Feb 4, 2025

    @GyulyVGC
    Owner

    Unfortunately the package I build aren't for Arch Linux. However you can try checking the required dependencies, but not sure it'll work on Arch since there you have to install via pacman.

  15. 15 remaining items

  16. giri256 commented on Aug 21, 2025

    @giri256

    installed with pacman -S sniffnet on arch
    sniffnet
    GUI opens
    I click start button
    ╭────────────────────────────────────────────────────────────────────╮
    │ │
    │ Sniffnet 1.4.0 │
    │ │
    │ → Website: https://sniffnet.net │
    │ → GitHub: https://github.com/GyulyVGC/sniffnet │
    │ │
    ╰────────────────────────────────────────────────────────────────────╯

    MESA-INTEL: warning: Ivy Bridge Vulkan support is incomplete

    thread 'main' panicked at library/core/src/slice/sort/shared/smallsort.rs:860:5:
    user-provided comparison function does not correctly implement a total order
    note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

  17. koshikas commented on Aug 22, 2025

    @koshikas
    Author

    small update, based on the comment above, i have a feeling this has some thing to do with the graphics stack.

    i have 2 laptops both running archlinux. the one having AMD GPU runs sniffnet 11.4.0 with no issues. it is the one with Ivy bridge (intel 3rd gen CPU) with integrated graphics that i get the same error.

  18. GyulyVGC commented on Aug 22, 2025

    @GyulyVGC
    Owner

    Yes, I'm also pretty sure it has to do with the graphics stack, particularly I believe this is related with iced as I mentioned:

    Today I've found out that this might be due to iced-rs/iced#2650, which was already fixed in iced-rs/iced#2651.

    As soon as Iced gets updated I will provide you guys a new binary so that we can verify if the problem is solved.

    I hope for a new version of the library coming soon from them

  19. GyulyVGC commented on Dec 23, 2025

    @GyulyVGC
    Owner

    Hey guys, I'm migrating (#1032) to the new version of Iced that possibly fixed this issue.
    I need your help to verify that the problem is gone.

    Here you can find the packages built on top of #1032.

    @neogeographica tagging you since you were the only one that was able to download and test a DEB package from my workflows I think.

  20. neogeographica commented on Dec 23, 2025

    @neogeographica

    @GyulyVGC that does seem to fix things... I can launch and use it without any issues now.

    Also it looks like I no longer need to use this: ICED_BACKEND=tiny-skia

  21. GyulyVGC commented on Dec 23, 2025

    @GyulyVGC
    Owner

    Awesome 🤩

    This means that Sniffnet v1.5.0 will finally fix this issue!

    Thanks for the confirmation.

  22. linked a pull request that will close this issueMigrate to Iced 0.14 #1032on Dec 23, 2025
  23. self-assigned this
    on Dec 23, 2025
  24. added this to the v1.5.0 milestone on Dec 23, 2025
  25. sysfu commented on Jan 1, 2026

    @sysfu

    Hey guys, I'm migrating (#1032) to the new version of Iced that possibly fixed this issue. I need your help to verify that the problem is gone.

    Verified issue is resolved with amd64 AppImage for following environment:

    Void Linux
    wayland
    GNOME DE
    Intel® UHD Graphics 620 (KBL GT2)

  26. GyulyVGC commented on Jan 1, 2026

    @GyulyVGC
    Owner

    Finally! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingicedSomething related to the GUI library used

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions