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 - Random segmentation fault when using Mix_RewindMusic and Mix_SetMusicPosition with a mp3 file
Summary: Random segmentation fault when using Mix_RewindMusic and Mix_SetMusicPosition...
Status: RESOLVED FIXED
Alias: None
Product: SDL_mixer
Classification: Unclassified
Component: misc (show other bugs)
Version: unspecified
Hardware: x86_64 All
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-14 13:02 UTC by Vincent Prat
Modified: 2012-01-14 19:05 UTC (History)
0 users

See Also:


Attachments
Short C program which causes the segmentation fault (926 bytes, text/x-csrc)
2012-01-14 13:02 UTC, Vincent Prat
Details
Example of mp3 file tested (1022.77 KB, audio/mpeg)
2012-01-14 13:03 UTC, Vincent Prat
Details
Patch to fix multi-threaded seek crash in smpeg (1.91 KB, patch)
2012-01-14 19:03 UTC, Sam Lantinga
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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!