We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1370

Summary: Random segmentation fault when using Mix_RewindMusic and Mix_SetMusicPosition with a mp3 file
Product: SDL_mixer Reporter: Vincent Prat <vinceprat>
Component: miscAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: unspecified   
Hardware: x86_64   
OS: All   
Attachments: Short C program which causes the segmentation fault
Example of mp3 file tested
Patch to fix multi-threaded seek crash in smpeg

Description Vincent Prat 2012-01-14 13:02:15 UTC
Created attachment 769 [details]
Short C program which causes the segmentation fault

The attached program crashes (I've tried it with a few mp3 file with the same result) after some iterations with the following backtrace:

#0  0x00007ffff789eb7a in memcpy () from /lib/libc.so.6
#1  0x00007ffff6cf20d7 in MPEGstream::copy_data(unsigned char*, int, bool) ()
   from /usr/lib/libsmpeg-0.4.so.0
#2  0x00007ffff6cf66d1 in MPEGaudio::fillbuffer(int) ()
   from /usr/lib/libsmpeg-0.4.so.0
#3  0x00007ffff6d08373 in MPEGaudio::loadheader() ()
   from /usr/lib/libsmpeg-0.4.so.0
#4  0x00007ffff6cf67d7 in MPEGaudio::Skip(float) ()
   from /usr/lib/libsmpeg-0.4.so.0
#5  0x00007ffff7b90dfd in ?? () from /usr/lib/libSDL_mixer-1.2.so.0
#6  0x00007ffff7b90e35 in Mix_SetMusicPosition ()
   from /usr/lib/libSDL_mixer-1.2.so.0
#7  0x0000000000400a8b in main () at bug.c:36

This bug is present in version 1.2.8 but also in 1.2.11.
Comment 1 Vincent Prat 2012-01-14 13:03:49 UTC
Created attachment 770 [details]
Example of mp3 file tested
Comment 2 Sam Lantinga 2012-01-14 19:03:35 UTC
Created attachment 771 [details]
Patch to fix multi-threaded seek crash in smpeg
Comment 3 Sam Lantinga 2012-01-14 19:05:01 UTC
This is fixed with the attached patch to smpeg.

I'll include the fixed binaries with the next SDL_mixer release.

Thanks!