Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deadlocks in player.c #574

Open
mahkoh opened this issue Oct 28, 2016 · 1 comment
Open

Deadlocks in player.c #574

mahkoh opened this issue Oct 28, 2016 · 1 comment
Labels

Comments

@mahkoh
Copy link
Member

mahkoh commented Oct 28, 2016

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.
@flyingmutant
Copy link
Member

Reopening because of #754

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants