Skip to content

Crash when getting brightness/contrast/volume #8

@dimaryaz

Description

@dimaryaz

Everything actually works - but, after it prints out the brightness and contrast, it crashes. (Does not print out volume, but my monitor has no speakers.)

Example:

$ monitorctl b 80
$ RUST_BACKTRACE=full monitorctl b -g
80
thread '<unnamed>' panicked at 'Unable to get brightness', src/monitor.rs:74:60
stack backtrace:
   0:     0x5615405066b0 - std::backtrace_rs::backtrace::libunwind::trace::hbb65baf894db8c68
                               at /builddir/build/BUILD/rustc-1.68.2-src/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x5615405066b0 - std::backtrace_rs::backtrace::trace_unsynchronized::h0e03ba5e809c4954
                               at /builddir/build/BUILD/rustc-1.68.2-src/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x5615405066b0 - std::sys_common::backtrace::_print_fmt::h041403450149d7c0
                               at /builddir/build/BUILD/rustc-1.68.2-src/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x5615405066b0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h243893eacc816eeb
                               at /builddir/build/BUILD/rustc-1.68.2-src/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x5615404c6a7e - core::fmt::write::hff5a41730d602293
                               at /builddir/build/BUILD/rustc-1.68.2-src/library/core/src/fmt/mod.rs:1213:17
   5:     0x5615404e6094 - std::io::Write::write_fmt::h7d17a7d392206491
                               at /builddir/build/BUILD/rustc-1.68.2-src/library/std/src/io/mod.rs:1682:15
   6:     0x561540507d5f - std::sys_common::backtrace::_print::h1af2dbf04474a957
                               at /builddir/build/BUILD/rustc-1.68.2-src/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x561540507d5f - std::sys_common::backtrace::print::h103649e0239208bd
                               at /builddir/build/BUILD/rustc-1.68.2-src/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x56154050795f - std::panicking::default_hook::{{closure}}::hc67713d71c172682
                               at /builddir/build/BUILD/rustc-1.68.2-src/library/std/src/panicking.rs:267:22
   9:     0x5615405089ed - std::panicking::default_hook::h27620c482a8179d2
                               at /builddir/build/BUILD/rustc-1.68.2-src/library/std/src/panicking.rs:286:9
  10:     0x5615405089ed - std::panicking::rust_panic_with_hook::ha6ce20655fba4305
                               at /builddir/build/BUILD/rustc-1.68.2-src/library/std/src/panicking.rs:688:13
  11:     0x5615405084c4 - std::panicking::begin_panic_handler::{{closure}}::h04e79fe6d651776e
                               at /builddir/build/BUILD/rustc-1.68.2-src/library/std/src/panicking.rs:579:13
  12:     0x56154050842c - std::sys_common::backtrace::__rust_end_short_backtrace::h054638280f769b77
                               at /builddir/build/BUILD/rustc-1.68.2-src/library/std/src/sys_common/backtrace.rs:137:18
  13:     0x561540508401 - rust_begin_unwind
                               at /builddir/build/BUILD/rustc-1.68.2-src/library/std/src/panicking.rs:575:5
  14:     0x56154048b7a2 - core::panicking::panic_fmt::hdb49e6aa04f4240c
                               at /builddir/build/BUILD/rustc-1.68.2-src/library/core/src/panicking.rs:64:14
  15:     0x5615404c73d0 - core::panicking::panic_display::h98cb762452b21538
                               at /builddir/build/BUILD/rustc-1.68.2-src/library/core/src/panicking.rs:147:5
  16:     0x5615404c737b - core::panicking::panic_str::h805631c5cd71d0a0
                               at /builddir/build/BUILD/rustc-1.68.2-src/library/core/src/panicking.rs:131:5
  17:     0x56154048ba56 - core::option::expect_failed::hb5bb9a600efe2a86
                               at /builddir/build/BUILD/rustc-1.68.2-src/library/core/src/option.rs:1924:5
  18:     0x56154048e2ff - std::sys_common::backtrace::__rust_begin_short_backtrace::h1763cd96170b12fe
  19:     0x5615404d6105 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h9ed2923132026fb6
  20:     0x561540509195 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::ha3a3557431c34d1b
                               at /builddir/build/BUILD/rustc-1.68.2-src/library/alloc/src/boxed.rs:1988:9
  21:     0x561540509195 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h135ae68a2b49a849
                               at /builddir/build/BUILD/rustc-1.68.2-src/library/alloc/src/boxed.rs:1988:9
  22:     0x561540509195 - std::sys::unix::thread::Thread::new::thread_start::h1b19f9317554c1be
                               at /builddir/build/BUILD/rustc-1.68.2-src/library/std/src/sys/unix/thread.rs:108:17
  23:     0x7ff1ae656c57 - start_thread
  24:     0x7ff1ae6dca70 - __clone3
  25:                0x0 - <unknown>
Aborted (core dumped)

It set the brightness to 80, then printed out 80, but then crashed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions