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 2514

Summary: Memory leak on ubuntu 14.04
Product: SDL Reporter: Sylvain <sylvain.becker>
Component: *don't know*Assignee: Ryan C. Gordon <icculus>
Status: RESOLVED INVALID QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: leonardo.guilherme
Version: HG 2.1   
Hardware: x86_64   
OS: Linux   

Description Sylvain 2014-04-27 05:01:27 UTC
Hi, 

With newest ubuntu 14.04, valgrind detectes this one :

104 bytes in 1 blocks are definitely lost in loss record 97 of 152
==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)

Cheers,

Sylvain
Comment 1 Leonardo 2014-05-10 14:33:08 UTC
Hi.

That looks like a bug in mesa, as I've checked X11_GL_GetVisual and glxChooseVisual calls (which is called inside X11_GL_GetVisual), and everything it returns is free'd later before returning from the calling function (the one calling X11_GL_GetVisual).
Comment 2 Sam Lantinga 2014-05-10 19:51:02 UTC
Thanks for the update!