mpv icon indicating copy to clipboard operation
mpv copied to clipboard

mpv does not close file descriptors over time

Open krupenik opened this issue 3 years ago • 3 comments

Important Information

  • mpv version: mpv 0.33.1
  • Linux Distribution and Version: Alpine Linux 3.14
  • Source of the mpv binary: Alpine Linux packages
  • Window Manager and version: none
  • GPU driver and version: in-kernel i915 1.6.0

Reproduction steps

  1. mpv --idle --terminal=no --input-ipc-server=/tmp/mpv20210609-3556-4mh4ad.sock --no-config --log-file=/var/video/mpv.log --vo=gpu --gpu-context=drm --hwdec=vaapi --fs=yes --profile=low-latency --no-audio --no-cache --no-osc --no-input-default-bindings --load-osd-console=no --load-scripts=no --load-stats-overlay=no
  2. send multiple loadfile rtsp://... and stop commands via ipc socket

Expected behavior

mpv should close file and socket descriptors when it's done playing streams

Actual behavior

$ ls /proc/3617/fd | wc -l
26218
â—‹ ls -lt /proc/3617/fd | head
total 0      
l-wx------    1 root     root          64 Jun 16 02:23 26194 -> pipe:[358170]
lr-x------    1 root     root          64 Jun 16 02:23 26203 -> /dmabuf:
lr-x------    1 root     root          64 Jun 16 02:23 26204 -> /dmabuf:
lr-x------    1 root     root          64 Jun 16 02:23 26205 -> /dmabuf:
lr-x------    1 root     root          64 Jun 16 02:23 26206 -> /dmabuf:
lr-x------    1 root     root          64 Jun 16 02:23 26207 -> /dmabuf:
lr-x------    1 root     root          64 Jun 16 02:23 26208 -> /dmabuf:
lr-x------    1 root     root          64 Jun 16 02:23 26211 -> /dmabuf:
lr-x------    1 root     root          64 Jun 16 02:23 26212 -> /dmabuf:

Log file

just a few loadfiles at the start: https://pastebin.com/29MPEE97

krupenik avatar Jun 15 '21 23:06 krupenik

Leaky!

rubyFeedback avatar Jun 16 '21 09:06 rubyFeedback

eventually this fails to play anything:

[84488.201][v][vo/gpu/opengl] Initializing KMS
[84488.201][e][vo/gpu/opengl] Cannot open card "0": No file descriptors available.
[84488.201][e][vo/gpu/opengl] Failed to create KMS.
[84488.201][e][vo/gpu] Failed initializing any suitable GPU context!
[84488.201][f][cplayer] Error opening/initializing the selected video_out (--vo) device.

krupenik avatar Nov 03 '21 13:11 krupenik

This happens on windows as well. How i can reproduce: in a folder with multiple videos, play one and then go to the next, next, next, etc. After a few "nexts" try to delete the first or second video played, and you get an error that the file is open somewhere.

TheBestPessimist avatar Aug 31 '22 07:08 TheBestPessimist