plietar / librespot

Open Source Spotify client library
MIT License
1.14k stars 185 forks source link

librespot crashing on playback of certain tracks #212

Closed michaelherger closed 7 years ago

michaelherger commented 7 years ago

I certainly hope this is a temporary issue with Spotify's backend: I started to see crashes playing some tracks. Pick eg. spotify:user:spotify:playlist:37i9dQZF1DX8yMCqd4JdaS ("This is: Sting"). It would play a few tracks, then crash on #4 "I can't stop thinking about you..." (spotify:track:59Eg6uKmmowid9K4UV8Q8e). I've even seen similar behavior playing just this one track.

DEBUG:librespot::player: command=Load(SpotifyId(u128 { high: 14135116685404031247, low: 13481575457501427671 }), true, 0)
INFO:librespot::player: Loading track "Fields Of Gold"
DEBUG:librespot::spirc: kMessageTypeNotify "test" a94a8fe5ccb19ba61c4c0873d391e987982fbbd3 9 1499596886211
DEBUG:librespot::audio_file: File fd453e795bf5df332435b1548444dfe753064c5c already in cache
INFO:librespot::player: Track "Fields Of Gold" loaded
DEBUG:librespot::player: command=Load(SpotifyId(u128 { high: 12206408340641040227, low: 10067328197188664350 }), true, 0)
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: WireError("invalid value for enum: 13")', src/libcore/result.rs:859
stack backtrace:
   0:        0x104215e73 - std::sys::imp::backtrace::tracing::imp::unwind_backtrace::hcc709dd93d82a051
   1:        0x104219c76 - std::panicking::default_hook::{{closure}}::he392668e67778d9e
   2:        0x10421988b - std::panicking::default_hook::h2ade4aa81d4f8204
   3:        0x10421c1e7 - std::panicking::rust_panic_with_hook::h4573918fc9f80a34
   4:        0x10421c0d4 - std::panicking::begin_panic::hea1fbdbb50f104e1
   5:        0x10421bff2 - std::panicking::begin_panic_fmt::hc84782a62933404a
   6:        0x10421bf57 - rust_begin_unwind
   7:        0x104242790 - core::panicking::panic_fmt::hef95123b2596925e
   8:        0x1038995c3 - core::result::unwrap_failed::h8edcb6aecad45af0
   9:        0x10382fc2d - <core::result::Result<T, E>>::unwrap::h3402aff3df89022f
  10:        0x1039a0e60 - librespot::metadata::MetadataManager::get::{{closure}}::h50bdd39b0003ecc2
  11:        0x1037801df - <futures::future::and_then::AndThen<A, B, F> as futures::future::Future>::poll::{{closure}}::{{closure}}::h496db889c9eea8b3
  12:        0x10382bd3f - <core::result::Result<T, E>>::map::hb7c6b9815177bbd0
  13:        0x10377f436 - <futures::future::and_then::AndThen<A, B, F> as futures::future::Future>::poll::{{closure}}::hb5bf402efdc015a6
  14:        0x1038e40e8 - <futures::future::chain::Chain<A, B, C>>::poll::hbb3cb98794ba3358
  15:        0x10377ec03 - <futures::future::and_then::AndThen<A, B, F> as futures::future::Future>::poll::he78f92b04bc8befe
  16:        0x103904a76 - <alloc::boxed::Box<F> as futures::future::Future>::poll::hc9bf48e0e001e263
  17:        0x1037f4ce3 - <futures::task_impl::Spawn<F>>::poll_future::{{closure}}::hcadaf73e14cc7043
  18:        0x1037f6216 - <futures::task_impl::Spawn<T>>::enter::{{closure}}::hf1bd38db803cab99
  19:        0x10394ccf2 - futures::task_impl::set::{{closure}}::h4b3bce0f3aafb7c9
  20:        0x103822d7d - <std::thread::local::LocalKey<T>>::with::h5baed8b83136d750
  21:        0x10394cb8c - futures::task_impl::set::h64aefc6e2e890014
  22:        0x1037f5cc6 - <futures::task_impl::Spawn<T>>::enter::h03621f1e729da38e
  23:        0x1037f4b56 - <futures::task_impl::Spawn<F>>::poll_future::hb84998cd89c6b892
  24:        0x1037f50d2 - <futures::task_impl::Spawn<F>>::wait_future::h514c3fb9515592e3
  25:        0x10394664d - futures::future::Future::wait::h1ef6c9c83627e556
  26:        0x1039a3f23 - librespot::player::PlayerInternal::load_track::he2e13397f4c99216
  27:        0x1039a2b0a - librespot::player::PlayerInternal::handle_command::hf2477364f81facba
  28:        0x1039a1ef4 - librespot::player::PlayerInternal::run::h48b9d67f724785d7
  29:        0x10374f349 - librespot::player::Player::new::{{closure}}::h5ee19377f38df60d
  30:        0x10374ab37 - <std::panic::AssertUnwindSafe<F> as core::ops::FnOnce<()>>::call_once::h9211b6b95ab7ec4a
  31:        0x10370f906 - std::panicking::try::do_call::h6b72e0acc326feaa
  32:        0x10421d2ea - __rust_maybe_catch_panic
  33:        0x10370f73c - std::panicking::try::h33d29169495b92d8
  34:        0x10370e9a2 - std::panic::catch_unwind::hd5769cd422324dea
  35:        0x10370f3dc - std::thread::Builder::spawn::{{closure}}::h47c8495e22d0cda8
  36:        0x1037345fc - <F as alloc::boxed::FnBox<A>>::call_box::he7c90a34c42e70c1
  37:        0x104219194 - std::sys::imp::thread::Thread::new::thread_start::hba7593f2e1f1beb1
  38:     0x7fff9635e93a - _pthread_body
  39:     0x7fff9635e886 - _pthread_start
DEBUG:librespot::player: drop Player[0]
DEBUG:librespot::spirc: kMessageTypeNotify "test" a94a8fe5ccb19ba61c4c0873d391e987982fbbd3 10 1499596891881
DEBUG:librespot::spirc: kMessageTypeLoad "Michaels Mac mini" 2a085ebf1a1d6bd8449adc9e42b0421873fe09a9 3 0
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "SendError(..)"', src/libcore/result.rs:859
stack backtrace:
   0:        0x104215e73 - std::sys::imp::backtrace::tracing::imp::unwind_backtrace::hcc709dd93d82a051
   1:        0x104219c76 - std::panicking::default_hook::{{closure}}::he392668e67778d9e
   2:        0x10421988b - std::panicking::default_hook::h2ade4aa81d4f8204
   3:        0x10421c1e7 - std::panicking::rust_panic_with_hook::h4573918fc9f80a34
   4:        0x10421c0d4 - std::panicking::begin_panic::hea1fbdbb50f104e1
   5:        0x10421bff2 - std::panicking::begin_panic_fmt::hc84782a62933404a
   6:        0x10421bf57 - rust_begin_unwind
   7:        0x104242790 - core::panicking::panic_fmt::hef95123b2596925e
   8:        0x103899793 - core::result::unwrap_failed::h90eabdbe5f928715
   9:        0x103832f61 - <core::result::Result<T, E>>::unwrap::he856b9899a89c990
  10:        0x1039a0fc4 - librespot::player::Player::command::h727e614f140f2504
  11:        0x1039a10c2 - librespot::player::Player::load::h68abc0d7541d6549
  12:        0x1039bb806 - librespot::spirc::SpircTask::load_track::h46c243eac6cf05fc
  13:        0x1039ba9cd - librespot::spirc::SpircTask::handle_frame::h2be9b3034674c6a0
  14:        0x1039b9880 - <librespot::spirc::SpircTask as futures::future::Future>::poll::h8b8136e1cdf5142a
  15:        0x103752994 - <librespot::Main as futures::future::Future>::poll::h3483ef36ee755c29
  16:        0x10371388c - <futures::task_impl::Spawn<F>>::poll_future::{{closure}}::hd5e566cebf7d1d7e
  17:        0x103713a4f - <futures::task_impl::Spawn<T>>::enter::{{closure}}::h1292b1e97c3df1b0
  18:        0x103746fe3 - futures::task_impl::set::{{closure}}::h2aea2e669dcbc73a
  19:        0x103719581 - <std::thread::local::LocalKey<T>>::with::hcf1eb6891c92842e
  20:        0x103746f45 - futures::task_impl::set::hd584759416d7b2d7
  21:        0x1037139a6 - <futures::task_impl::Spawn<T>>::enter::h646e7c72c4411c49
  22:        0x10371381f - <futures::task_impl::Spawn<F>>::poll_future::ha18dbc601957e5a9
  23:        0x103703e4e - tokio_core::reactor::Core::run::{{closure}}::he049be8a343e1963
  24:        0x10370db34 - <scoped_tls::ScopedKey<T>>::set::hd87cb6745b0531f1
  25:        0x103703cb3 - tokio_core::reactor::Core::run::h886f44ba1912f79e
  26:        0x10375344b - librespot::main::h820867db93a8a622
  27:        0x10421d2ea - __rust_maybe_catch_panic
  28:        0x10421c5f6 - std::rt::lang_start::ha1f4f04346e51ef5
  29:        0x103753609 - main
DEBUG:librespot::spirc: drop Spirc[0]
DEBUG:librespot::session: drop Session[0]
DEBUG:librespot::audio_key: drop AudioKeyManager
DEBUG:librespot::audio_file: drop AudioFileManager
DEBUG:librespot::channel: drop ChannelManager
DEBUG:librespot::mercury: drop MercuryManager
DEBUG:librespot::metadata: drop MetadataManager
DEBUG:librespot::session: drop Dispatch

Compiled from master branch on macOS 10.12.5. But have seen reports (for my "spotty" branch) from other platforms, too.

awiouy commented 7 years ago

I see the same on LibreELEC

maxcmiller commented 7 years ago

I'm having the same problem just recently, Ubuntu 16.04 x86_64.

D54 commented 7 years ago

I have the same issue, it started a few hours ago. Ubuntu1604, ALSA sink, build from latest master(67deb07)

plietar commented 7 years ago

Thanks for the reports. Should be fixed now !

michaelherger commented 7 years ago

@plietar - thanks a lot for the super speedy reaction! Hehe... And I thought I could give this a try to better understand the code. No way would I have figured this one out :-).

Would you know what these new "OTHERx" formats would be? After all you can't handle any coded automagically in the player, can you?