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

Panic when running on Linux without X11 or Wayland #6

Closed
getchoo opened this issue Nov 20, 2024 · 1 comment
Closed

Panic when running on Linux without X11 or Wayland #6

getchoo opened this issue Nov 20, 2024 · 1 comment

Comments

@getchoo
Copy link

getchoo commented Nov 20, 2024

First found in NixOS/nixpkgs#357156 (review).

Coming from this call, passepartui will panic with the following

thread 'main' panicked at src/components/password_store.rs:76:41:
called `Result::unwrap()` on an `Err` value: Unknown { .. } - "Unknown error while interacting with the clipboard: X11 server connection timed out because it was unreachable"
stack backtrace:
   0:     0x55aafecd2dad - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h9754a6437f1de22a
   1:     0x55aafec5460b - core::fmt::write::hb706a393bb60a06f
   2:     0x55aafecdafcf - std::io::Write::write_fmt::h9b447dc5d824d0bd
   3:     0x55aafed077e5 - std::panicking::default_hook::{{closure}}::h227952daede9dd84
   4:     0x55aafed07407 - std::panicking::default_hook::h31626ee1feb8ee2a
   5:     0x55aafed07f38 - std::panicking::rust_panic_with_hook::h76d2aa694a00748e
   6:     0x55aafecd33a7 - std::panicking::begin_panic_handler::{{closure}}::h8855a344ffa1638b
   7:     0x55aafecd2fc9 - std::sys::backtrace::__rust_end_short_backtrace::h3110d0cbfbf26886
   8:     0x55aafed079a4 - rust_begin_unwind
   9:     0x55aafec27f33 - core::panicking::panic_fmt::h3af706d0346c1c60
  10:     0x55aafec27aa6 - core::result::unwrap_failed::h2ba69a02b8a8418b
  11:     0x55aafec7b6a4 - passepartui::components::password_store::PasswordStore::new::h86e3c8e578b0c68d
  12:     0x55aafec97ef0 - passepartui::main::h30da54bf67128974
  13:     0x55aafec92ec3 - std::sys::backtrace::__rust_begin_short_backtrace::h25b594d9507393f9
  14:     0x55aafec8b99c - std::rt::lang_start::{{closure}}::h6d1cb3f06454384e
  15:     0x55aafed0abb3 - std::rt::lang_start_internal::h2084fce485147f46
  16:     0x55aafec9886c - main
  17:     0x7ff6906e727e - __libc_start_call_main
  18:     0x7ff6906e7339 - __libc_start_main_alias_2
  19:     0x55aafec350e5 - _start
  20:                0x0 - <unknown>

From a quick look, the culprit (aside from this usage of unwrap()) is in the arboard crate itself. The Linux backend first tries to use Wayland if available and running, and then X11 here; however, neither will be available when running from a real TTY, which passepartui should be able to

@kardwen
Copy link
Owner

kardwen commented Nov 20, 2024

Thanks for the report! I will try to eliminate any stray unwrap calls for the next version.

kardwen added a commit that referenced this issue Nov 20, 2024
* Update README
* Prevent panic when clipboard creation fails (fixes #6)
* Replace unwrap calls
* Refactor password table scrollbar
* Fix clippy warning
* Improve help instructions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants