[SDL] valgrind issues on x86_64

Johannes Bauer dfnsonfsduifb at gmx.de
Mon Nov 19 04:59:23 PST 2007


Hello list,

I'm currently running my app through valgrind and noticed it throws a
lot of errors in the SDL library. Consider this minimal snippet:

#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <SDL.h>

int main(int argc, char **argv) {
   if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0) {
      fprintf(stderr, "Couldn't initialize SDL: %s\n", SDL_GetError());
      return 1;
    }
   SDL_Quit();
   return 0;
}

which gives me, when run through valgrind a LOT of:

==23138== Invalid read of size 8
==23138==    at 0x4013DEE: (within /lib64/ld-2.6.1.so)
==23138==    by 0x4009C75: (within /lib64/ld-2.6.1.so)
==23138==    by 0x4005DA5: (within /lib64/ld-2.6.1.so)
==23138==    by 0x4007ACF: (within /lib64/ld-2.6.1.so)
==23138==    by 0x4010907: (within /lib64/ld-2.6.1.so)
==23138==    by 0x400C915: (within /lib64/ld-2.6.1.so)
==23138==    by 0x4010346: (within /lib64/ld-2.6.1.so)
==23138==    by 0x53E6FB9: (within /lib64/libdl-2.6.1.so)
==23138==    by 0x400C915: (within /lib64/ld-2.6.1.so)
==23138==    by 0x53E733C: (within /lib64/libdl-2.6.1.so)
==23138==    by 0x53E6F31: dlopen (in /lib64/libdl-2.6.1.so)
==23138==    by 0x407283A: SDL_LoadObject (in
/usr/lib64/libSDL-1.2.so.0.11.0)
==23138==  Address 0x58069B0 is 24 bytes inside a block of size 25 alloc'd
==23138==    at 0x4C20EEB: malloc (in
/usr/lib64/valgrind/amd64-linux/vgpreload_memcheck.so)
==23138==    by 0x4007FC5: (within /lib64/ld-2.6.1.so)
==23138==    by 0x4010907: (within /lib64/ld-2.6.1.so)
==23138==    by 0x400C915: (within /lib64/ld-2.6.1.so)
==23138==    by 0x4010346: (within /lib64/ld-2.6.1.so)
==23138==    by 0x53E6FB9: (within /lib64/libdl-2.6.1.so)
==23138==    by 0x400C915: (within /lib64/ld-2.6.1.so)
==23138==    by 0x53E733C: (within /lib64/libdl-2.6.1.so)
==23138==    by 0x53E6F31: dlopen (in /lib64/libdl-2.6.1.so)
==23138==    by 0x407283A: SDL_LoadObject (in
/usr/lib64/libSDL-1.2.so.0.11.0)
==23138==    by 0x40757FE: (within /usr/lib64/libSDL-1.2.so.0.11.0)
==23138==    by 0x407DC85: (within /usr/lib64/libSDL-1.2.so.0.11.0)

later on...

==23138== ERROR SUMMARY: 147 errors from 4 contexts (suppressed: 174 from 1)
==23138==    definitely lost: 10 bytes in 2 blocks.

Are those due to optimization or are they serious problems?

Greetings,
Johannes


More information about the SDL mailing list