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

Crash when inputting numbers in boxes in GUI mode #81

Closed
ZechariahB opened this issue Sep 26, 2022 · 6 comments
Closed

Crash when inputting numbers in boxes in GUI mode #81

ZechariahB opened this issue Sep 26, 2022 · 6 comments

Comments

@ZechariahB
Copy link

When inputting numbers into the boxes, this application often crashes in GUI mode. These boxes can also be resized left or right, which is definitely not supposed to happen. Here is the crash log.

No subcommands found, starting in GUI mode. To view the possible subcommands type "legion-kb-rgb --help".
The application panicked (crashed).
Message:  called `Result::unwrap()` on an `Err` value: Unknown("An unknown error occurred!")
Location: src/gui/app.rs:102

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                ⋮ 8 frames hidden ⋮                               
   9: legion_kb_rgb::gui::app::App::start_ui::h850c2f7f08740869
      at <unknown source file>:<unknown line>
  10: legion_kb_rgb::cli::try_cli::h269fff4a84552eb4
      at <unknown source file>:<unknown line>
  11: legion_kb_rgb::main::h4795929818dda366
      at <unknown source file>:<unknown line>
  12: std::sys_common::backtrace::__rust_begin_short_backtrace::he9e2516d859af302
      at <unknown source file>:<unknown line>
  13: std::rt::lang_start::{{closure}}::h218a02376d1f626e
      at <unknown source file>:<unknown line>
  14: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h5f1ba3b861cac230
      at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/core/src/ops/function.rs:280
  15: std::panicking::try::do_call::h4febfdb770eca39d
      at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:492
  16: std::panicking::try::h8b0eac8a7d726dbf
      at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:456
  17: std::panic::catch_unwind::h11b83c489c0d8394
      at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panic.rs:137
  18: std::rt::lang_start_internal::{{closure}}::h63502d2988634103
      at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/rt.rs:128
  19: std::panicking::try::do_call::h4be475cff12d2aae
      at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:492
  20: std::panicking::try::h1a3b25b8eaf9ba31
      at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:456
  21: std::panic::catch_unwind::h224588ada67b9b0b
      at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panic.rs:137
  22: std::rt::lang_start_internal::h2807b375c1959759
      at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/rt.rs:128
  23: main<unknown>
      at <unknown source file>:<unknown line>
  24: __libc_start_call_main<unknown>
      at <unknown source file>:<unknown line>
  25: __libc_start_main_impl<unknown>
      at <unknown source file>:<unknown line>
  26: _start<unknown>
      at <unknown source file>:<unknown line>
@4JX
Copy link
Owner

4JX commented Oct 13, 2022

The latter is a problem of the GUI toolkit I'm using. As for the crash what is your OS?

@ZechariahB
Copy link
Author

OS: Fedora Linux 36 (Workstation Edition)
GNOME Version: 42.4
Windowing System: X11

The crash has a chance of occurring when replacing the 0s with numbers. Using this program in command line has no crash.

@4JX
Copy link
Owner

4JX commented Nov 4, 2022

I've been trying to reproduce this crash to no avail for a while now, mind trying to get it on video?

@ZechariahB
Copy link
Author

I've been able to reproduce this by selecting numbers with the mouse and mashing in random numbers, then doing this over and over again to other boxes. It happens if you are unlucky enough it seems, but is pretty easy to activate.

2022-11-13.04-44-42.webm

@rosszm
Copy link

rosszm commented Dec 12, 2022

I have also been experiencing this crash.

Looks like its due to app::wait_for(0.2).unwrap() at lines 100 and 104 here:

if tray_item_err {
loop {
app::wait_for(0.2).unwrap();
}
} else {
loop {
app::wait_for(0.2).unwrap();
if let Ok(msg) = window_receiver.try_recv() {
match msg {
GuiMessage::ShowWindow => win.show(),
GuiMessage::HideWindow => win.hide(),
};
};
}
}

FLTK wait_for() produces an FltkError::Unknown error on UNIX systems if a signal happens. This unhandled error appears to be what is causing the crash.

I have created a pull request with a fix: PR #97

@4JX
Copy link
Owner

4JX commented Jun 22, 2023

Fixed via 0.19.0

@4JX 4JX closed this as completed Jun 22, 2023
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

3 participants