Hi,

On Fri, Apr 01, 2011 at 03:39:16AM +0300, Antti Harri wrote:
> > After this, you should be able to get a backtrace with gdb.
> 
> (gdb) bt
> #0  0x00000002079e33fa in kill () from /usr/lib/libc.so.58.0
> #1  0x0000000207a3e4a1 in abort () at /usr/src/lib/libc/stdlib/abort.c:68
> #2  0x0000000207a3bf65 in wrterror (msg=Variable "msg" is not available.) at 
> /usr/src/lib/libc/stdlib/malloc.c:387
> #3  0x0000000207a3d48d in free (ptr=0x20e5e5d00) at 
> /usr/src/lib/libc/stdlib/malloc.c:1328
> #4  0x000000020625178c in SDL_JoystickClose () from 
> /usr/local/lib/libSDL.so.8.0
> #5  0x000000000042824c in cleanup () at src/init.cpp:467
> #6  0x0000000207a351e9 in __cxa_finalize (dso=0x0) at 
> /usr/src/lib/libc/stdlib/atexit.c:153
> #7  0x0000000207a1809a in exit (status=0) at 
> /usr/src/lib/libc/stdlib/exit.c:57
> #8  0x000000000043ad14 in title () at src/title.cpp:424
> #9  0x000000000043e1d3 in main (argc=1, argv=0x7f7ffffd5dd8) at 
> src/main.cpp:203
> 
> The fault seems to be that it tries to close joysticks that I don't have at 
> src/init.cpp:467.
> 
> This debug
> for(int i=0;i<SDL_NumJoysticks();i++)
>    printf("%s\n", SDL_JoystickName(i));
> 
> prints this:
> /dev/uhid0
> /dev/uhid1
> /dev/uhid2
> 
> I have logitech's keyboard, so is this SDL's bug?

No idea (yet), but I've seen strange results on arm (which needs some
additional diffs to even compile), too:

        $ blobwars 
        Warning: Couldn't set 44100 Hz 16-bit audio - Reason: /dev/uhid3: Device
        not configured
        Sound and Music will be disabled

This is well-spotted, there are no uhids attached to my armish at
all ;-)

> Attached is a patch that fixed the abort trap for me.

Thanks, I'll add this to the other patches I have so far.

Ciao,
        Kili

> 
> diff --git games/blobwars/Makefile games/blobwars/Makefile
> index 43f9925..c65d04a 100644
> --- games/blobwars/Makefile
> +++ games/blobwars/Makefile
> @@ -3,7 +3,7 @@
>  COMMENT =    2D arcade game
>  
>  DISTNAME =   blobwars-1.18
> -REVISION =   0
> +REVISION =   1
>  
>  CATEGORIES = games
>  
> diff --git games/blobwars/patches/patch-src_init_cpp 
> games/blobwars/patches/patch-src_init_cpp
> new file mode 100644
> index 0000000..0675ced
> --- /dev/null
> +++ games/blobwars/patches/patch-src_init_cpp
> @@ -0,0 +1,17 @@
> +$OpenBSD$
> +--- src/init.cpp.orig        Fri Apr  1 03:03:11 2011
> ++++ src/init.cpp     Fri Apr  1 03:29:23 2011
> +@@ -461,9 +461,11 @@ void cleanup()
> +     if (SDL_NumJoysticks() > 0)
> +     {
> +             SDL_JoystickEventState(SDL_DISABLE);
> +-            for (int i = 0 ; i < SDL_NumJoysticks() ; i++)
> ++            // Blobwars tries to open only the first joystick,
> ++            // so test only the first here as well.
> ++            if (SDL_JoystickOpened(0))
> +             {
> +-                    debug(("Closing Joystick #%d - %s...\n", i, 
> SDL_JoystickName(i)));
> ++                    debug(("Closing Joystick #%d - %s...\n", 0, 
> SDL_JoystickName(0)));
> +                     SDL_JoystickClose(config.sdlJoystick);
> +             }
> +     }

Reply via email to