| Summary: | valgrind memory not released .. | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Sylvain <sylvain.becker> |
| Component: | *don't know* | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | 0.0.0.0, icculus, jightuse, jones |
| Version: | HG 2.0 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Attachments: | example | ||
|
Description
Sylvain
2013-09-04 20:24:14 UTC
Can you post the code that generated those warnings? It's possible that it's a legitimate leak in the X11 libraries. Created attachment 1321 [details]
example
Here's a sample program with only init/window/renderer. This is a bug in Xlib, which has existed since forever. We should go send x.org a patch, so this stops coming up in SDL. If you google for _XimSetICValueData, all the results are Valgrind reports about SDL. :( --ryan. *** Bug 2305 has been marked as a duplicate of this bug. *** Someone provided a patch for this, recently on the mailing list :
-----
Hi,
it is possible to skip the bug in libX11 by using the defaults for
XNResourceName and XNResourceClass in `XCreateIC' (the table for the
"Input Context Values" [1] in libX11-doc shows that a default is
provided if it is not set).
diff -ur SDL2-2.0.3~/src/video/x11/SDL_x11window.c SDL2-2.0.3/src/video/x11/SDL_x11window.c
--- SDL2-2.0.3~/src/video/x11/SDL_x11window.c 2014-04-04 17:09:40.764307181 +0200
+++ SDL2-2.0.3/src/video/x11/SDL_x11window.c 2014-04-04 17:10:23.887765046 +0200
@@ -239,8 +239,7 @@
data->ic =
X11_XCreateIC(videodata->im, XNClientWindow, w, XNFocusWindow, w,
XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
- XNResourceName, videodata->classname, XNResourceClass,
- videodata->classname, NULL);
+ NULL);
}
#endif
data->created = created;
Tito Latini
[1] http://www.x.org/releases/X11R7.7-RC1/doc/libX11/libX11/libX11.html#Input_Context_Values
It seems to work, but there is also another memory leak in :
==17670== at 0x4C2A2DB: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==17670== by 0x72BE4F0: XGetWindowProperty (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==17670== by 0x4F0BFA7: X11_DispatchEvent (SDL_x11events.c:570)
==17670== by 0x4F0CA77: X11_PumpEvents (SDL_x11events.c:1013)
==17670== by 0x4E7F5E8: SDL_PollEvent_REAL (SDL_events.c:402)
Missing a:
X11_XFree(property);
Fixed, thanks! https://hg.libsdl.org/SDL/rev/d838991b3fb0 https://hg.libsdl.org/SDL/rev/0c9660fdf9bf Marking this bug fixed. *** Bug 2493 has been marked as a duplicate of this bug. *** Hi, I reopen it, because with newest ubuntu 14.04, this one appears : ==20917== at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==20917== by 0x9301A11: ??? (in /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0) ==20917== by 0x92DA600: ??? (in /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0) ==20917== by 0x92D6E7A: ??? (in /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0) ==20917== by 0x92D760F: glXChooseVisual (in /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0) ==20917== by 0x4F146D7: X11_GL_LoadLibrary (SDL_x11opengl.c:525) ==20917== by 0x4F065DC: SDL_CreateWindow_REAL (SDL_video.c:2415) ==20917== by 0x4F0637F: SDL_VideoInit_REAL (SDL_video.c:193) ==20917== by 0x4E4992E: SDL_Init_REAL (SDL.c:173) Please open new bugs for new memory leaks. Thanks! |