Bug 105770

Summary: [AC] Memory leak in GraphicsSurfacePrivate::findFBConfigWithAlpha()
Product: WebKit Reporter: Sudarsana Nagineni (babu) <naginenis>
Component: WebGLAssignee: Sudarsana Nagineni (babu) <naginenis>
Status: RESOLVED FIXED    
Severity: Normal CC: noam, webkit.review.bot, zeno
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch
noam: review+, webkit.review.bot: commit-queue-
Patch for landing none

Description Sudarsana Nagineni (babu) 2012-12-26 09:11:53 PST
Found a memory leak in GraphicsSurfacePrivate::findFBConfigWithAlpha(). 

==21489== 14,720 bytes in 23 blocks are definitely lost in loss record 3,184 of 3,192
==21489==    at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==21489==    by 0xCB26915: XGetVisualInfo (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==21489==    by 0xC8A72CE: glXGetVisualFromFBConfig (in /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2)
==21489==    by 0x9EF97F5: WebCore::GraphicsSurfacePrivate::findFBConfigWithAlpha(__GLXFBConfigRec**, int) (GraphicsSurfaceGLX.cpp:355)
==21489==    by 0x9EF931E: WebCore::GraphicsSurfacePrivate::createPixmap(unsigned int) (GraphicsSurfaceGLX.cpp:249)
==21489==    by 0x9EF970F: WebCore::GraphicsSurfacePrivate::glxPixmap() const (GraphicsSurfaceGLX.cpp:336)
==21489==    by 0x9EF8382: WebCore::GraphicsSurface::platformGetTextureID() (GraphicsSurfaceGLX.cpp:419)
==21489==    by 0x9EF85D0: WebCore::GraphicsSurface::platformSwapBuffers() (GraphicsSurfaceGLX.cpp:454)
==21489==    by 0x9EF799B: WebCore::GraphicsSurface::swapBuffers() (GraphicsSurface.cpp:78)
==21489==    by 0x9471B07: WebCore::TextureMapperSurfaceBackingStore::swapBuffersIfNeeded(unsigned int) (TextureMapperBackingStore.cpp:45)
==21489==    by 0x56AC2C8: WebKit::LayerTreeRenderer::syncCanvas(unsigned int, unsigned int) (LayerTreeRenderer.cpp:252)

We should free the XVisualInfo returned by glXGetVisualFromFBConfig() to avoid this leak.
Comment 1 Sudarsana Nagineni (babu) 2012-12-26 09:34:15 PST
Created attachment 180753 [details]
patch
Comment 2 WebKit Review Bot 2013-01-02 02:45:55 PST
Comment on attachment 180753 [details]
patch

Rejecting attachment 180753 [details] from commit-queue.

Failed to run "[u'/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', u'--status-host=queues.webkit.org', ..." exit_code: 1 cwd: /mnt/git/webkit-commit-queue

/mnt/git/webkit-commit-queue/Source/WebCore/ChangeLog neither lists a valid reviewer nor contains the string "Unreviewed" or "Rubber stamp" (case insensitive).

Full output: http://queues.webkit.org/results/15623657
Comment 3 Sudarsana Nagineni (babu) 2013-01-02 03:04:14 PST
Created attachment 181019 [details]
Patch for landing

Updated the changelog. Thanks for reviewing!
Comment 4 WebKit Review Bot 2013-01-02 03:26:07 PST
Comment on attachment 181019 [details]
Patch for landing

Clearing flags on attachment: 181019

Committed r138614: <http://trac.webkit.org/changeset/138614>
Comment 5 WebKit Review Bot 2013-01-02 03:26:11 PST
All reviewed patches have been landed.  Closing bug.