[SDL] Seg Fault while trying to display image

prushik prushik at gmail.com
Sun Apr 18 19:47:34 PDT 2010


Here is some GDB output

Code:
This GDB was configured as "x86_64-linux-gnu"...
(gdb) run
Starting program: /home/prushik/Sandbox/games/Lesser Evil/debug 
[Thread debugging using libthread_db enabled]
[New Thread 0x7f884eace6f0 (LWP 29836)]
17c1e70::17d42d0
17c1f80::17c2070
17c1fa0::17c2160
17c1fc0::17c3560
17c1fe0::17c3650
SDL Version: 1.2.13
SDL Runtime Version: 1.2.13
401214:17c2070
401214:17c2070
401200:17d42d0
0:0

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f884eace6f0 (LWP 29836)]
0x0000000000400cf6 in show (x=200, y=200, obj={fname = 0x0, surface = 0x0})
    at graphics_sdl.c:65
65		src.w = obj.surface->w;
(gdb) p obj
$1 = {fname = 0x0, surface = 0x0}
(gdb) p obj.surface
$2 = (SDL_Surface *) 0x0
(gdb) p BG
$3 = {status = {name = '\0' <repeats 31 times>, attack = 0, defense = 0, 
    health = 0, max_ammo = 0}, physics = {x = 0, y = 0, dir = 0}, image = {
    fname = 0x0, surface = 0x0}, left = 0x0, right = 0x0, up = 0x0, 
  down = 0x0, active = 0x17c1e70}
(gdb) p BG.active
$4 = (struct animation *) 0x17c1e70
(gdb) p BG.active->image
$5 = {fname = 0x401200 "./images/testbg.bmp", surface = 0x17d42d0}
(gdb) q
The program is running.  Exit anyway? (y or n) y







-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20100418/ba0d0ff8/attachment.htm>


More information about the SDL mailing list