Skip to content

Deadlocks in player.c #574

Open
Open

Description

@mahkoh

We have a serious problem with deadlocks in player.c. When the player asks the UI thread for the next track, it will block until the UI thread responds and continues to hold one of the player locks while it waits. If the UI thread at the same time tries to acquire one of the player locks for some reason (e.g. to change the track manually) we have a deadlock.

I've discovered this while debugging another problem that caused cmus_get_next to be called in rapid succession. Luckily this doesn't seem to happen that often normally.

Right now I see two ways to fix this:

  • Make cmus_get_next async: This is hard because the player code is very complicated and uses a completely synchronous design.
  • Release the locks while waiting in cmus_get_next: This is easier but still quite complicated. It is unclear which invariants could be violated if we temporarily release the lock.

Activity

  1. added 3 commits that reference this issue on Dec 2, 2017
    ee368a1
    5ac26dd
    cbaf983
  2. flyingmutant commented on Jan 24, 2018

    @flyingmutant
    Member

    Reopening because of #754

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