ncspot: Minutes long hang ignoring ctrl+c when starting ncspot

Describe the bug Sometimes, not often, ncspot will hang for the longest time while starting. It’s still possible to stop it with Ctrl+C, but after a while, that isn’t possible anymore. This makes me wonder if it is somehow deadlocked. It happens on the latest commit, which is 5c1fe9331a84ed021edb4d174c2013cb27379e0b.

To Reproduce It’s not really reproducible. It happens occasionally on my devices, and when it happens, it IS reproducible, at least until the next reboot…

System (please complete the following information):

  • OS: Arch Linux (latest updates)
  • Terminal: Alacritty
  • Version: master branch, but also happens on latest release, and on previous releases.
  • Installed from: AUR

Backtrace/Debug log Debug log (until manually stopped with Ctrl+C):

[2022-11-22][10:07:09] [ncspot] [INFO] Using cached credentials
[2022-11-22][10:07:09] [ncspot::spotify] [DEBUG] No HTTP proxy set
[2022-11-22][10:07:09] [mio::poll] [TRACE] registering event source with poller: token=Token(0), interests=READABLE | WRITABLE
[2022-11-22][10:07:09] [want] [TRACE] signal: Want
[2022-11-22][10:07:09] [want] [TRACE] signal found waiting giver, notifying
[2022-11-22][10:07:09] [want] [TRACE] poll_want: taker wants!
[2022-11-22][10:07:09] [want] [TRACE] signal: Want
[2022-11-22][10:07:09] [want] [TRACE] signal: Want
[2022-11-22][10:07:09] [librespot_core::apresolve] [WARN] Ignoring blacklisted access point ap-gew4.spotify.com:4070
[2022-11-22][10:07:09] [librespot_core::apresolve] [WARN] Ignoring blacklisted access point ap-gew4.spotify.com:443
[2022-11-22][10:07:09] [librespot_core::apresolve] [WARN] Ignoring blacklisted access point ap-gew4.spotify.com:80
[2022-11-22][10:07:09] [librespot_core::apresolve] [WARN] Ignoring blacklisted access point ap-gue1.spotify.com:443
[2022-11-22][10:07:09] [librespot_core::session] [INFO] Connecting to AP "ap-guc3.spotify.com:4070"
[2022-11-22][10:07:09] [mio::poll] [TRACE] registering event source with poller: token=Token(1), interests=READABLE | WRITABLE
[2022-11-22][10:07:09] [mio::poll] [TRACE] deregistering event source from poller
[2022-11-22][10:07:09] [want] [TRACE] signal: Closed

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 22 (22 by maintainers)

Commits related to this issue

Most upvoted comments

Yet another crash on a version where I only made minimal changes in src/layout.rs, as it will be way easier to find the correct lines. This one happened just now while solving a styling problem with the command line. I don’t want to spam this issue, but this backtrace will be way cleaner than the previous one as almost nothing changed compared to the upstream main branch.

upstream/main…HEAD

diff --git a/src/ui/layout.rs b/src/ui/layout.rs
index 9081fa6..2581dd9 100644
--- a/src/ui/layout.rs
+++ b/src/ui/layout.rs
@@ -35,17 +35,12 @@ pub struct Layout {

 impl Layout {
     pub fn new<T: IntoBoxedView>(status: T, ev: &events::EventManager, theme: Theme) -> Layout {
-        let style = ColorStyle::new(
-            ColorType::Color(*theme.palette.custom("cmdline_bg").unwrap()),
-            ColorType::Color(*theme.palette.custom("cmdline").unwrap()),
-        );
-
         Layout {
             screens: HashMap::new(),
             stack: HashMap::new(),
             statusbar: status.into_boxed_view(),
             focus: None,
-            cmdline: EditView::new().filler(" ").style(style),
+            cmdline: EditView::new().filler(" "),
             cmdline_focus: false,
             result: Ok(None),
             result_time: None,
@@ -260,8 +255,14 @@ impl View for Layout {
         }

         if cmdline_visible {
+            let style = ColorStyle::new(
+                ColorType::Color(*printer.theme.palette.custom("cmdline_bg").unwrap()),
+                ColorType::Color(*printer.theme.palette.custom("cmdline").unwrap()),
+            );
             let printer = &printer.offset((0, printer.size.y - 1));
-            self.cmdline.draw(printer);
+            printer.with_style(style, |printer| {
+                self.cmdline.draw(printer);
+            });
         }
     }
   1      0: ncspot::register_backtrace_panic_handler::{{closure}}
   2                at ./src/main.rs:109:38
   3      1: <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call
   4                at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/alloc/src/boxed.rs:2002:9
   5      2: std::panicking::rust_panic_with_hook
   6                at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/panicking.rs:692:13
   7      3: std::panicking::begin_panic_handler::{{closure}}
   8                at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/panicking.rs:579:13
   9      4: std::sys_common::backtrace::__rust_end_short_backtrace
  10                at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/sys_common/backtrace.rs:137:18
  11      5: rust_begin_unwind
  12                at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/panicking.rs:575:5
  13      6: core::panicking::panic_fmt
  14                at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/core/src/panicking.rs:64:14
  15      7: core::result::unwrap_failed
  16                at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/core/src/result.rs:1790:5
  17      8: core::result::Result<T,E>::expect
  18                at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/core/src/result.rs:1069:23
  19      9: ncspot::spotify::Spotify::send_worker
  20                at ./src/spotify.rs:340:30
  21     10: ncspot::spotify::Spotify::set_volume
  22                at ./src/spotify.rs:372:9
  23     11: ncspot::spotify::Spotify::new
  24                at ./src/spotify.rs:78:9
  25     12: ncspot::main
  26                at ./src/main.rs:195:19
  27     13: core::ops::function::FnOnce::call_once
  28                at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/core/src/ops/function.rs:250:5
  29     14: std::sys_common::backtrace::__rust_begin_short_backtrace
  30                at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/sys_common/backtrace.rs:121:18
  31     15: std::rt::lang_start::{{closure}}
  32                at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/rt.rs:166:18
  33     16: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
  34                at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/core/src/ops/function.rs:287:13
  35     17: std::panicking::try::do_call
  36                at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/panicking.rs:483:40
  37     18: std::panicking::try
  38                at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/panicking.rs:447:19
  39     19: std::panic::catch_unwind
  40                at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/panic.rs:140:14
  41     20: std::rt::lang_start_internal::{{closure}}
  42                at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/rt.rs:148:48
  43     21: std::panicking::try::do_call
  44                at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/panicking.rs:483:40
  45     22: std::panicking::try
  46                at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/panicking.rs:447:19
  47     23: std::panic::catch_unwind
  48                at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/panic.rs:140:14
  49     24: std::rt::lang_start_internal
  50                at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/rt.rs:148:20
  51     25: std::rt::lang_start
  52                at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/rt.rs:165:17
  53     26: main
  54     27: <unknown>
  55     28: __libc_start_main
  56     29: _start
  57
  58   panicked at 'can't send message to worker: SendError(SetVolume(65535))', src/spotify.rs:340:48