We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 448 - SDL appears to have memory leaks
Summary: SDL appears to have memory leaks
Status: RESOLVED INVALID
Alias: None
Product: SDL
Classification: Unclassified
Component: main (show other bugs)
Version: 1.2.11
Hardware: x86 Linux
: P2 major
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-01 14:09 UTC by Michael Buchoff
Modified: 2007-07-01 18:11 UTC (History)
0 users

See Also:


Attachments
Output from valGrind (10.16 KB, text/plain)
2007-07-01 14:35 UTC, Michael Buchoff
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Buchoff 2007-07-01 14:09:32 UTC
There is a program called valgrind that checks other programs for 

memory-leaks.  According to valgrind, the following program causes some 

memoryleaks between the two print statements:

#include <stdio.h>
#include <SDL/SDL.h>

int main(int argc, char *argv[]) {
    fprintf(stderr, "BEFORE");
    SDL_INIT(SDL_VIDEO | SDL_AUDIO);
    fprintf(stderr, "AFTER");

    return 0;
}

I compiled it with "g++-4.1 Main.cpp -lSDL".

I was curious if anyone else was having this issue.

I'm running Ubuntu 7.04 with an ATI Mobility Radeon x1400.  If there is any other information I can provide, please let me know.

In case someone reading this hasn't heard of valgrind, there is a VERY 

brief (i.e. 30-second) tutorial at:
  http://valgrind.org/docs/manual/QuickStart.html

Thank you in advance.

Michael Buchoff
Comment 1 Michael Buchoff 2007-07-01 14:35:23 UTC
Created attachment 217 [details]
Output from valGrind
Comment 2 Michael Buchoff 2007-07-01 14:38:22 UTC
Sorry, I was mistaken on the version number.  It should be 1.2.11.
Comment 3 Ryan C. Gordon 2007-07-01 15:08:05 UTC
glibc is known to have memory leaks and uninitialized data access in dlopen(), and xlib's XIM support (which we also use) is known to leak too...both leak even when the caller properly cleans up, as we do, and have had these issues reported by Valgrind for several years now without improvements from the original developers.

For what it's worth, they aren't major leaks, but they aren't bugs in SDL.

--ryan.

Comment 4 Michael Buchoff 2007-07-01 18:11:18 UTC
Thanks for the quick response.  Have these bugs been reported to glibc and xlib?