Go Back   nV News Forums > Linux Support Forums > NVIDIA Linux

Newegg Daily Deals

Reply
 
Thread Tools
Old 04-08-09, 02:06 PM   #1
Mike Playle
Registered User
 
Join Date: Sep 2005
Posts: 26
Default XvMC memory leak in 180.* / 185.* drivers

Since the 180.29 driver I've been seeing a memory leak in an application I've been developing.

I've managed to cut it down to a small program (attached) which just calls OpenGL and XvMC functions which still demonstrates the problem. To reproduce the leak:

Compile and run the attached C file:

$ gcc leak.c -lX11 -lXv -lXvMC -lXvMCNVIDIA -lGL
$ ./a.out

Also run 'top' in another window, set to sort by memory usage (press the "M" key). The 'a.out' process rapidly moves to the top of the list and its memory usage (VIRT and RES columns) steadily increases. If it is allowed to run for long enough it will eventually run out of memory and crash.

I've tried driver versions 180.29, 180.44, 185.13 and 185.19, all of which have the same problem. The previous version (177.70.33) works fine for me.

I'm using Debian 4 on x86 hardware (an Acer laptop).

Can anyone else reproduce this problem?
Attached Files
File Type: gz nvidia-bug-report.log.gz (34.7 KB, 88 views)
File Type: txt leak.c.txt (8.1 KB, 138 views)
Mike Playle is offline   Reply With Quote
Old 04-08-09, 04:42 PM   #2
Stephen Warren
Moderator
 
Stephen Warren's Avatar
 
Join Date: Aug 2005
Posts: 1,327
Default Re: XvMC memory leak in 180.* / 185.* drivers

Could you please try all the earlier 180.* releases to isolate when this happened. That'll help us locate any change that caused this. Thanks.
Stephen Warren is offline   Reply With Quote
Old 04-08-09, 04:46 PM   #3
Stephen Warren
Moderator
 
Stephen Warren's Avatar
 
Join Date: Aug 2005
Posts: 1,327
Default Re: XvMC memory leak in 180.* / 185.* drivers

Actually, I don't think there's any point trying the older 180.* releases; nothing has changed for XvMC within that range that I can see. I'll file a bug.
Stephen Warren is offline   Reply With Quote
Old 05-09-09, 06:59 AM   #4
Mike Playle
Registered User
 
Join Date: Sep 2005
Posts: 26
Default Re: XvMC memory leak in 180.* / 185.* drivers

I've investigated this a bit further with the latest pre-release driver (180.53).

The leaked memory is being allocated in nv0032XvMCStatic which sends an X extension request and allocates 3 buffers to hold the reply. These 3 buffers get allocated every time round the loop, but they're only ever freed from nv0137XvMCstatic which is called from XvMCDestroySubpicture, XvMCDestroySurface and XvMCDestroyContext. So it looks to me like these buffers are meant to be allocated once only, the first time through, just like the outer context structure.

I found a possible uninitialised variable in nv0032XvMCStatic that looks like it might be relevant. If the local at offset 0x38 from the stack pointer is non-zero then nv0032XvMCStatic just returns success without allocating the 3 buffers. However I can't find anywhere in the function where this local gets initialised. Could this have anything to do with the leak?
Mike Playle is offline   Reply With Quote
Old 05-11-09, 03:01 PM   #5
Stephen Warren
Moderator
 
Stephen Warren's Avatar
 
Join Date: Aug 2005
Posts: 1,327
Default Re: XvMC memory leak in 180.* / 185.* drivers

FYI, we've repro'd the issue and are working on a fix.
Stephen Warren is offline   Reply With Quote
Old 05-13-09, 10:32 AM   #6
Stephen Warren
Moderator
 
Stephen Warren's Avatar
 
Join Date: Aug 2005
Posts: 1,327
Default Re: XvMC memory leak in 180.* / 185.* drivers

This should be fixed in the next 185.* driver release.
Stephen Warren is offline   Reply With Quote
Old 05-13-09, 12:13 PM   #7
AaronP
NVIDIA Corporation
 
AaronP's Avatar
 
Join Date: Mar 2005
Posts: 2,487
Default Re: XvMC memory leak in 180.* / 185.* drivers

Quote:
Originally Posted by Stephen Warren View Post
This should be fixed in the next 185.* driver release.
I don't think this is actually the case -- there's a new 185.* driver coming soon that doesn't have this fix. It'll be fixed in the release after that.
AaronP is offline   Reply With Quote
Old 05-13-09, 07:01 PM   #8
jyavenard
MythTV developer
 
Join Date: Mar 2006
Posts: 413
Default Re: XvMC memory leak in 180.* / 185.* drivers

Quote:
Originally Posted by Stephen Warren View Post
This should be fixed in the next 185.* driver release.
What about the stable 180.x drivers ?
jyavenard is offline   Reply With Quote

Old 05-13-09, 11:52 PM   #9
Stephen Warren
Moderator
 
Stephen Warren's Avatar
 
Join Date: Aug 2005
Posts: 1,327
Default Re: XvMC memory leak in 180.* / 185.* drivers

I don't believe the fix is slated for 180.*
Stephen Warren is offline   Reply With Quote
Old 05-29-09, 12:43 PM   #10
Mike Playle
Registered User
 
Join Date: Sep 2005
Posts: 26
Default Re: XvMC memory leak in 180.* / 185.* drivers [FIXED]

Verified fixed in 185.18.14. Thank you very much! I'll give it a stress test overnight.
Mike Playle is offline   Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
Measuring card memory usage peter_ga NVIDIA Linux 0 05-24-12 08:07 PM
Creative drivers ? SparrowHawk General Hardware 39 11-18-02 08:03 AM
Radeon 9700 not all that? sancheuz Other Desktop Graphics Cards 200 10-12-02 09:31 PM

All times are GMT -5. The time now is 09:57 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.