mpv
mpv copied to clipboard
mpv does not close file descriptors over time
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
-
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
- send multiple
loadfile rtsp://...
andstop
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 loadfile
s at the start: https://pastebin.com/29MPEE97
Leaky!
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.
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.