[Ohrrpgce] [ohrrpgce/ohrrpgce] music_sdl2: Freeze when playing gurgu.mid on Linux (#1196)
Ralph Versteegen
notifications at github.com
Tue Jan 26 18:43:30 PST 2021
I get a 100% reliable freeze in the music import browser, while switching away from testfiles/gurgu.mid on Linux; both with SDL_Mixer 2.0.4 on 64-bit Linux and SDL_mixer 2.0.3 on 32-bit Linux, but not when using music_sdl. This looks like a bug in SDL_Mixer's backend for playing MIDI with Timidity.
```
(gdb) info threads
Id Target Id Frame
* 1 Thread 0xf7f4f7c0 (LWP 32432) "ohrrpgce-custom" 0xf7f3b8e8 in __lll_lock_wait () from /lib/libpthread.so.0
2 Thread 0xf28ffb40 (LWP 32433) "ohrrpgce-:rcs0" 0xf7f36d5b in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
3 Thread 0xf1db7b40 (LWP 32434) "ohrrpgc:disk$0" 0xf7f36d5b in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
4 Thread 0xf15b6b40 (LWP 32435) "ohrrpgc:disk$1" 0xf7f36d5b in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
5 Thread 0xf0db5b40 (LWP 32436) "ohrrpgc:disk$2" 0xf7f36d5b in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
6 Thread 0xf05b4b40 (LWP 32437) "ohrrpgc:disk$3" 0xf7f36d5b in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
7 Thread 0xf7217b40 (LWP 32440) "PulseHotplug" 0xf77b188f in ppoll () from /lib/libc.so.6
8 Thread 0xcf4ffb40 (LWP 32441) "SDLAudioP2" 0xf7d5adf3 in Timidity_Start () from /usr/lib/libSDL2_mixer-2.0.so.0
(gdb) bt
#0 0xf7f3b8e8 in __lll_lock_wait () from /lib/libpthread.so.0
#1 0xf7f32459 in pthread_mutex_lock () from /lib/libpthread.so.0
#2 0xf7e5dccf in ?? () from /usr/lib/libSDL2-2.0.so.0
#3 0xf7d85636 in ?? () from /usr/lib/libSDL2-2.0.so.0
#4 0xf7d52812 in Mix_LockAudio () from /usr/lib/libSDL2_mixer-2.0.so.0
#5 0xf7d539c5 in Mix_FreeMusic () from /usr/lib/libSDL2_mixer-2.0.so.0
#6 0x0832b4f3 in MUSIC_STOP () at /mnt/common/ohrrpgce/spare-git/music_sdl.bas:444
#7 0x083c01c1 in MUSICPREVIEWER::UNLOAD_PREVIEW (THIS=...) at browse.bas:435
#8 0x083c0a83 in BROWSE_HOVER (TREE=..., BR=...) at browse.bas:514
...
(gdb) thread 7
[Switching to thread 7 (Thread 0xf7217b40 (LWP 32440))]
#0 0xf77b188f in ppoll () from /lib/libc.so.6
(gdb) bt
#0 0xf77b188f in ppoll () from /lib/libc.so.6
#1 0xefd5300b in pa_mainloop_poll () from /usr/lib/libpulse.so.0
#2 0xefd53799 in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#3 0xefd53875 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#4 0xf7e40d9c in ?? () from /usr/lib/libSDL2-2.0.so.0
#5 0xf7de861b in ?? () from /usr/lib/libSDL2-2.0.so.0
#6 0xf7e5d54b in ?? () from /usr/lib/libSDL2-2.0.so.0
#7 0xf7f2f517 in start_thread () from /lib/libpthread.so.0
#8 0xf77bd146 in clone () from /lib/libc.so.6
(gdb) thread 8
[Switching to thread 8 (Thread 0xcf4ffb40 (LWP 32441))]
#0 0xf7d5adf3 in Timidity_Start () from /usr/lib/libSDL2_mixer-2.0.so.0
(gdb) bt
#0 0xf7d5adf3 in Timidity_Start () from /usr/lib/libSDL2_mixer-2.0.so.0
#1 0xf7d57ad0 in TIMIDITY_GetSome () from /usr/lib/libSDL2_mixer-2.0.so.0
#2 0xf7d52d9a in music_pcm_getaudio () from /usr/lib/libSDL2_mixer-2.0.so.0
#3 0xf7d5799c in TIMIDITY_GetAudio () from /usr/lib/libSDL2_mixer-2.0.so.0
#4 0xf7d52ee8 in music_mixer () from /usr/lib/libSDL2_mixer-2.0.so.0
#5 0xf7d50ffa in mix_channels () from /usr/lib/libSDL2_mixer-2.0.so.0
#6 0xf7d844f6 in ?? () from /usr/lib/libSDL2-2.0.so.0
#7 0xf7de861b in ?? () from /usr/lib/libSDL2-2.0.so.0
#8 0xf7e5d54b in ?? () from /usr/lib/libSDL2-2.0.so.0
#9 0xf7f2f517 in start_thread () from /lib/libpthread.so.0
#10 0xf77bd146 in clone () from /lib/libc.so.6
```
Further poking around with gdb shows that `music_pcm_getaudio` on thread 8 is stuck in an infinite loop on this very short midi file (which IIRC has no notes):
```
while (len > 0 && !done) {
int consumed = GetSome(context, dst, len, &done);
if (consumed < 0) {
break;
}
if (volume == MIX_MAX_VOLUME) {
dst += consumed;
} else {
SDL_MixAudioFormat(snd, dst, music_spec.format, (Uint32)consumed, volume);
snd += consumed;
}
len -= consumed;
}
```
stepping through the function I found that `len = 8192`, `volume = MIX_MAX_VOLUME` but `consumed = 0`.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/ohrrpgce/ohrrpgce/issues/1196
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.motherhamster.org/pipermail/ohrrpgce-motherhamster.org/attachments/20210126/11439ad2/attachment.html>
More information about the Ohrrpgce
mailing list