View Single Post
Old 12-31-11, 08:13 AM   #1
rasterman
Registered User
 
Join Date: Sep 2008
Posts: 3
Default fd leak in nvidia drivers 2.90 (also in earlier versions down to 2.70).

if a process using opengl exec()'s itself, or for that matter execs anything, file descriptors for nvidia drivers are inherited and leaked, eventually leading to a fairly big fd leak. a list of a process (window manager with compositor) after 1 restart of itself (restart does an exec() if itself):

9:57PM /proc/1394/fd > ls -al
total 0
0 dr-x------ 2 raster raster 0 2011-12-31 21:53 ./
0 dr-xr-xr-x 7 raster raster 0 2011-12-31 21:52 ../
0 lrwx------ 1 raster raster 64 2011-12-31 21:53 0 -> /dev/null
0 lrwx------ 1 raster raster 64 2011-12-31 21:53 1 -> /home/raster/.xsession-errors
0 lrwx------ 1 raster raster 64 2011-12-31 21:53 2 -> /home/raster/.xsession-errors
0 lr-x------ 1 raster raster 64 2011-12-31 21:53 3 -> /dev/urandom
0 lrwx------ 1 raster raster 64 2011-12-31 21:53 4 -> anon_inode:[eventpoll]
0 lr-x------ 1 raster raster 64 2011-12-31 21:53 5 -> pipe:[9909]
0 l-wx------ 1 raster raster 64 2011-12-31 21:53 6 -> pipe:[9909]
0 lr-x------ 1 raster raster 64 2011-12-31 21:53 7 -> anon_inode:[eventpoll]
0 lrwx------ 1 raster raster 64 2011-12-31 21:53 8 -> pipe:[11461]
0 lr-x------ 1 raster raster 64 2011-12-31 21:53 9 -> pipe:[9911]
0 l-wx------ 1 raster raster 64 2011-12-31 21:53 10 -> pipe:[9911]
0 lr-x------ 1 raster raster 64 2011-12-31 21:53 11 -> pipe:[9912]
0 l-wx------ 1 raster raster 64 2011-12-31 21:53 12 -> pipe:[9912]
0 lr-x------ 1 raster raster 64 2011-12-31 21:53 13 -> pipe:[8974]
0 l-wx------ 1 raster raster 64 2011-12-31 21:53 14 -> pipe:[8974]
0 lr-x------ 1 raster raster 64 2011-12-31 21:53 15 -> pipe:[11461]
0 l-wx------ 1 raster raster 64 2011-12-31 21:53 16 -> anon_inode:inotify
0 lrwx------ 1 raster raster 64 2011-12-31 21:53 17 -> socket:[11462]
0 lr-x------ 1 raster raster 64 2011-12-31 21:53 18 -> pipe:[8177]
0 l-wx------ 1 raster raster 64 2011-12-31 21:53 19 -> pipe:[8177]
0 lrwx------ 1 raster raster 64 2011-12-31 21:53 20 -> pipe:[13324]
0 lrwx------ 1 raster raster 64 2011-12-31 21:53 21 -> /dev/zero
0 lr-x------ 1 raster raster 64 2011-12-31 21:53 22 -> pipe:[13324]
0 lrwx------ 1 raster raster 64 2011-12-31 21:53 23 -> pipe:[13325]
0 lrwx------ 1 raster raster 64 2011-12-31 21:53 24 -> socket:[11265]
0 lr-x------ 1 raster raster 64 2011-12-31 21:53 25 -> pipe:[13325]
0 lr-x------ 1 raster raster 64 2011-12-31 21:53 26 -> pipe:[12346]
0 lr-x------ 1 raster raster 64 2011-12-31 21:53 27 -> pipe:[12346]
0 lrwx------ 1 raster raster 64 2011-12-31 21:53 28 -> pipe:[12347]
0 lr-x------ 1 raster raster 64 2011-12-31 21:53 29 -> pipe:[12347]
0 lr-x------ 1 raster raster 64 2011-12-31 21:53 30 -> socket:[12350]
0 lrwx------ 1 raster raster 64 2011-12-31 21:53 31 -> pipe:[10498]
0 lrwx------ 1 raster raster 64 2011-12-31 21:53 32 -> pipe:[10498]
0 lr-x------ 1 raster raster 64 2011-12-31 21:53 33 -> socket:[11473]
0 lr-x------ 1 raster raster 64 2011-12-31 21:53 34 -> /dev/zero
0 lr-x------ 1 raster raster 64 2011-12-31 21:53 35 -> socket:[12351]
0 lrwx------ 1 raster raster 64 2011-12-31 21:53 36 -> socket:[12352]
0 lr-x------ 1 raster raster 64 2011-12-31 21:53 37 -> /usr/local/share/enlightenment/data/themes/default.edj
0 lr-x------ 1 raster raster 64 2011-12-31 21:53 38 -> /home/raster/.cache/efreet/desktop_cubie_en_US.eet
0 lr-x------ 1 raster raster 64 2011-12-31 21:53 40 -> /home/raster/C/svn/ssh+svn/e/trunk/THEMES/detourious/detourious.edj
0 lr-x------ 1 raster raster 64 2011-12-31 21:53 42 -> /home/raster/.e/e/backgrounds/lovely-winter-1920x1200-wallpaper-7464.edj
0 lrwx------ 1 raster raster 64 2011-12-31 21:53 43 -> socket:[13386]
0 lrwx------ 1 raster raster 64 2011-12-31 21:53 44 -> socket:[12359]
0 lrwx------ 1 raster raster 64 2011-12-31 21:53 45 -> socket:[12360]
0 lrwx------ 1 raster raster 64 2011-12-31 21:53 46 -> /dev/nvidiactl
0 lrwx------ 1 raster raster 64 2011-12-31 21:53 47 -> /dev/nvidia0
0 lrwx------ 1 raster raster 64 2011-12-31 21:53 48 -> /dev/nvidia0
0 lrwx------ 1 raster raster 64 2011-12-31 21:53 49 -> /dev/nvidia0
0 lrwx------ 1 raster raster 64 2011-12-31 21:53 50 -> /dev/nvidia0
0 lrwx------ 1 raster raster 64 2011-12-31 21:53 51 -> /dev/nvidia0
0 lrwx------ 1 raster raster 64 2011-12-31 21:53 52 -> /home/raster/.nv/GLCache/ec6f932fae7d95e478bbdf2897444f22/50dddcfccb3dc688/9eac06247e0142ee.toc
0 lrwx------ 1 raster raster 64 2011-12-31 21:53 53 -> /home/raster/.nv/GLCache/ec6f932fae7d95e478bbdf2897444f22/50dddcfccb3dc688/9eac06247e0142ee.bin
0 lrwx------ 1 raster raster 64 2011-12-31 21:53 64 -> socket:[13339]
0 lrwx------ 1 raster raster 64 2011-12-31 21:53 67 -> /dev/nvidiactl
0 lrwx------ 1 raster raster 64 2011-12-31 21:53 68 -> /dev/nvidia0
0 lrwx------ 1 raster raster 64 2011-12-31 21:53 69 -> /dev/nvidia0
0 lrwx------ 1 raster raster 64 2011-12-31 21:53 70 -> /dev/nvidia0
0 lrwx------ 1 raster raster 64 2011-12-31 21:53 71 -> /dev/nvidia0
0 lrwx------ 1 raster raster 64 2011-12-31 21:53 72 -> /dev/nvidia0
0 lrwx------ 1 raster raster 64 2011-12-31 21:53 73 -> /home/raster/.nv/GLCache/ec6f932fae7d95e478bbdf2897444f22/50dddcfccb3dc688/9eac06247e0142ee.toc
0 lrwx------ 1 raster raster 64 2011-12-31 21:53 74 -> /home/raster/.nv/GLCache/ec6f932fae7d95e478bbdf2897444f22/50dddcfccb3dc688/9eac06247e0142ee.bin
0 lr-x------ 1 raster raster 64 2011-12-31 21:53 75 -> /home/raster/.cache/efreet/icon_themes_cubie.eet (deleted)
0 lr-x------ 1 raster raster 64 2011-12-31 21:53 76 -> /home/raster/.cache/efreet/icons_gnome_cubie.eet (deleted)
0 lr-x------ 1 raster raster 64 2011-12-31 21:53 77 -> /home/raster/.cache/efreet/icons___efreet_fallback_cubie.eet (deleted)
0 lr-x------ 1 raster raster 64 2011-12-31 21:53 78 -> /home/raster/.cache/efreet/desktop_util_cubie_en_US.eet


note the /dev/nivida0 file opens as well as /home/raster/.nv/... files and that they repeat - if i keep exec()ing i'll get more and more duplicates. i suspect these files should be opened with close-on-exec and presto. problem solved.
nvidia bug log report attached.
Attached Files
File Type: gz nvidia-bug-report.log.gz (75.0 KB, 37 views)
rasterman is offline   Reply With Quote