DeaDBeeF-Player / deadbeef

DeaDBeeF Player
https://deadbeef.sourceforge.io/
Other
1.59k stars 175 forks source link

Deadlock occurring randomly in 1.9.5 #2994

Closed joshbarrass closed 8 months ago

joshbarrass commented 10 months ago

Steps to reproduce the problem

The crash seems fairly random, but I've definitely noticed it occurring near the start of a new song (seems similar to #2865, though I haven't been able to replicate the bug by spamming next song). The bug also occurs when deadbeef is paused (and I'd be inclined to say it occurs more frequently when paused). Sometimes, I can go for hours without encountering this bug, other times it occurs within a few minutes of me launching deadbeef.

What's going on? Describe the problem in as much detail as possible.

deadbeef seems to randomly lock up, with little indication of why. When this occurs, playback noticeably seems to stutter and then stop altogether, and the GUI becomes completely blank and unresponsive. My taskbar uses deadbeef --nowplaying-tf to display my currently playing song, and this process is also unresponsive, causing my taskbar to freeze. Cannot exit the software with ALT+F4, I have to kill it. I have tried using both the PulseAudio plugin and the ALSA plugin, and the problem occurs for both.

Information about the software:

Problem did not occur in 1.8.4, but has started occurring since I upgraded from that version.

Plugins installed: all standard plugins included in the deb, Musical Spectrum v0.2, and GSF Decoder (though bug occurs when not playing GSFs).

Deadbeef version: 1.9.5, installed from deb OS: Ubuntu 20.04 DE: i3

gdb dump ``` (gdb) thread apply all backtrace Thread 1 "deadbeef-main" received signal SIGINT, Interrupt. __lll_lock_wait (futex=futex@entry=0x69bf00, private=0) at lowlevellock.c:52 52 lowlevellock.c: No such file or directory. (gdb) generate-core-file warning: Memory read failed for corefile section, 4096 bytes at 0xffffffffff600000. Saved corefile core.12416 (gdb) thread apply all backtrace Thread 209 (Thread 0x7fffda53e700 (LWP 25077)): #0 __lll_lock_wait (futex=futex@entry=0x69bf00, private=0) at lowlevellock.c:52 #1 0x00007ffff7e33131 in __GI___pthread_mutex_lock (mutex=0x69bf00) at ../nptl/pthread_mutex_lock.c:115 #2 0x00000000004378f9 in () #3 0x000000000042e13d in () #4 0x00007fffee76c634 in () at /opt/deadbeef/lib/deadbeef/pulse.so #5 0x00007ffff7e30609 in start_thread (arg=) at pthread_create.c:477 #6 0x00007ffff78f7133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 Thread 208 (Thread 0x7fffd8d3b700 (LWP 25076)): #0 0x00007ffff78ea99f in __GI___poll (fds=0x7fffcc0cff10, nfds=3, timeout=1500) at ../sysdeps/unix/sysv/linux/poll.c:29 #1 0x00007fffee7441d6 in () at /lib/x86_64-linux-gnu/libpulse.so.0 #2 0x00007fffee735841 in pa_mainloop_poll () at /lib/x86_64-linux-gnu/libpulse.so.0 #3 0x00007fffee735ec3 in pa_mainloop_iterate () at /lib/x86_64-linux-gnu/libpulse.so.0 #4 0x00007fffee735f70 in pa_mainloop_run () at /lib/x86_64-linux-gnu/libpulse.so.0 #5 0x00007fffee74411d in () at /lib/x86_64-linux-gnu/libpulse.so.0 #6 0x00007fffee6e072c in () at /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-13.99.so #7 0x00007ffff7e30609 in start_thread (arg=) at pthread_create.c:477 #8 0x00007ffff78f7133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 Thread 10 (Thread 0x7fffd9d3d700 (LWP 12428)): #0 0x00007ffff78f746e in epoll_wait (epfd=10, events=0x7fffd9d3cbf0, maxevents=16, timeout=-1) at ../sysdeps/unix/sysv/linux/epoll_wait.c:30 #1 0x00007ffff7c08f72 in _dispatch_event_loop_drain () at /opt/deadbeef/bin/../lib/libdispatch.so #2 0x00007ffff7bfda42 in _dispatch_mgr_invoke () at /opt/deadbeef/bin/../lib/libdispatch.so #3 0x00007ffff7bfd98e in _dispatch_mgr_thread () at /opt/deadbeef/bin/../lib/libdispatch.so #4 0x00007ffff7c014fb in _dispatch_worker_thread () at /opt/deadbeef/bin/../lib/libdispatch.so #5 0x00007ffff7e30609 in start_thread (arg=) at pthread_create.c:477 #6 0x00007ffff78f7133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 Thread 7 (Thread 0x7fffea03c700 (LWP 12425)): #0 0x00007ffff78ea99f in __GI___poll (fds=0x2411670, nfds=2, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29 #1 0x00007ffff654f36e in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0 #2 0x00007ffff654f6f3 in g_main_loop_run () at /lib/x86_64-linux-gnu/libglib-2.0.so.0 #3 0x00007ffff62b3f8a in () at /lib/x86_64-linux-gnu/libgio-2.0.so.0 #4 0x00007ffff6578ae1 in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0 #5 0x00007ffff7e30609 in start_thread (arg=) at pthread_create.c:477 #6 0x00007ffff78f7133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 Thread 6 (Thread 0x7fffea83d700 (LWP 12424)): #0 0x00007ffff78ea99f in __GI___poll (fds=0x179f790, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29 #1 0x00007ffff654f36e in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0 #2 0x00007ffff654f4a3 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0 #3 0x00007ffff654f4f1 in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0 #4 0x00007ffff6578ae1 in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0 #5 0x00007ffff7e30609 in start_thread (arg=) at pthread_create.c:477 #6 0x00007ffff78f7133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 Thread 5 (Thread 0x7fffeb03e700 (LWP 12423)): #0 0x00007ffff78b523f in __GI___clock_nanosleep (clock_id=clock_id@entry=0, flags=flags@entry=0, req=req@entry=0x7fffeb03dd40, rem=rem@entry=0x0) at ../sysdeps/unix/sysv/linux/clock_nanosleep.c:78 #1 0x00007ffff78baec7 in __GI___nanosleep (requested_time=requested_time@entry=0x7fffeb03dd40, remaining=remaining@entry=0x0) at nanosleep.c:27 #2 0x00007ffff78ed85f in usleep (useconds=) at ../sysdeps/posix/usleep.c:32 #3 0x00007ffff1078baa in () at /opt/deadbeef/lib/deadbeef/hotkeys.so #4 0x00007ffff7e30609 in start_thread (arg=) at pthread_create.c:477 #5 0x00007ffff78f7133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 Thread 4 (Thread 0x7fffeb83f700 (LWP 12422)): #0 futex_wait_cancelable (private=, expected=0, futex_word=0x69d48c) at ../sysdeps/nptl/futex-internal.h:183 #1 __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x69d430, cond=0x69d460) at pthread_cond_wait.c:508 #2 __pthread_cond_wait (cond=0x69d460, mutex=0x69d430) at pthread_cond_wait.c:647 #3 0x0000000000437a13 in () #4 0x0000000000422fe4 in () #5 0x00000000004209a5 in () #6 0x0000000000422146 in () #7 0x00007ffff7e30609 in start_thread (arg=) at pthread_create.c:477 #8 0x00007ffff78f7133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 Thread 3 (Thread 0x7ffff53d3700 (LWP 12421)): #0 __lll_lock_wait (futex=futex@entry=0x69bf00, private=0) at lowlevellock.c:52 #1 0x00007ffff7e33131 in __GI___pthread_mutex_lock (mutex=0x69bf00) at ../nptl/pthread_mutex_lock.c:115 #2 0x00000000004378f9 in () #3 0x000000000042b05d in () #4 0x000000000040cb55 in () #5 0x000000000040c5cf in () #6 0x000000000041fd17 in () #7 0x00000000004206fa in () #8 0x0000000000420830 in () #9 0x00007ffff7e30609 in start_thread (arg=) at pthread_create.c:477 #10 0x00007ffff78f7133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 Thread 2 (Thread 0x7fffec040700 (LWP 12420)): #0 __lll_lock_wait (futex=futex@entry=0x69c1e0, private=0) at lowlevellock.c:52 #1 0x00007ffff7e33131 in __GI___pthread_mutex_lock (mutex=0x69c1e0) at ../nptl/pthread_mutex_lock.c:115 #2 0x00000000004378f9 in () #3 0x0000000000406c20 in () #4 0x000000000042f49c in () #5 0x000000000042bdfd in () #6 0x00007ffff7e30609 in start_thread (arg=) at pthread_create.c:477 #7 0x00007ffff78f7133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 Thread 1 (Thread 0x7ffff75ce340 (LWP 12416)): #0 __lll_lock_wait (futex=futex@entry=0x69bf00, private=0) at lowlevellock.c:52 #1 0x00007ffff7e33131 in __GI___pthread_mutex_lock (mutex=0x69bf00) at ../nptl/pthread_mutex_lock.c:115 #2 0x00000000004378f9 in () #3 0x000000000042a4b4 in () #4 0x00007ffff6de1e99 in () at /opt/deadbeef/lib/deadbeef/ddb_gui_GTK2.so #5 0x00007ffff654fbe8 in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0 #6 0x00007ffff654f04e in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0 #7 0x00007ffff654f400 in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0 #8 0x00007ffff654f6f3 in g_main_loop_run () at /lib/x86_64-linux-gnu/libglib-2.0.so.0 #9 0x00007ffff6a17092 in gtk_main () at /lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0 #10 0x00007ffff6dcb1c1 in () at /opt/deadbeef/lib/deadbeef/ddb_gui_GTK2.so #11 0x0000000000421ad6 in () #12 0x00007ffff77fc083 in __libc_start_main (main=0x420f90, argc=1, argv=0x7fffffffe0c8, init=, fini=, rtld_fini=, stack_end=0x7fffffffe0b8) at ../csu/libc-start.c:308 #13 0x00000000004032c9 in () ```
Oleksiy-Yakovenko commented 9 months ago

Can you check whether this issue still occurs with 1.9.6-beta1?

joshbarrass commented 9 months ago

I'll try 1.9.6-beta1 for a while and see if it's still happening. Since it seems to occur pretty randomly, with no exact reproduction process, I'll just have to use it as I normally do for a while and get back to you if it happens again.

joshbarrass commented 9 months ago

I can confirm it is still happening for me in 1.9.6-beta1. I used it for a day or so with ALSA output and had no problems, but got a freeze within half an hour of switching to PulseAudio. When I was using 1.9.5, I had it happen with both ALSA and Pulse, but so far haven't had it reoccur with ALSA in 1.9.6. Maybe it's just a coincidence, but I'll see if it happens again when using ALSA.

Oleksiy-Yakovenko commented 9 months ago

Thanks for the update.

joshbarrass commented 9 months ago

It seems much less common in 1.9.6 than in 1.9.5; I'm struggling to replicate it a second time. I'll continue to keep an eye on it and update if I can.

Is there anything I can do on my side that would help with debugging the issue if I can reproduce it again?

Oleksiy-Yakovenko commented 9 months ago

well the only thing that would be truly useful is to always run in gdb, and when the deadlock occurs -- make a break, and full backtrace of all threads. But I also understand this is pretty hard to do from user/usage perspective

Oleksiy-Yakovenko commented 8 months ago

I was revisiting bugs, and noticed that you actually posted a backtrace - also I probably didn't notice it the first time, since it was hidden under a cut.

If you could do the same thing on a debug build -- this should help investigating and fixing the issue. For now you could try using another output plugin instead of pulseaudio -- ALSA or pipewire, and see if this helps.

joshbarrass commented 8 months ago

I actually haven't been able to reproduce the crash on 1.9.6 a second time, so I have no idea what caused it last time. I stuck with the PulseAudio plugin for a while to see if I could get it to reoccur, but got nothing after a few weeks of ~daily usage. I've switched back to the ALSA plugin, as this is generally what I use, and have had no problems with it at all.

I'm happy to close this issue if you are, since I can't seem to reproduce it.

Oleksiy-Yakovenko commented 8 months ago

sounds good to me, thanks for checking. If it starts reoccurring -- let's reopen :)