GyulyVGC / sniffnet

Comfortably monitor your Internet traffic 🕵️‍♂️
https://sniffnet.net
Apache License 2.0
17.92k stars 546 forks source link

Panic at the very start #318

Closed thedenisnikulin closed 1 year ago

thedenisnikulin commented 1 year ago

Is there an existing issue for this?

What's the problem?

When starting sniffnet ($ sniffnet) it panics right after displaying ASCII art. Here's the error text:

thread 'main' panicked at 'Failed to call XMapRaised: XError { description: "BadMatch (invalid parameter attributes)", error_code: 8, request_code: 149, minor_code: 4 }', /home/rw_panic0_0/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.27.5/src/platform_impl/linux/x11/window.rs:983:18
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

How did you install the app?

installed from crates.io

Operating System

Linux

Additional context

No response

GyulyVGC commented 1 year ago

If it panics after the ASCII art, it must be a problem with the GUI library, and this is also suggested by the presence of winit in the panic message.

You can try cloning the repo and building Sniffnet from the glow-renderer branch, which uses a different graphical renderer (the default renderer used by the GUI library has incompatibilities sometimes..)

If you prefer, I can provide you the ready made package (just let me know if you prefer DEB or RPM)

thedenisnikulin commented 1 year ago

yep, tried building from that branch and it worked fine. Is there any information about my system I can provide to help in solving the problem?

GyulyVGC commented 1 year ago

Nope, not exactly. I mean, it's a known problem of Iced and when it happens it can be solved just by changing the graphical renderer. This happens when the graphical adapter of your PC is not compatible with the default renderer.

Anyway, they are about to release a new version of the library where the renderer is chosen at run time based on the compatibility, so it shouldn't be a problem anymore in the future.

GyulyVGC commented 1 year ago

Hi @thedenisnikulin! I'm coming back to you since recently Iced has finally overcome the limitations due to the graphical renderers and is now able to use a different renderer at runtime if the default one crashes. The alternative renderer is tiny-skia, a CPU-only renderer that should run everywhere.

You can find the version of Sniffnet based on the latest Iced release on this branch. It'd be awesome if could kindly try it and let me know if everything is correctly displayed 🤞