[BUG] Memory Leak Problem

HI guys, I’m been using the SDL Library and i found out that there is a
memory leak problem, my program is a simple media player and its eating like
1k memory every 15 seconds. I thought it was my program and i downloaded
the kmtracer program and i checked out and found this bug. I was testing
out the program. Do you guys have any idea of what this bug is? and can it
be fixed.

[root at localhost myplayer]# ktrace ./vplay /dev/video
*** glibc detected *** ./vplay: double free or corruption (!prev):
0x08376030 * **
======= Backtrace: =========
/lib/libc.so.6[0x47b9f98e]
/lib/libc.so.6(__libc_free+0x70)[0x47ba2bd0]
/lib/libc.so.6(fclose+0x124)[0x47b910f4]
/usr/lib/libktrace.so(fork+0x42)[0xb7e191ac]
/usr/lib/libesd.so.0(esd_open_sound+0x2da)[0x49821d7c]
/usr/lib/libSDL-1.2.so.0[0x4983c09a]
/usr/lib/libSDL-1.2.so.0(SDL_AudioInit+0x1e8)[0x498352cb]
/usr/lib/libSDL-1.2.so.0(SDL_InitSubSystem+0x8e)[0x4983409e]
/usr/lib/libSDL-1.2.so.0(SDL_Init+0x23)[0x4983417c]
./vplay(main+0x57)[0x8059077]
/lib/libc.so.6(__libc_start_main+0xc6)[0x47b5558e]
./vplay[0x8054cd1]

======= Memory map: ========
08048000-08307000 r-xp 00000000 03:45 98299
/root/Desktop/player/myplayer/vplay
08307000-08317000 rw-p 002be000 03:45 98299
/root/Desktop/player/myplayer/vplay
08317000-0845b000 rw-p 08317000 00:00 0 [heap]
47b25000-47b3c000 r-xp 00000000 03:45 555432 /lib/ld-2.4.90.so
47b3c000-47b3d000 r–p 00016000 03:45 555432 /lib/ld-2.4.90.so
47b3d000-47b3e000 rw-p 00017000 03:45 555432 /lib/ld-2.4.90.so
47b40000-47c60000 r-xp 00000000 03:45 555433 /lib/libc-2.4.90.so
47c60000-47c62000 r–p 00120000 03:45 555433 /lib/libc-2.4.90.so
47c62000-47c63000 rw-p 00122000 03:45 555433 /lib/libc-2.4.90.so
47c63000-47c66000 rw-p 47c63000 00:00 0
47c68000-47c8c000 r-xp 00000000 03:45 555434 /lib/libm-2.4.90.so
47c8c000-47c8d000 r–p 00023000 03:45 555434 /lib/libm-2.4.90.so
47c8d000-47c8e000 rw-p 00024000 03:45 555434 /lib/libm-2.4.90.so
47c90000-47c92000 r-xp 00000000 03:45 555436 /lib/libdl-2.4.90.so
47c92000-47c93000 r–p 00001000 03:45 555436 /lib/libdl-2.4.90.so
47c93000-47c94000 rw-p 00002000 03:45 555436 /lib/libdl-2.4.90.so============================================

leak of 2 bytes in 1 block
libc.so.6(malloc+0x26)
libX11.so.6(_XlcCreateLC+0x87)
libX11.so.6(_XldDynamicLoad+0x3b8)
libX11.so.6(_XOpenLC+0x95)
libX11.so.6(_XrmInitParseInfo+0x1e)
libX11.so.6(_XrmGetStringDatabase+0x18)
libX11.so.6(XGetDefault+0x10e)
libXcursor.so.1(_XcursorGetDisplayInfo+0x5d8)
libXcursor.so.1(XcursorSupportARGB+0x1d)
libX11.so.6(XcursorNoticeCreateBitmap+0x1f)
libX11.so.6(XCreatePixmap+0xc7)
libSDL-1.2.so.0(X11_CreateWMCursor+0x143)
libSDL-1.2.so.0(SDL_VideoInit0x22b)
libSDL-1.2.so.0(SDL_InitSubSystem+0x12f)
libSDL-1.2.so.0(SDL_init+0x23)
???(main)
libc.so.6( _lib_start_main+0xc6)

Hello Manuel,

Tuesday, October 17, 2006, 12:52:35 AM, you wrote:

HI guys, I’m been using the SDL Library and i found out that there is a
memory leak problem, my program is a simple media player and its eating like
1k memory every 15 seconds. I thought it was my program and i downloaded
the kmtracer program and i checked out and found this bug. I was testing
out the program. Do you guys have any idea of what this bug is? and can it
be fixed.

To me that looks like a bug in ESD, not SDL.
Try using SDL with OSS or ALSA and see if the leak occurs. My guess is
it doesn’t.–
Best regards,
Peter mailto:@Peter_Mulholland