Skip to content

[BUG] Crash when trying to search lyrics on the internet #649

Open

Description

@lucas-mior

Describe the bug
ncmpcpp crashes when trying to search lyrics from the internet

To Reproduce
Steps to reproduce the behavior:

  1. Configure lyrics fetchers in .config/ncmpcpp/config:
lyrics_fetchers = internet
  1. Go lyrics interface when listeting to a song without saved lyrics and wait.

Expected behavior
To not crash and possibly print an URL pointing to the lyrics.

Screenshots/Logs
The error message is:
ncmpcpp: /usr/include/boost/optional/detail/union_optional.hpp:580: constexpr T& boost::optional<T>::get() [with T = boost::optional<std::__cxx11::basic_string<char> >; reference_type = boost::optional<std::__cxx11::basic_string<char> >&]: Assertion "this->is_initialized()" failed.rnet... zsh: IOT instruction (core dumped) ncmpcpp

Desktop (please complete the following information):

  • OS: Linux
  • Terminal: [e.g. zsh]
  • Version 0.10.1

Activity

  1. shan995-cell commented on May 21, 2026

    @shan995-cell

    I can affirm this bug. It seems that it also happens even with just lyrics_fetchers = tags in the config.

    Fetching lyrics from tags... ncmpcpp: /usr/include/boost/optional/detail/union_optional.hpp:580: constexpr T& boost::optional<T>::get() [with T = boost::optional<std::__cxx11::basic_string<char> >; reference_type = boost::optional<std::__cxx11::basic_string<char> >&]: Assertion `this->is_initialized()' failed.
                                                                                                     fish: Job 1, 'ncmpcpp' terminated by signal SIGABRT (Abort)
    

    Using 0.10.1, Artix Linux, fish shell.

  2. cornelius-sevald commented on Jul 12, 2026

    @cornelius-sevald

    I am getting the same error (ncmpcpp v0.10.1, on Arch Linux).
    From poking around it seems that if the future value of m_worker is boost::none this line

    auto lyrics = m_worker.get();

    will try and access the (non-existent) optional value and crash.
    I don't know enough about C++ or boost to know why this happens.

    I've tried to fix it by changing the boost::optional<std::string> type to a std::pair<bool, std::string>, the change is here: cornelius-sevald@de286ff
    It seems to work, but I'm not very proficient in C++ so judge for yourself. Hope it helps :)

  3. alkino commented on Sep 21, 2026

    @alkino
    Contributor

    Can you confirm that the bug is fixed with the last master?

  4. shan995-cell commented on Oct 1, 2026

    @shan995-cell

    hello @alkino

    i compiled ncmpcpp from source and it seems that your merged fixed works, thank you for your contribution !!

    hopefully we see a new ncmpcpp release soon

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions