File descriptor leak when playing recorded files ?

  • Hi all,


    I have recently purchased a Synology DS-107 NAS and I would like to use it with my DM7000 (with ****** 4.6 based on Enigma 19.12.2008 ) to increase my storage capacity for movies (my internal DM hard drive is only 40GB).
    I succeeded in mounting the NAS on the DM and playing/recording movies from it.


    But I discovered that since I access the NAS from the Dreambox, the NAS does not hibernate anymore! I need to unplug the Dreambox from the network to allow hibernation.
    After some investigation, it seems there is some kind of file descriptor leak on the Dreambox, even when not using the CIFS mounting point.


    Indeed, when I look at the /proc/<pid>/fd directory of one of the Enigma processes, I can see that all the movie files I opened since the last boot are still there!
    There are even the deleted ones :astonished_face: (I don't know how it is possible...)


    Here is an extract of an 'ls -l' on the fd directory (when not playing any recorded file and watching TV):

    Zitat

    lr-x------ 1 root root 64 Jan 17 12:00 49 -> /var/mnt/hdd/movie/08-12-15 - Eurosport - Gala.ts.002
    lr-x------ 1 root root 64 Jan 17 12:00 50 -> /var/mnt/hdd/movie/09-01-14 - M6 - THE UNIT 1.ts.001
    lr-x------ 1 root root 64 Jan 17 12:00 51 -> /var/mnt/hdd/movie/09-01-17 - MOTORS TV - PORSCHE CARRERA CUP.ts (deleted)

    I have just tried the current CVS Enigma and I always have this behaviour.


    Thank you for your help :smiling_face:

  • The files quoted on my previous post are actually on my local drive, yes.


    At the moment, I have no longer mountpoint to my NAS because of my hibernation problem, but when I was testing it, my NAS was on /mnt/cifs.
    My aim was only to describe how I found this file descriptor leak. :winking_face:


    Here is the result of mount:

    And even in this configuration (no distant access), the movie files stay open when I have finished with them.


    However, I also discovered that with an image built on June 08, all the movie files are successfully closed after playing them. So it seems to be a quite recent issue.

  • ...


    Should I understand that it is normal to have file descriptors on files which are not playing or that no longer exist ?? (ok, we won't have any problem before having 1024 descriptors in use according to ulimit)


    Maybe I am stupid, but I would be very interested in some explanations to understand what is wrong with my report.


    Thank you in advance.

  • Hi all,


    I am updating this topic because the leak seems to come from the "disable timestamp detection" parameter. When I enable it (so when I disable the detection), I no longer see any file descriptor leak.


    I am strongly suspecting the eTimeStampParserTS constructor (in timestampts.cpp) and more especially this:


    The file descriptor d1 returned by dup(fd_end) is never closed.
    I'm also wondering if it is really needed to duplicate the descriptor, as it seems possible to always work on fd_end.


    I really hope I could have helped with this little investigation :smiling_face: