# More: linux/rh7.1 + doublebuf -\> coredump

**URL:** <https://discourse.libsdl.org/t/more-linux-rh7-1-doublebuf-coredump/5238>\
**Category:** SDL Development\
**Created:** [October 11, 2001, 10:48am UTC](https://discourse.libsdl.org/t/more-linux-rh7-1-doublebuf-coredump/5238 "2001-10-11T10:48:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![James\_Mazer](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/j/4af34b/32.png) [@James\_Mazer](https://discourse.libsdl.org/u/James_Mazer)\
**Post date:** [October 11, 2001, 10:48am UTC](https://discourse.libsdl.org/t/more-linux-rh7-1-doublebuf-coredump/5238/1 "2001-10-11T10:48:01Z")

</div>

More on the segfault with DGA & SDL\_DOUBLEBUF set. I just recompiled  
the 1.2.2 libs for debugging at the segfault’s occuring in the SDL  
function DGA\_IsSurfaceBusy(). Here’s a stack trace from gdb:

mazer % sudo env SDL\_VIDEODRIVER=dga DISPLAY=:0.1 gdb ./dbuf  
GNU gdb 5.0rh-5 Red Hat Linux 7.1  
(gdb) run  
Starting program: /auto/k1/mazer/pype/pype/src/bugtest/./dbuf  
[New Thread 1024 (LWP 21610)]

Program received signal SIGSEGV, Segmentation fault.  
[Switching to Thread 1024 (LWP 21610)]  
DGA\_FlipHWSurface (this=0x8049960, surface=0x804b0b0) at SDL\_dgavideo.c:641  
641 return ((vidmem\_bucket \*)surface-\>hwdata)-\>dirty;  
(gdb) where  
#0 DGA\_FlipHWSurface (this=0x8049960, surface=0x804b0b0) at SDL\_dgavideo.c:641  
#1 0x40063c4f in DGA\_SetVideoMode (this=0x8049960, current=0x804b0b0,  
width=1024, height=768, bpp=32, flags=3221225473) at SDL\_dgavideo.c:534  
#2 0x40056d6c in SDL\_SetVideoMode (width=1024, height=768, bpp=32,  
flags=3221225473) at SDL\_video.c:608  
#3 0x08048735 in sdl\_open (w=1024, h=768, bpp=32, flags=3221225472)  
at dbuf.c:12  
#4 0x08048758 in main () at dbuf.c:18  
#5 0x401d8177 in \_\_libc\_start\_main (main=0x804873c , argc=1,  
ubp\_av=0xbffff47c, init=0x8048524 \<\_init\>, fini=0x80487b0 \<\_fini\>,  
rtld\_fini=0x4000e184 \<\_dl\_fini\>, stack\_end=0xbffff46c)  
at …/sysdeps/generic/libc-start.c:129  
(gdb) print surface  
$1 = (SDL\_Surface \*) 0x0

Something’s funny here, but I can’t seems to quite get a handle  
on what. This was working upgrading to 7.1 🙂 My original message  
is below (I’m not 100% sure it got through to the list).

/jamie

@James_Mazer writes:\> Hi,

> I just ungraded from redhat 6.2 → 7.1 and found calling SDL\_Init()  
> with SDL\_DOUBLEBUF set for the dga driver gets me a core dump (see  
> minimal prog at end of message).
> 
> If I run the test program:  
> mazer% sudo env DISPLAY=:0.1 SDL\_VIDEODRIVER=x11 ./dbuf  
> It works fine, but gets a segfault:  
> mazer% sudo env DISPLAY=:0.1 SDL\_VIDEODRIVER=dga ./dbuf  
> Fatal signal: Segmentation Fault (SDL Parachute Deployed)
> 
> Anybody else seen this behavior? The Xserver is XFree86 4.0.1  
> from the redhat 4.0.1 rpm files on the 7.1 CD. DOUBLE-BUFFER  
> and XFree86-DGA extentions are both available. It’s a current  
> version of SDL off the ftp site:  
> mazer% rpm -qa | grep SDL  
> SDL\_mixer-devel-1.2.0-1  
> SDL\_image-devel-1.2.0-1  
> SDL\_ttf-devel-2.0.3-1  
> SDL\_ttf-2.0.3-1  
> SDL-devel-1.2.2-1  
> SDL\_image-1.2.0-1  
> SDL-1.2.2-1  
> SDL\_mixer-1.2.0-1
> 
> Any ideas?? Anything? Does this mean I’ve got to go back to 6.2 ☹
> 
> /jamie
> 
> ----------------- cut here for dbuf.c --------------------  
> #include \<stdio.h\>  
> #include \<SDL/SDL.h\>
> 
> sdl\_open(int w, int h, int bpp, Uint32 flags)  
> {  
> /\* Initialize the SDL library \*/  
> if (SDL\_Init(SDL\_INIT\_VIDEO) \< 0 ) {  
> fprintf(stderr,  
> “Couldn’t initialize SDL: %s\n”, SDL\_GetError());  
> return(NULL);  
> }  
> SDL\_SetVideoMode(w, h, bpp, flags);  
> }
> 
> main()  
> {  
> sdl\_open(1024, 768, 32, SDL\_DOUBLEBUF|SDL\_FULLSCREEN);  
> SDL\_Quit();  
> }
> 
> –  
> office: 510-643-3573 mail: 3210 Tolman Hall #1650  
> lab: 510-642-1950 U.C. Berkeley  
> fax: 801-697-4179 Berkeley, CA 94720-1650  
> email: @James_Mazer

–  
office: 510-643-3573 mail: 3210 Tolman Hall #1650  
lab: 510-642-1950 U.C. Berkeley  
fax: 801-697-4179 Berkeley, CA 94720-1650  
email: @James_Mazer

---

<div class="post-metadata">

**Author:** ![James\_Mazer](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/j/4af34b/32.png) [@James\_Mazer](https://discourse.libsdl.org/u/James_Mazer)\
**Post date:** [October 11, 2001, 11:29am UTC](https://discourse.libsdl.org/t/more-linux-rh7-1-doublebuf-coredump/5238/2 "2001-10-11T11:29:00Z")

</div>

Ok folks, sorry keep following up my own posts, but looks  
like Sam already found & solved this problem for 1.2.3… I  
just came across this on the web site CVS section:

> Changes for Sun Sep 30:  
> …  
> 1.2.3: Fixed crash when using double-buffering with DGA  
> …

The CVS version (10/8/2001) does indeed seem to solve the  
problem. Thanks Sam…

/jamie–  
office: 510-643-3573 mail: 3210 Tolman Hall #1650  
lab: 510-642-1950 U.C. Berkeley  
fax: 801-697-4179 Berkeley, CA 94720-1650  
email: @James_Mazer
