[Ohrrpgce] [ohrrpgce/ohrrpgce] music_sdl: Crash when playing a truncated .wav (#1136)

Ralph Versteegen notifications at github.com
Sun Jul 12 18:24:09 PDT 2020


SDL_mixer 1.2.11 (Mac) and 1.2.15 (Linux) crash when loading many .wavs that have been cut short (e.g. interrupting a download). Both Mix_LoadMUS and Mix_LoadWAV seem to do so. kylekrack reported that this also happens when trying to play a .wav exported normally from Logic.

SDL_mixer 2.0.3 doesn't crash, so maybe I can find the bugfix and backport it, if it isn't already backported in hg.

On Linux the backtrace looks like
```
free(): double free detected in tcache 2

Thread 1 "ohrrpgce-custom" received signal SIGABRT, Aborted.
[Switching to Thread 0xf7644740 (LWP 18426)]
0xf7754f9d in raise () from /lib/libc.so.6
(gdb) bt
#0  0xf7754f9d in raise () from /lib/libc.so.6
#1  0xf77322b9 in abort () from /lib/libc.so.6
#2  0xf779fb1c in __libc_message () from /lib/libc.so.6
#3  0xf77a9858 in malloc_printerr () from /lib/libc.so.6
#4  0xf77ab471 in _int_free () from /lib/libc.so.6
#5  0xf7793a8c in fclose@@GLIBC_2.1 () from /lib/libc.so.6
#6  0xf7e3742b in ?? () from /usr/lib/libSDL-1.2.so.0
#7  0xf7dadc51 in Mix_LoadWAV_RW () from /usr/lib/libSDL_mixer-1.2.so.0
#8  0x08320726 in SOUND_LOAD (FILENAME=..., NUM=-1) at music_sdl.bas:650
#9  0x083b25c9 in SFXPREVIEWER::LOAD_PREVIEW (THIS=..., FILEPATH=..., BR=...) at browse.bas:447
#10 0x083b2ff2 in BROWSE_HOVER (TREE=..., BR=...) at browse.bas:533
```

And on Mac like
```
abort() called
ohrrpgce-custom(11863,0x107a6d5c0) malloc: *** error for object 0x600004421860: pointer being freed was not allocated
 

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib        	0x00007fff70f842c6 __pthread_kill + 10
1   libsystem_pthread.dylib       	0x00007fff71039bf1 pthread_kill + 284
2   libsystem_c.dylib             	0x00007fff70eee6a6 abort + 127
3   libsystem_malloc.dylib        	0x00007fff70ffcaef malloc_vreport + 545
4   libsystem_malloc.dylib        	0x00007fff70ffc8b0 malloc_report + 151
5   SDL_mixer                     	0x000000010033e8f0 WAVStream_LoadSong_RW + 495
6   SDL_mixer                     	0x00000001003333bc Mix_LoadMUS_RW + 294
7   ohrrpgce-custom               	0x000000010017fed0 MUSIC_PLAY(FBSTRING&, MUSICFORMATENUM) + 144
8   ohrrpgce-custom               	0x00000001001b8418 BROWSE_HOVER + 344
```

-- 
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/1136
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.motherhamster.org/pipermail/ohrrpgce-motherhamster.org/attachments/20200712/da082fc1/attachment.html>


More information about the Ohrrpgce mailing list