Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashes on start on OS Gentoo stable #17

Closed
wofwofwof opened this issue Nov 22, 2022 · 9 comments
Closed

Crashes on start on OS Gentoo stable #17

wofwofwof opened this issue Nov 22, 2022 · 9 comments
Labels
Linux Something related to Linux operating system renderer Problem related to the renderer used by the GUI library

Comments

@wofwofwof
Copy link

Describe the bug
When running

To Reproduce

  1. Build as normal user with: cargo install sniffnet
  2. run with: sudo /home/myuser/.cargo/bin/sniffnet
error: XDG_RUNTIME_DIR is invalid or not set in the environment.
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /home/myuser/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-core-0.12.2/src/hub.rs:960:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Expected behavior
Sniffnet is starting

Desktop (please complete the following information):

  • OS: Gentoo stable

Additional context

% cargo install sniffnet                                                                                                                                                                                              (16:28 22.11.22)(0)
    Updating crates.io index
  Downloaded sniffnet v1.0.0
  Downloaded 1 crate (4.3 MB) in 2.74s
  Installing sniffnet v1.0.0
  Downloaded ahash v0.7.6
  Downloaded parking_lot v0.11.2
  Downloaded parking_lot_core v0.8.5
  Downloaded plotters-backend v0.3.4
  Downloaded pathfinder_geometry v0.5.1
  Downloaded plotters v0.3.4
  Downloaded same-file v1.0.6
  Downloaded static_assertions v1.1.0
  Downloaded rayon-core v1.10.1
  Downloaded lyon v0.17.10
  Downloaded ttf-parser v0.17.1
  Downloaded walkdir v2.3.2
  Downloaded lyon_algorithms v0.17.7
  Downloaded lyon_geom v0.17.7
  Downloaded plotters-iced v0.3.3
  Downloaded lyon_path v0.17.7
  Downloaded linked-hash-map v0.5.6
  Downloaded libloading v0.7.4
  Downloaded smithay-client-toolkit v0.15.4
  Downloaded thousands v0.2.0
  Downloaded plotters-svg v0.3.3
  Downloaded scoped-tls v1.0.1
  Downloaded approx v0.5.1
  Downloaded adler v1.0.2
  Downloaded arrayvec v0.5.2
  Downloaded bit-vec v0.6.3
  Downloaded memoffset v0.6.5
  Downloaded minimal-lexical v0.2.1
  Downloaded miniz_oxide v0.5.4
  Downloaded cmake v0.1.49
  Downloaded chrono v0.4.23
  Downloaded crc32fast v1.3.2
  Downloaded crossbeam-channel v0.5.6
  Downloaded crossbeam-deque v0.8.2
  Downloaded crossbeam-epoch v0.9.13
  Downloaded dirs-sys-next v0.1.2
  Downloaded errno v0.2.8
  Downloaded crossbeam-utils v0.8.14
  Downloaded gpu-alloc-types v0.2.0
  Downloaded flate2 v1.0.24
  Downloaded iana-time-zone v0.1.53
  Downloaded instant v0.1.12
  Downloaded image v0.24.5
  Downloaded raw-window-handle v0.3.4
  Downloaded nix v0.24.2
  Downloaded khronos-egl v4.1.0
  Downloaded wgpu-core v0.12.2
  Downloaded wgpu-hal v0.12.5
  Downloaded nom v7.1.1
  Downloaded wgpu_glyph v0.16.0
  Downloaded num-integer v0.1.45
  Downloaded num-traits v0.2.15
  Downloaded xcursor v0.3.4
  Downloaded block v0.1.6
  Downloaded bytemuck_derive v1.3.0
  Downloaded lyon_tessellation v0.17.10
  Downloaded mutate_once v0.1.1
  Downloaded copyless v0.1.5
  Downloaded const-cstr v0.3.0
  Downloaded clipboard_wayland v0.2.0
  Downloaded calloop v0.9.3
  Downloaded float-ord v0.2.0
  Downloaded euclid v0.22.7
  Downloaded freetype v0.7.0
  Downloaded glyph_brush v0.7.5
  Downloaded glyph_brush_draw_cache v0.1.5
  Downloaded gpu-alloc v0.5.3
  Downloaded gpu-descriptor-types v0.1.1
  Downloaded guillotiere v0.6.2
  Downloaded iced_style v0.4.0
  Downloaded iced_pure v0.2.2
  Downloaded iced_wgpu v0.5.1
  Downloaded iced_winit v0.4.0
  Downloaded renderdoc-sys v0.7.1
  Downloaded kamadak-exif v0.5.5
  Downloaded sid v0.6.1
  Downloaded semver-parser v0.10.2
  Downloaded ab_glyph_rasterizer v0.1.7
  Downloaded rustc_version v0.3.3
  Downloaded ttf-parser v0.15.2
  Downloaded bit-set v0.5.3
  Downloaded color_quant v1.1.0
  Downloaded dirs-next v2.0.0
  Downloaded downcast-rs v1.2.0
  Downloaded dlib v0.5.0
  Downloaded gethostname v0.2.3
  Downloaded cty v0.2.2
  Downloaded clipboard_x11 v0.4.0
  Downloaded glam v0.10.2
  Downloaded owned_ttf_parser v0.17.1
  Downloaded wayland-sys v0.29.5
  Downloaded arrayvec v0.7.2
  Downloaded pathfinder_simd v0.5.1
  Downloaded xml-rs v0.8.4
  Downloaded bytemuck v1.12.3
  Downloaded codespan-reporting v0.11.1
  Downloaded memoffset v0.7.1
  Downloaded libloading v0.6.7
  Downloaded hexf-parse v0.2.1
  Downloaded iced_futures v0.4.1
  Downloaded iced_core v0.5.0
  Downloaded inplace_it v0.3.5
  Downloaded glyph_brush_layout v0.2.3
  Downloaded raw-window-handle v0.4.3
  Downloaded font-kit v0.11.0
  Downloaded gpu-descriptor v0.2.3
  Downloaded float_next_after v0.1.5
  Downloaded ab_glyph v0.2.18
  Downloaded cfg_aliases v0.1.1
  Downloaded iced_graphics v0.3.1
  Downloaded iced_native v0.5.1
  Downloaded etherparse v0.12.0
  Downloaded glow v0.11.2
  Downloaded rayon v1.6.0
  Downloaded time v0.1.44
  Downloaded rustc-hash v1.1.0
  Downloaded num-rational v0.4.1
  Downloaded unicode-segmentation v1.10.0
  Downloaded wayland-client v0.29.5
  Downloaded wayland-commons v0.29.5
  Downloaded version_check v0.9.4
  Downloaded x11-dl v2.20.0
  Downloaded wayland-scanner v0.29.5
  Downloaded range-alloc v0.1.2
  Downloaded pcap v0.11.0
  Downloaded wayland-protocols v0.29.5
  Downloaded profiling v1.0.7
  Downloaded spirv v0.2.0+1.5.4
  Downloaded plotters-bitmap v0.3.2
  Downloaded ash v0.34.0+1.2.203
  Downloaded window_clipboard v0.2.3
  Downloaded wgpu v0.12.0
  Downloaded iced v0.4.2
  Downloaded memmap2 v0.5.8
  Downloaded ordered-float v3.4.0
  Downloaded memmap2 v0.3.1
  Downloaded gif v0.11.4
  Downloaded miniz_oxide v0.6.2
  Downloaded jpeg-decoder v0.3.0
  Downloaded wayland-cursor v0.29.5
  Downloaded nix v0.22.3
  Downloaded yeslogic-fontconfig-sys v3.2.0
  Downloaded wgpu-types v0.12.0
  Downloaded semver v0.11.0
  Downloaded png v0.17.7
  Downloaded x11rb v0.9.0
  Downloaded pest v2.4.1
  Downloaded smithay-client-toolkit v0.16.0
  Downloaded twox-hash v1.6.3
  Downloaded smithay-clipboard v0.6.6
  Downloaded ucd-trie v0.1.5
  Downloaded weezl v0.1.7
  Downloaded xi-unicode v0.3.0
  Downloaded svg_fmt v0.4.1
  Downloaded naga v0.8.5
  Downloaded winit v0.26.1
  Downloaded freetype-sys v0.13.1
  Downloaded 157 crates (12.4 MB) in 1.68s (largest was `freetype-sys` at 1.9 MB)
   Compiling autocfg v1.1.0
   Compiling libc v0.2.137
   Compiling cfg-if v1.0.0
   Compiling proc-macro2 v1.0.47
   Compiling unicode-ident v1.0.5
   Compiling quote v1.0.21
   Compiling bitflags v1.3.2
   Compiling syn v1.0.103
   Compiling pkg-config v0.3.26
   Compiling memchr v2.5.0
   Compiling log v0.4.17
   Compiling once_cell v1.16.0
   Compiling thiserror v1.0.37
   Compiling smallvec v1.10.0
   Compiling version_check v0.9.4
   Compiling lazy_static v1.4.0
   Compiling libloading v0.7.4
   Compiling xml-rs v0.8.4
   Compiling scopeguard v1.1.0
   Compiling futures-core v0.3.25
   Compiling cty v0.2.2
   Compiling dlib v0.5.0
   Compiling futures-channel v0.3.25
   Compiling futures-task v0.3.25
   Compiling raw-window-handle v0.4.3
   Compiling byteorder v1.4.3
   Compiling futures-util v0.3.25
   Compiling pin-project-lite v0.2.9
   Compiling futures-sink v0.3.25
   Compiling crossbeam-utils v0.8.14
   Compiling ppv-lite86 v0.2.17
   Compiling parking_lot_core v0.8.5
   Compiling ucd-trie v0.1.5
   Compiling ahash v0.7.6
   Compiling futures-io v0.3.25
   Compiling num-traits v0.2.15
   Compiling memoffset v0.6.5
   Compiling slab v0.4.7
   Compiling lock_api v0.4.9
   Compiling memoffset v0.7.1
   Compiling minimal-lexical v0.2.1
   Compiling pin-utils v0.1.0
   Compiling scoped-tls v1.0.1
   Compiling downcast-rs v1.2.0
   Compiling tokio v1.22.0
   Compiling crossbeam-epoch v0.9.13
   Compiling instant v0.1.12
   Compiling cc v1.0.77
   Compiling wayland-sys v0.29.5
   Compiling arrayvec v0.5.2
   Compiling static_assertions v1.1.0
   Compiling nom v7.1.1
   Compiling indexmap v1.9.2
   Compiling rustc-hash v1.1.0
   Compiling wayland-scanner v0.29.5
   Compiling num-integer v0.1.45
   Compiling iced_core v0.5.0
   Compiling bit-vec v0.6.3
   Compiling khronos-egl v4.1.0
   Compiling crc32fast v1.3.2
   Compiling termcolor v1.1.3
   Compiling rayon-core v1.10.1
   Compiling ttf-parser v0.17.1
   Compiling unicode-width v0.1.10
   Compiling ash v0.34.0+1.2.203
   Compiling adler v1.0.2
   Compiling crossbeam-deque v0.8.2
   Compiling codespan-reporting v0.11.1
   Compiling cmake v0.1.49
   Compiling bit-set v0.5.3
   Compiling iced_style v0.4.0
   Compiling crossbeam-channel v0.5.6
   Compiling smithay-client-toolkit v0.16.0
   Compiling glam v0.10.2
   Compiling gpu-descriptor-types v0.1.1
   Compiling gpu-alloc-types v0.2.0
   Compiling arrayvec v0.7.2
   Compiling hexf-parse v0.2.1
   Compiling cfg_aliases v0.1.1
   Compiling ab_glyph_rasterizer v0.1.7
   Compiling unicode-segmentation v1.10.0
   Compiling gpu-alloc v0.5.3
   Compiling wgpu-core v0.12.2
   Compiling euclid v0.22.7
   Compiling getrandom v0.2.8
   Compiling num_cpus v1.14.0
   Compiling nix v0.24.2
   Compiling rand_core v0.6.4
   Compiling rand_chacha v0.3.1
   Compiling hashbrown v0.12.3
   Compiling nix v0.22.3
   Compiling rand v0.8.5
   Compiling float_next_after v0.1.5
   Compiling parking_lot v0.11.2
   Compiling spirv v0.2.0+1.5.4
   Compiling sid v0.6.1
   Compiling wayland-client v0.29.5
   Compiling wayland-protocols v0.29.5
   Compiling lyon_geom v0.17.7
   Compiling freetype-sys v0.13.1
   Compiling memmap2 v0.5.8
   Compiling xcursor v0.3.4
   Compiling gpu-descriptor v0.2.3
   Compiling twox-hash v1.6.3
   Compiling lyon_path v0.17.7
   Compiling owned_ttf_parser v0.17.1
   Compiling ab_glyph v0.2.18
   Compiling wayland-commons v0.29.5
   Compiling lyon_algorithms v0.17.7
   Compiling lyon_tessellation v0.17.10
   Compiling miniz_oxide v0.5.4
   Compiling yeslogic-fontconfig-sys v3.2.0
   Compiling fxhash v0.2.1
   Compiling num-rational v0.4.1
   Compiling wgpu-types v0.12.0
   Compiling either v1.8.0
   Compiling inplace_it v0.3.5
   Compiling renderdoc-sys v0.7.1
   Compiling glow v0.11.2
   Compiling profiling v1.0.7
   Compiling rayon v1.6.0
   Compiling flate2 v1.0.24
   Compiling lyon v0.17.10
   Compiling gethostname v0.2.3
   Compiling approx v0.5.1
   Compiling miniz_oxide v0.6.2
   Compiling smithay-client-toolkit v0.15.4
   Compiling x11-dl v2.20.0
   Compiling xi-unicode v0.3.0
   Compiling wayland-cursor v0.29.5
   Compiling copyless v0.1.5
   Compiling color_quant v1.1.0
   Compiling linked-hash-map v0.5.6
   Compiling png v0.17.7
   Compiling glyph_brush_layout v0.2.3
   Compiling aho-corasick v0.7.20
   Compiling calloop v0.9.3
   Compiling x11rb v0.9.0
   Compiling memmap2 v0.3.1
   Compiling dirs-sys-next v0.1.2
   Compiling ordered-float v3.4.0
   Compiling regex-syntax v0.6.28
   Compiling font-kit v0.11.0
   Compiling jpeg-decoder v0.3.0
   Compiling plotters-backend v0.3.4
   Compiling weezl v0.1.7
   Compiling winit v0.26.1
   Compiling const-cstr v0.3.0
   Compiling glyph_brush_draw_cache v0.1.5
   Compiling same-file v1.0.6
   Compiling gif v0.11.4
   Compiling walkdir v2.3.2
   Compiling libloading v0.6.7
   Compiling glyph_brush v0.7.5
   Compiling dirs-next v2.0.0
   Compiling freetype v0.7.0
   Compiling time v0.1.44
   Compiling raw-window-handle v0.3.4
   Compiling mio v0.8.5
   Compiling percent-encoding v2.2.0
   Compiling mutate_once v0.1.1
   Compiling iana-time-zone v0.1.53
   Compiling float-ord v0.2.0
   Compiling svg_fmt v0.4.1
   Compiling thiserror-impl v1.0.37
   Compiling futures-macro v0.3.25
   Compiling bytemuck_derive v1.3.0
   Compiling chrono v0.4.23
   Compiling kamadak-exif v0.5.5
   Compiling guillotiere v0.6.2
   Compiling plotters-svg v0.3.3
   Compiling plotters-iced v0.3.3
   Compiling regex v1.7.0
   Compiling ttf-parser v0.15.2
   Compiling errno v0.2.8
   Compiling etherparse v0.12.0
   Compiling thousands v0.2.0
   Compiling bytemuck v1.12.3
   Compiling image v0.24.5
   Compiling pest v2.4.1
   Compiling naga v0.8.5
   Compiling smithay-clipboard v0.6.6
   Compiling semver-parser v0.10.2
   Compiling clipboard_wayland v0.2.0
   Compiling clipboard_x11 v0.4.0
   Compiling pcap v0.11.0
   Compiling semver v0.11.0
   Compiling window_clipboard v0.2.3
   Compiling rustc_version v0.3.3
   Compiling plotters-bitmap v0.3.2
   Compiling pathfinder_simd v0.5.1
   Compiling futures-executor v0.3.25
   Compiling futures v0.3.25
   Compiling iced_futures v0.4.1
   Compiling iced_native v0.5.1
   Compiling pathfinder_geometry v0.5.1
   Compiling wgpu-hal v0.12.5
   Compiling iced_pure v0.2.2
   Compiling plotters v0.3.4
   Compiling iced_graphics v0.3.1
   Compiling iced_winit v0.4.0
   Compiling wgpu v0.12.0
   Compiling wgpu_glyph v0.16.0
   Compiling iced_wgpu v0.5.1
   Compiling iced v0.4.2
   Compiling sniffnet v1.0.0
    Finished release [optimized] target(s) in 3m 40s
  Installing /home/myuser/.cargo/bin/sniffnet
   Installed package `sniffnet v1.0.0` (executable `sniffnet`)```
@GyulyVGC
Copy link
Owner

Try with

echo "XDG_RUNTIME_DIR=/run/user/<YOURID>" >> ~/.pam_environment

where <YOURID> is the output of id -u

@wofwofwof
Copy link
Author

Hello GyulyVGC,

thank you very much for your help.

I've tried:

% sudo sh -c "id -u; echo "XDG_RUNTIME_DIR=/run/user/0"; /home/myuser/.cargo/bin/sniffnet"
0
XDG_RUNTIME_DIR=/run/user/0
error: XDG_RUNTIME_DIR is invalid or not set in the environment.
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /home/myuser/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-core-0.12.2/src/hub.rs:960:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
% cat ~/.pam_environment
XDG_RUNTIME_DIR=/run/user/0

I also tried to set the uid to 1000 as this is my user without sudo, but the result is the same. I've also tried to set the .pam_environment to /root/.pam_environment, but it doesn't work, too.

@GyulyVGC
Copy link
Owner

Looking online I saw a bunch of discussions mentioning this problem, try checking this one for instance.

Keep me updated!

@wofwofwof
Copy link
Author

Hello GyulyVGC,

The thread you've linked seems to have the problem of missing entries for the XDG_RUNTIME_DIR variable.
I've tried a few things:

% sudo bash
# export XDG_RUNTIME_DIR=/run/user/0
# RUST_BACKTRACE=full /home/myuser/.cargo/bin/sniffnet
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /home/myuser/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-core-0.12.2/src/hub.rs:960:9
stack backtrace:
   0:     0x5578cd61d2c0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h591808416c41e0db
   1:     0x5578cd3b06be - core::fmt::write::h32120f18eb099fb0
   2:     0x5578cd5f4c04 - std::io::Write::write_fmt::h5120f968441dcf61
   3:     0x5578cd61e6e3 - std::panicking::default_hook::{{closure}}::ha3b399c84dfd3950
   4:     0x5578cd61e39b - std::panicking::default_hook::h23c1de61997507b7
   5:     0x5578cd59132e - sniffnet::main::{{closure}}::h2c85f031d1de39f3
   6:     0x5578cd61f37b - std::panicking::rust_panic_with_hook::hf54f54e71167af35
   7:     0x5578cd61f1b3 - std::panicking::begin_panic_handler::{{closure}}::h507de2259e8e1ea3
   8:     0x5578cd61f14c - std::sys_common::backtrace::__rust_end_short_backtrace::h9db799e5e5917087
   9:     0x5578cd61f121 - rust_begin_unwind
  10:     0x5578cd313db2 - core::panicking::panic_fmt::h597fac4e15471a4b
  11:     0x5578cd313eac - core::panicking::panic::h1f1b2313b7733f31
  12:     0x5578cd53e552 - futures_executor::local_pool::block_on::h5e774598ae7dfe12
  13:     0x5578cd34c218 - iced_winit::application::run::he46ceeedf6e69262
  14:     0x5578cd5903f6 - sniffnet::main::h741f633be61b02cc
  15:     0x5578cd5a7b83 - std::sys_common::backtrace::__rust_begin_short_backtrace::h74c5e3cdc50ff1e7
  16:     0x5578cd58f06c - main
  17:     0x7f69ad5e634c - <unknown>
  18:     0x7f69ad5e63fc - __libc_start_main
  19:     0x5578cd33bac1 - _start
  20:                0x0 - <unknown>

Do you have any other idea how I can debug that problem?

Thank you very much.

@GyulyVGC
Copy link
Owner

In the next days I'll do more careful researches.

In the meantime, let me know if you manage to fix the issue.

@GyulyVGC
Copy link
Owner

Can you try doing sudo apt-get install xdg-utils --fix-missing, closing the shell and opening Sniffnet from a new shell?

Also try checking issue #23. It has the same error message when trying to push a button after the application is started. I don’t think it’s much related even if the error is the same, but who knows.

@wofwofwof
Copy link
Author

Can you try doing sudo apt-get install xdg-utils --fix-missing, closing the shell and opening Sniffnet from a new shell?

I've reinstalled xdg-utils (emerge -av xdg-utils as it is gentoo) and opened a new shell but it doesn't change anything.

Also try checking issue #23. It has the same error message when trying to push a button after the application is started. I don’t think it’s much related even if the error is the same, but who knows.

I don't think the problem is with xdg-utils. If I use

export XDG_RUNTIME_DIR=/run/user/0

the XDG_RUNTIME_DIR is not shown anymore. I still get only a glimps of the frame of the application, and then it crashes with the above error message. The libpcap-dev is installed. Is there a dependency that you use for the graphic that is missing? As I use gentoo and not a debian distribution maybe there is some difference here?

@GyulyVGC
Copy link
Owner

Actually yes and that may be the problem.
The GUI library I used relies on wgpu and here you can find the supported platforms.

@GyulyVGC GyulyVGC changed the title Crashes on start Crashes on start on OS Gentoo stable Nov 24, 2022
@wofwofwof
Copy link
Author

Hello GyulyVGC,

thanks a lot for your help, now it works.

I think the reason for the crash was that vulkan was installed, but not with support for X. I think wgpu has only detected the vulkan driver but not that it doesn't work so it hasn't used OpenGL. After adding "media-libs/vulkan-loader X" to my use flags it starts and works. For the start the XDG_RUNTIME_DIR doesn't matter.

@GyulyVGC GyulyVGC added the renderer Problem related to the renderer used by the GUI library label Feb 26, 2023
@GyulyVGC GyulyVGC added the Linux Something related to Linux operating system label May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Linux Something related to Linux operating system renderer Problem related to the renderer used by the GUI library
Projects
None yet
Development

No branches or pull requests

2 participants