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 364

Summary: SDL_DisplayYUV_SW() crashes with segment fault
Product: SDL Reporter: Fei Rao <rao.fei>
Component: videoAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED WORKSFORME QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P1    
Version: don't know   
Hardware: x86   
OS: Linux   

Description Fei Rao 2006-11-17 02:20:26 UTC
The problem is quite strange because the results differ from the way i run my program...
When running on Fedora Core 5 box(local GNOME desktop), my program works well. When running it in CygWin/X session (remote GNOME desktop), the program crashes.

After some debug work, finally i got the following information:
Breakpoint 5, SDL_DisplayYUV_SW (_this=0x8c32580, overlay=0x8c48c50, src=0xbf920d74, dst=0xbf920d6c)
    at ./src/video/SDL_yuv_sw.c:1177
1177            swdata = overlay->hwdata;
(gdb) n
1180            if ( src->x || src->y || src->w < overlay->w || src->h < overlay->h ) {
(gdb) display *swdata->display
9: *swdata->display = {flags = 147096168, format = 0x16, w = 93, h = 0, pitch = 11544, pixels = 0x2c00002,
  offset = 46137346, hwdata = 0x5, clip_rect = {x = 24, y = 0, w = 600, h = 0}, unused1 = 800, locked = 0, map = 0x0,
  format_version = 0, refcount = 0}

Please pay attention to the flags and offset members of swdata->display. The offset is almost 46 MB! i just think it's impossible.

If the information is not clear enough, please contact me at rao.fei@aricent.com
Comment 1 Fei Rao 2006-11-17 02:26:12 UTC
The following information is the back trace of core file:
(gdb) bt
#0  0x00f9f567 in SDL_DisplayYUV_SW (_this=0x8c32580, overlay=0x8c48c50, src=0xbf920d74, dst=0xbf920d6c)
    at ./src/video/SDL_yuv_sw.c:1251
#1  0x00f9d944 in SDL_DisplayYUVOverlay (overlay=0x8c48c50, dstrect=0xbf920db4) at ./src/video/SDL_yuv.c:126
Comment 2 Sam Lantinga 2007-07-06 00:53:54 UTC
Can you post a link to the crashing program and the data and steps needed to reproduce the crash?

The debug data might be a red herring.  Are you debugging this in cygwin on Windows?  The values are all wrong, which means either gdb isn't getting the right values or you have memory corruption going on.  The fact that the numbers 800 and 600 do appear in the gdb output makes me think that there's some alignment problem.

Do you know if that's the exact line it's crashing on?
Comment 3 Ryan C. Gordon 2007-07-08 23:50:43 UTC
Bumping some bugs' priorities to P1 for consideration before the 1.2.12 release (though some may not be resolved for 1.2.12).

--ryan.

Comment 4 Sam Lantinga 2007-07-15 22:09:09 UTC
Any update on this?  We're at the last minute for 1.2.12 bug fixes.
Comment 5 Sam Lantinga 2009-09-20 22:40:06 UTC
This hasn't been updated in a couple years.  Please reopen this if it's still active in 1.3.