Hello
using libSDLx11.so.0.9.9 the following sequence eats memory: (about
16Bytes)
Here is my test program, and memory debugger output for it with and without
the buggy sequence:
#include “SDL.h”
main()
SDL_Surface *tmp, *tmp2;
SDL_Init(SDL_INIT_VIDEO);
SDL_SetVideoMode(320, 200, 16, 0);
#ifdef BUGGY_SEQUENCE
tmp = SDL_AllocSurface( SDL_SWSURFACE,100,100,
32,
0x000000FF, 0x0000FF00,
0x00FF0000, 0xFF000000);
tmp2 = SDL_DisplayFormat(tmp);
SDL_FreeSurface(tmp);
SDL_FreeSurface(tmp2);
#endif
SDL_Quit();
With the buggy sequence:
926371504: 261: Top 10 allocations:
926371505: 261: total-size count in-use-size count source
926371505: 261: 60000 2 0 0 SDL_surface.c:120
926371505: 261: 5216 2 0 0 ra=0x2000015daa0
926371505: 261: 4096 2 0 0 ra=0x2000015dcb8
926371505: 261: 1664 8 0 0 ra=0x200001749a4
926371505: 261: 1024 2 0 0 ra=0x20000158e9c
926371505: 261: 800 5 160 1 ra=0x200001497d8
926371505: 261: 544 4 0 0 ra=0x20000155be8
926371505: 261: 528 2 0 0 ra=0x200006aa010
926371505: 261: 512 4 0 0 ra=0x2000015805c
926371505: 261: 77730 131 160 1 Total of 51
926371505: 261: Unfreed allocations:
926371505: 261: memory table is empty
926371505: 261: unknown memory not freed: 1 pointer, 160 bytes
Without the buggy sequence:
926371446: 239: Top 10 allocations:
926371446: 239: total-size count in-use-size count source
926371446: 239: 5216 2 0 0 ra=0x2000015daa0
926371446: 239: 4096 2 0 0 ra=0x2000015dcb8
926371446: 239: 1664 8 0 0 ra=0x200001749a4
926371446: 239: 1024 2 0 0 ra=0x20000158e9c
926371446: 239: 800 5 160 1 ra=0x200001497d8
926371446: 239: 544 4 0 0 ra=0x20000155be8
926371446: 239: 528 2 0 0 ra=0x200006aa010
926371446: 239: 512 4 0 0 ra=0x2000015805c
926371446: 239: 304 2 0 0 ra=0x200001aab60
926371446: 239: 17250 120 160 1 Total of 49
926371446: 239: Unfreed allocations:
926371446: 239: memory table is empty
926371446: 239: unknown memory not freed: 1 pointer, 160 bytes
I checked, and the 160 bytes mentioned is from within the C library.
Let me know if there are more conditions I need to reproduce the hole.
See ya,
-Sam Lantinga (slouken at devolution.com)
Lead Programmer, Loki Entertainment Software–
Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/SDL/