[teeworlds] Re: no openGL leads to SEGV

  • From: "Magnus Auvinen" <magnus.auvinen@xxxxxxxxx>
  • To: teeworlds@xxxxxxxxxxxxx
  • Date: Fri, 16 Jan 2009 00:20:19 +0100

Thanks,

I've cleaned it up a bit and made gfx_init return 0 on success,
otherwise an error code. Going to commit it when I get time to do it.

.Magnus Auvinen

On Thu, Jan 15, 2009 at 7:09 PM, Alain TAUCH
<contrib@xxxxxxxxxxxxxxxxxxx> wrote:
> Hi all,
>
> I had a SEGV when trying to run teeworlds (client) on a linux box without
> OpenGL support. This is due to a bad check of gfx_init() return code.
>
> Here's a fix:
>
> --- src/engine/client/ec_client.c.ori   2009-01-15 18:42:45.000000000 +0100
> +++ src/engine/client/ec_client.c       2009-01-15 18:42:57.000000000 +0100
> @@ -1521,7 +1521,7 @@
>        snapshot_parts = 0;
>
>        /* init graphics and sound */
> -       if(!gfx_init())
> +       if(1 != gfx_init())
>                return;
>
>        /* start refreshing addresses while we load */
>
>
> Here's the backtrace for anyone interested:
>
> [496f74ee][gfx]: unable to set video mode: Couldn't find matching GLX visual
> [496f74ee][gfx]: out of ideas. failed to init graphics
>
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 0xb6d40900 (LWP 23500)]
> 0xb7a039f9 in ____strtod_l_internal () from /lib/tls/i686/cmov/libc.so.6
> (gdb) bt
> #0  0xb7a039f9 in ____strtod_l_internal () from /lib/tls/i686/cmov/libc.so.6
> #1  0xb7a00fc9 in strtod () from /lib/tls/i686/cmov/libc.so.6
> #2  0xb7cf3219 in ?? () from /usr/lib/libGLU.so.1
> #3  0xb7cfac13 in gluBuild2DMipmaps () from /usr/lib/libGLU.so.1
> #4  0x08089fc7 in gfx_load_texture_raw (w=32, h=32, format=0, data=0x8580a1c, 
> store_format=0, flags=0)
>    at src/engine/client/ec_gfx.c:541
> #5  0x0808a0f0 in gfx_load_texture (filename=0x80adeee "editor/checker.png", 
> store_format=0, flags=0)
>    at src/engine/client/ec_gfx.c:582
> #6  0x0808e1b0 in editor_init () at src/game/editor/ed_editor.cpp:2646
> #7  0x08087918 in client_run () at src/engine/client/ec_client.c:1531
> #8  0x08088202 in main (argc=1, argv=0xbf99ac04) at 
> src/engine/client/ec_client.c:1887
> (gdb) q
>
>
> Cheers,
>
> --
> Alain TAUCH
>
>

Other related posts: