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

[BUG] Invalid variant: OperatingSystem #270

Closed
dr-kristau opened this issue Jan 9, 2023 · 10 comments
Closed

[BUG] Invalid variant: OperatingSystem #270

dr-kristau opened this issue Jan 9, 2023 · 10 comments

Comments

@dr-kristau
Copy link

dr-kristau commented Jan 9, 2023

Describe the bug
Macchina crashes on Fedora 37

To Reproduce
Steps to reproduce the behavior:

  1. $ cargo install macchina
  2. $ macchina

Screenshot

$ RUST_BACKTRACE=full macchina
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "Invalid variant: OperatingSystem
"', /home/xxx/.cargo/registry/src/github.com-1ecc6299db9ec823/macchina-6.1.7/src/data/mod.rs:142:61
stack backtrace:
   0:     0x5636dcf5d363 - std::backtrace_rs::backtrace::libunwind::trace::he615646ea344481f
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/../../b
acktrace/src/backtrace/libunwind.rs:93:5
   1:     0x5636dcf5d363 - std::backtrace_rs::backtrace::trace_unsynchronized::h6ea8eaac68705b9c
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/../../b
acktrace/src/backtrace/mod.rs:66:5
   2:     0x5636dcf5d363 - std::sys_common::backtrace::_print_fmt::h7ac486a935ce0bf7
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys_com
mon/backtrace.rs:65:5
   3:     0x5636dcf5d363 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::
fmt::h1b5a095d3db2e28f
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys_com
mon/backtrace.rs:44:22
   4:     0x5636dcf0613e - core::fmt::write::h445545b92224a1cd
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/fmt/mo
d.rs:1209:17
   5:     0x5636dcf35c54 - std::io::Write::write_fmt::h55a43474c6520b00
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/io/mod.
   6:     0x5636dcf5e327 - std::sys_common::backtrace::_print::h65d20526fdb736b0
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys_com
   7:     0x5636dcf5e327 - std::sys_common::backtrace::print::h6555fbe12a1cc41b
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys_com
   8:     0x5636dcf5e0c5 - std::panicking::default_hook::{{closure}}::hbdf58083140e7ac6
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicki
   9:     0x5636dcf5e808 - std::panicking::default_hook::haef8271c56b74d85
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicki
  10:     0x5636dcf5e808 - std::panicking::rust_panic_with_hook::hfd45b6b6c12d9fa5
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicki
  11:     0x5636dcf5e4e2 - std::panicking::begin_panic_handler::{{closure}}::hf591e8609a75bd4b
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:579:13
  12:     0x5636dcf5e44c - std::sys_common::backtrace::__rust_end_short_backtrace::h81899558795e4ff7
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/sys_common/backtrace.rs:137:18
  13:     0x5636dcf5e421 - rust_begin_unwind
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:575:5
  14:     0x5636dce587c2 - core::panicking::panic_fmt::h4235fa9b4675b332
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/panicking.rs:65:14
  15:     0x5636dce58a62 - core::result::unwrap_failed::ha17dbf463031a5e1
                               at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/result.rs:1791:5
  16:     0x5636dce9e883 - macchina::main::hc584daf64627989b
  17:     0x5636dce60013 - std::sys_common::backtrace::__rust_begin_short_backtrace::hdfaa8f2d097002cf
  18:     0x5636dcec066e - main
  19:     0x7f60c65bc510 - __libc_start_call_main
  20:     0x7f60c65bc5c9 - __libc_start_main_alias_2
  21:     0x5636dce5dd45 - _start
  22:                0x0 - <unknown>

System Information

  • Distribution: Fedora 37 Workstation
  • Desktop Environment: GNOME 43.2
  • Terminal: alacritty 0.11.0
  • Macchina's version: 6.1.7
@grtcdr
Copy link
Member

grtcdr commented Jan 9, 2023

OperatingSystem is a actually an invalid readout on Linux systems.

I haven't touched the codebase in very long, did macchina previously allow passing invalid readouts?

@dr-kristau
Copy link
Author

I haven't touched the codebase in very long, did macchina previously allow passing invalid readouts?

I don't know. This is the first time I've used macchina, and all I know is the error message I obtain from it when run on my system.

@grtcdr
Copy link
Member

grtcdr commented Jan 9, 2023

Linux users should not use the OperatingSystem as it is reserved for the BSDs (including macOS) and Windows. Instead, they should be using Distribution.

EDIT: It wouldn't make a lot of sense to implement both readouts on the same system, as they both represent the same thing in the Linux world.

@dr-kristau
Copy link
Author

Please feel free to close this issue if you don't feel it's relevant.

@grtcdr
Copy link
Member

grtcdr commented Jan 9, 2023

Was the answer helpful in resolving your issue?

@grtcdr
Copy link
Member

grtcdr commented Jan 9, 2023

I didn't fully read the backtrace you provided, the message "Invalid variant: OperatingSystem" made me assume that you passed -o OperatingSystem to macchina, even though you explicitly listed just the command macchina in the second step. My bad.

I can reproduce the panic on my end, I'll investigate the issue. It's most likely got to do with our recent upgrade from clap@v3 to clap@v4.

@xd-mau5
Copy link

xd-mau5 commented Jan 9, 2023

First time using the app and i have almost the same issue on Windows

macchina                                                                                                                                    
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "Invalid variant: OperatingSystem"', src\data\mod.rs:142:61
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@grtcdr grtcdr closed this as completed in 8abf983 Jan 9, 2023
@grtcdr
Copy link
Member

grtcdr commented Jan 9, 2023

Can you please build from source and confirm that 8abf983 fixes the issue?

@dr-kristau
Copy link
Author

Can you please build from source and confirm that 8abf983 fixes the issue?

Yes, that fixes it. Thank you.

@grtcdr
Copy link
Member

grtcdr commented Jan 9, 2023

Good to hear!

EDIT: The new version has been released.

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

No branches or pull requests

3 participants