mpv zsh completion hangs with specially crafter dirnames

Bug #1775554 reported by Patola
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mpv (Ubuntu)
New
Undecided
Unassigned
zsh (Ubuntu)
New
Undecided
Unassigned

Bug Description

This is regarding /usr/share/zsh/vendor-completions/_mpv which is in the package "mpv".

If you make a dirname with lots of dots and open bracket and close bracket, like:

/tmp/XXX.X.X.X.X.X.XX.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.XX-X.X.X.X.X.X.X[XXXXX]

Put some media files inside, and try to autocomplete with:

mpv /tmp/XXX.X.X.X.X.X.XX.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.XX-X.X.X.X.X.X.X\[XXXXX\]/<TAB>

zsh gets into a loop that depending on the disk might take dozens of minutes or hours to complete. In a network file system it might practically hangs forever. Using zsh -xv to check the completion I see that the completion has increasingly bigger hangs after this part repeats:

+compadd:9> PREFIX='(#a20)/tmp/XXX.X.X.X.X.X.XX.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.XX-X.X.X.X.X.X.X\[XXXXX\]/'
+compadd:12> (( 1 && 5 ))
+compadd:13> _correct_expl[_correct_group]=-J
+compadd:15> compadd -J corrections -X '- corrections - (errors 20})' -S '' -J urls -X '- URL -' cdda:// rtmp:// rtsp:// https:// mms:// mmst:// mmshttp:// rtp:// httpproxy:// hls:// rtmpe:// rtmps:// rtmpt:// rtmpte:// rtmpts:// srtp:// data:// lavf:// ffmpeg:// udp:// ftp:// tcp:// tls:// unix:// sftp:// md5:// concat:// avdevice:// av:// dvb:// smb:// file:// dvdread:// file:// dvd:// dvdnav:// file:// bd:// br:// bluray:// bdnav:// brnav:// bluraynav:// memory:// hex:// null:// mf:// edl:// rar:// file:// fd:// fdclose://

The delay to get to the next part seems to increase exponentially. I am attaching an excerpt of the zsh -xv run. A similar symptom happens with mplayer but it does not take as long - a couple minutes instead of more than half an hour. After it finishes, it doesn't match any media file, although there are mkv files in there: No matches for: `video file', `media file', `URL', `URL prefix', or `corrections'

This does not seem to occur with any other programs, media or otherwise. For media players I tried ffmpeg kmplayer totem xine avconv avplay.

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: mpv 0.27.2-1ubuntu1 [modified: usr/share/zsh/vendor-completions/_mpv]
ProcVersionSignature: Ubuntu 4.15.0-22.24-lowlatency 4.15.17
Uname: Linux 4.15.0-22-lowlatency x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.9-0ubuntu7.1
Architecture: amd64
CurrentDesktop: Unity:Unity7:ubuntu
Date: Thu Jun 7 05:41:36 2018
InstallationDate: Installed on 2018-01-08 (150 days ago)
InstallationMedia: Ubuntu 17.10 "Artful Aardvark" - Release amd64 (20171018)
SourcePackage: mpv
UpgradeStatus: Upgraded to bionic on 2018-06-03 (4 days ago)

Revision history for this message
Patola (patola) wrote :
description: updated
description: updated
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

The bug report seems to say you have modified the file. What have you modified it to?

Package: mpv 0.27.2-1ubuntu1 [modified: usr/share/zsh/vendor-completions/_mpv]

Revision history for this message
Patola (patola) wrote :

Sorry for that. I was trying a few things to get rid of that problem and I forgot to take it back.
I copied it elsewhere and I reinstated the original package version. This is the diff:

[6:50] [3323] [patola@risadinha patola]% diff /home/patola/_mpv /usr/share/zsh/vendor-completions/_mpv
974c974
< _requested files expl 'media file' _files -g "*.(#i)(asf|asx|avi|flac|flv|m1v|m2p|m2v|m4a|m4v|mjpg|mka|mkv|mov|mp3|mp4|mpe|mpeg|mpg|ogg|ogm|ogv|opus|qt|rm|ts|vob|wav|webm|wma|wmv)(-.)" && rc=0
---
> _requested files expl 'media file' _files && rc=0
978c978
< compadd -S '' "$expl[@]" {cdda,rtmp,rtsp,https,mms,mmst,mmshttp,rtp,httpproxy,hls,rtmpe,rtmps,rtmpt,rtmpte,rtmpts,srtp,data,lavf,ffmpeg,udp,ftp,tcp,tls,unix,sftp,md5,concat,avdevice,av,dvb,smb,file,dvdread,file,dvd,dvdnav,file,bd,br,bluray,bdnav,brnav,bluraynav,memory,hex,null,mf,edl,rar,file,fd,fdclose}:// && rc=0
---
> compadd -S '' "$expl[@]" cdda:// rtmp:// rtsp:// http:// https:// mms:// mmst:// mmsh:// mmshttp:// rtp:// httpproxy:// hls:// rtmpe:// rtmps:// rtmpt:// rtmpte:// rtmpts:// srtp:// data:// lavf:// ffmpeg:// udp:// ftp:// tcp:// tls:// unix:// sftp:// md5:// concat:// avdevice:// av:// dvb:// smb:// file:// dvdread:// file:// dvd:// dvdnav:// file:// bd:// br:// bluray:// bdnav:// brnav:// bluraynav:// memory:// hex:// null:// mf:// edl:// rar:// file:// fd:// fdclose:// && rc=0
[6:50] [3324] [patola@risadinha patola]%

The behaviour is the same with my modified file and the original too.

Revision history for this message
Patola (patola) wrote :

/home/patola/_mpv is my modified version and /usr/share/zsh/vendor-completions/_mpv is the original, BTW

Revision history for this message
Patola (patola) wrote :

Any news on that? Bug continues to this day.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.