#include "SDL/SDL.h"
int main(void)
{
int ret = SDL_Init(SDL_INIT_VIDEO);
SDL_Quit();
return ret;
}
#gcc -lSDL test.c
# ./a.out
# valgrind --tool=memcheck ./a.out
==25213== Memcheck, a memory error detector.
==25213== Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward et al.
==25213== Using LibVEX rev 1471, a library for dynamic binary translation.
==25213== Copyright (C) 2004-2005, and GNU GPL'd, by OpenWorks LLP.
==25213== Using valgrind-3.1.0, a dynamic binary instrumentation framework.
==25213== Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et al.
==25213== For more details, rerun with: -v
==25213==
--25213-- WARNING: unhandled syscall: 311
--25213-- You may be able to write your own handler.
--25213-- Read the file README_MISSING_SYSCALL_OR_IOCTL.
==25213== Syscall param write(buf) points to uninitialised byte(s)
==25213== at 0xC7EF13: __write_nocancel (in /lib/libc-2.4.so)
==25213== by 0x406150E: _X11TransWrite (in /usr/lib/libX11.so.6.2.0)
==25213== by 0x4067436: (within /usr/lib/libX11.so.6.2.0)
==25213== by 0x406753A: _XReply (in /usr/lib/libX11.so.6.2.0)
==25213== by 0x404D351: XInternAtom (in /usr/lib/libX11.so.6.2.0)
==25213== by 0x491C517: (within /usr/lib/libSDL-1.2.so.0.7.2)
==25213== by 0x491D315: (within /usr/lib/libSDL-1.2.so.0.7.2)
==25213== by 0x49117E0: SDL_VideoInit (in /usr/lib/libSDL-1.2.so.0.7.2)
==25213== by 0x48E4B20: SDL_InitSubSystem (in /usr/lib/libSDL-1.2.so.0.7.2)
==25213== by 0x48E4B66: SDL_Init (in /usr/lib/libSDL-1.2.so.0.7.2)
==25213== by 0x8048480: main (in /home/david/intertech/settop/new/a.out)
==25213== Address 0x41303A6 is 14 bytes inside a block of size 16,384 alloc'd
==25213== at 0x40045EB: calloc (vg_replace_malloc.c:279)
==25213== by 0x40521A6: XOpenDisplay (in /usr/lib/libX11.so.6.2.0)
==25213== by 0x491D157: (within /usr/lib/libSDL-1.2.so.0.7.2)
==25213== by 0x49117E0: SDL_VideoInit (in /usr/lib/libSDL-1.2.so.0.7.2)
==25213== by 0x48E4B20: SDL_InitSubSystem (in /usr/lib/libSDL-1.2.so.0.7.2)
==25213== by 0x48E4B66: SDL_Init (in /usr/lib/libSDL-1.2.so.0.7.2)
==25213== by 0x8048480: main (in /home/david/intertech/settop/new/a.out)
==25213==
==25213== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 24 from 1)
==25213== malloc/free: in use at exit: 21,410 bytes in 290 blocks.
==25213== malloc/free: 1,635 allocs, 1,345 frees, 191,289 bytes allocated.
==25213== For counts of detected errors, rerun with: -v
==25213== searching for pointers to 290 not-freed blocks.
==25213== checked 255,232 bytes.
==25213==
==25213== LEAK SUMMARY:
==25213== definitely lost: 112 bytes in 5 blocks.
==25213== possibly lost: 0 bytes in 0 blocks.
==25213== still reachable: 21,298 bytes in 285 blocks.
==25213== suppressed: 0 bytes in 0 blocks.
==25213== Use --leak-check=full to see details of leaked memory.