Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 586596 - =app-shells/mpv-bash-completion-3.3.13 : sandbox issue (XDG_xxx_DIR related)
Summary: =app-shells/mpv-bash-completion-3.3.13 : sandbox issue (XDG_xxx_DIR related)
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Coacher
URL: https://github.com/2ion/mpv-bash-comp...
Whiteboard:
Keywords:
Depends on:
Blocks: 567192
  Show dependency tree
 
Reported: 2016-06-21 16:24 UTC by Toralf Förster
Modified: 2017-08-12 09:58 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge-history.txt (emerge-history.txt,285.71 KB, text/plain)
2016-06-21 16:25 UTC, Toralf Förster
Details
sandbox-28311.log (sandbox-28311.log,1.06 KB, text/plain)
2016-06-21 16:25 UTC, Toralf Förster
Details
emerge-info.txt (emerge-info.txt,5.52 KB, text/plain)
2017-04-17 08:24 UTC, Toralf Förster
Details
app-shells:mpv-bash-completion-3.3.13:20170416-225205.log (app-shells:mpv-bash-completion-3.3.13:20170416-225205.log,1.69 KB, text/plain)
2017-04-17 08:24 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,264.70 KB, text/plain)
2017-04-17 08:24 UTC, Toralf Förster
Details
etc.portage.tbz2 (etc.portage.tbz2,27.76 KB, application/x-bzip)
2017-04-17 08:24 UTC, Toralf Förster
Details
sandbox-8634.log (sandbox-8634.log,478 bytes, text/plain)
2017-04-17 08:24 UTC, Toralf Förster
Details
emerge-info.txt (emerge-info.txt,15.21 KB, text/plain)
2017-07-21 16:37 UTC, Toralf Förster
Details
app-shells:mpv-bash-completion-3.3.13:20170721-150551.log (app-shells:mpv-bash-completion-3.3.13:20170721-150551.log,1.57 KB, text/plain)
2017-07-21 16:37 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,233.44 KB, text/plain)
2017-07-21 16:38 UTC, Toralf Förster
Details
etc.portage.tbz2 (etc.portage.tbz2,52.57 KB, application/x-bzip)
2017-07-21 16:38 UTC, Toralf Förster
Details
sandbox-1612.log (sandbox-1612.log,385 bytes, text/plain)
2017-07-21 16:38 UTC, Toralf Förster
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2016-06-21 16:24:57 UTC
This issue is forced at the tinderbox by making:

export XDG_DESKTOP_DIR="/root/Desktop"
export XDG_DOCUMENTS_DIR="/root/Documents"
export XDG_DOWNLOAD_DIR="/root/Downloads"
export XDG_MUSIC_DIR="/root/Music"
export XDG_PICTURES_DIR="/root/Pictures"
export XDG_PUBLICSHARE_DIR="/root/Public"
export XDG_TEMPLATES_DIR="/root/Templates"
export XDG_VIDEOS_DIR="/root/Videos"
export XDG_RUNTIME_DIR="/root/run"
export XDG_CONFIG_HOME="/root/config"
export XDG_CACHE_HOME="/root/cache"
export XDG_DATA_HOME="/root/share"
export XDG_DATA_DIRS="/root/share-read"
export XDG_CONFIG_DIRS="/root/config-read"

pls see bug #567192 too

VERSION 1.0
FORMAT: F - Function called
FORMAT: S - Access Status
FORMAT: P - Path as passed to function
FORMAT: A - Absolute Path (not canonical)
FORMAT: R - Canonical Path
FORMAT: C - Command Line

F: mkdir
S: deny
P: /root/config
A: /root/config
R: /root/config
C: mpv --list-options 

F: mkdir
S: deny
P: /root/config
A: /root/config
R: /root/config


$ cat emerge-info.txt
  -----------------------------------------------------------------

  This is an unstable amd64 chroot image (named amd64-desktop-unstable_20160616-172831) at a hardened host acting as a tinderbox.

  -----------------------------------------------------------------

  make.conf: USE="pax_kernel xtpax -cdinstall -oci8 -bindist apache avcodec -avformat -cdb cups custom-optimization dec_av2 drmkms -ecc egl fortran freetds gd -gpg -gstreamer gzip hdf5 icu -imap -inifile ithreads javaxml jpeg llvm mbox minizip modplug mpeg3 mpg123 multimedia nls nscd opencv -opengl pwquality scrypt semantic-desktop server sqlite3 -system-harfbuzz system-icu system-libvpx szip -thinkpad -tls traceroute v4l2 -vlc vpx widgets xkb -xmp xscreensaver xslt xvmc zlib"

  -----------------------------------------------------------------

Portage 2.3.0_rc1 (python 3.4.4-final-0, default/linux/amd64/13.0/desktop, gcc-5.4.0, glibc-2.23-r2, 4.5.7-hardened-r2 x86_64)
=================================================================
System uname: Linux-4.5.7-hardened-r2-x86_64-Intel-R-_Core-TM-_i7-3770_CPU_@_3.40GHz-with-gentoo-2.2
KiB Mem:    16157888 total,   2395216 free
KiB Swap:   16777212 total,  16710748 free
Timestamp of repository gentoo: Tue, 21 Jun 2016 06:42:04 +0000
sh bash 4.3_p42-r2
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
ccache version 3.2.5 [disabled]
app-shells/bash:          4.3_p42-r2::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.24.0-r1::gentoo
dev-lang/python:          2.7.11-r2::gentoo, 3.4.4::gentoo, 3.5.1-r3::gentoo
dev-util/ccache:          3.2.5::gentoo
dev-util/cmake:           3.5.2-r1::gentoo
dev-util/pkgconfig:       0.29.1::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.21::gentoo
sys-apps/sandbox:         2.10-r2::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r2::gentoo
sys-devel/automake:       1.11.6-r2::gentoo, 1.13.4-r1::gentoo, 1.14.1-r1::gentoo, 1.15-r2::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            4.9.3::gentoo, 5.4.0::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r2::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.6::gentoo (virtual/os-headers)
sys-libs/glibc:           2.23-r2::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: 1

local
    location: /usr/local/portage
    masters: gentoo
    priority: 2

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/stunnel/stunnel.conf /usr/lib64/libreoffice/program/sofficerc /usr/share/gnupg/qualified.txt /var/lib/redmine/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.5/ext-active/ /etc/php/apache2-php7.0/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cgi-php7.0/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/php/cli-php7.0/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /var/lib/redmine/config/locales /var/lib/redmine/config/settings.yml"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/var/tmp/distfiles"
EMERGE_DEFAULT_OPTS="--verbose-conflicts --color=n --nospinner --tree --quiet-build"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync network-sandbox parallel-fetch preserve-libs protect-owned sandbox sfperms strict test-fail-continue unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://ftp.uni-erlangen.de/pub/mirrors/gentoo rsync://mirror.netcologne.de/gentoo/ ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gor.bytemark.co.uk/gentoo/ rsync://ftp.snt.utwente.nl/gentoo"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j1"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi alsa amd64 apache avcodec berkdb bluetooth branding bzip2 cairo cdda cdr cli consolekit cracklib crypt cups custom-optimization cxx dbus dec_av2 dri drmkms dts dvd dvdr egl emboss encode exif fam firefox flac fortran freetds gd gdbm gif glamor gpm gtk gzip hdf5 iconv icu ipv6 ithreads javaxml jpeg lcms ldap libnotify llvm mad mbox minizip mmx mmxext mng modplug modules mp3 mp4 mpeg mpeg3 mpg123 multilib multimedia ncurses nls nptl nscd ogg opencv openmp pam pango pax_kernel pcre pdf png policykit ppds pwquality qt3support qt4 readline scrypt sdl seccomp semantic-desktop server session spell sqlite3 sse sse2 ssl startup-notification svg system-icu system-libvpx szip tcpd tiff traceroute truetype udev udisks unicode upower usb v4l2 vorbis vpx widgets wxwidgets x264 xattr xcb xkb xml xscreensaver xslt xtpax xv xvid xvmc zlib" ABI_X86="64" ALSA_CARDS="hda-intel" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby20 ruby21" USERLAND="GNU" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Toralf Förster gentoo-dev 2016-06-21 16:25:00 UTC
Created attachment 438300 [details]
emerge-history.txt
Comment 2 Toralf Förster gentoo-dev 2016-06-21 16:25:02 UTC
Created attachment 438302 [details]
sandbox-28311.log
Comment 3 Coacher 2016-06-21 20:50:44 UTC
I've seen a similar issue before with mpv. mpv-bash-completion should call mpv with `--no-config' option. I'll try to reproduce this and confirm my assumption.

ETA on this one is 1-2 days.
Comment 4 Toralf Förster gentoo-dev 2016-06-21 20:56:32 UTC
Hi, maybe it is worth to have a look into bug #577704 too
Comment 5 Coacher 2016-06-21 21:07:55 UTC
(In reply to Toralf Förster from comment #4)
> Hi, maybe it is worth to have a look into bug #577704 too
Thanks, I know it can be workarounded right away by env reset. I'd like to deliver a proper fix with `--no-config' option and try to get it merged upstream.

I just need a couple of days to test it that's all. A bit busy now.
Comment 6 Coacher 2016-06-22 15:41:06 UTC
Fixed in 0.17. See https://github.com/gentoo/gentoo/pull/1720
Comment 7 Patrice Clement gentoo-dev 2016-06-23 21:45:27 UTC
commit d12c6d14d31f4f86d08953f5795a7499825f7202 (HEAD)
Author:     Ilya Tumaykin <itumaykin@gmail.com>
AuthorDate: Wed Jun 22 18:18:57 2016 +0300
Commit:     Patrice Clement <monsieurp@gentoo.org>
CommitDate: Thu Jun 23 21:15:47 2016 +0000

app-shells/mpv-bash-completion: verbump to 0.17

Remove redundant app-shells/bash blocker.
This version also fixes Gentoo bug #586596.

Gentoo-Bug: https://bugs.gentoo.org/586596

Package-Manager: portage-2.3.0_rc1

Signed-off-by: Patrice Clement <monsieurp@gentoo.org>

app-shells/mpv-bash-completion/Manifest                        |  1 +
app-shells/mpv-bash-completion/mpv-bash-completion-0.17.ebuild | 32 ++++++++++++++++++++++++++++++++
2 files changed, 33 insertions(+)
create mode 100644 app-shells/mpv-bash-completion/mpv-bash-completion-0.17.ebuild
Comment 8 Toralf Förster gentoo-dev 2017-04-17 08:24:40 UTC
same issue with app-shells/mpv-bash-completion-3.3.13 at the unstable amd64 chroot image 13.0-no-multilib-libressl_20170409-194102 at the tinderbox
Comment 9 Toralf Förster gentoo-dev 2017-04-17 08:24:43 UTC
Created attachment 470212 [details]
emerge-info.txt
Comment 10 Toralf Förster gentoo-dev 2017-04-17 08:24:47 UTC
Created attachment 470214 [details]
app-shells:mpv-bash-completion-3.3.13:20170416-225205.log
Comment 11 Toralf Förster gentoo-dev 2017-04-17 08:24:50 UTC
Created attachment 470216 [details]
emerge-history.txt
Comment 12 Toralf Förster gentoo-dev 2017-04-17 08:24:54 UTC
Created attachment 470218 [details]
etc.portage.tbz2
Comment 13 Toralf Förster gentoo-dev 2017-04-17 08:24:57 UTC
Created attachment 470220 [details]
sandbox-8634.log
Comment 14 Coacher 2017-04-17 09:08:12 UTC
(In reply to Toralf Förster from comment #8)
> same issue with app-shells/mpv-bash-completion-3.3.13 at the unstable amd64
> chroot image 13.0-no-multilib-libressl_20170409-194102 at the tinderbox
Can't reproduce:
~ # la .cache
ls: cannot access '.cache': No such file or directory
~ # la cache
ls: cannot access 'cache': No such file or directory
~ # export XDG_CACHE_HOME="/root/cache"
~ # emerge -1v mpv-bash-completion
~ # la .cache
ls: cannot access '.cache': No such file or directory
~ # la cache
ls: cannot access 'cache': No such file or directory

Strace of `mpv --no-config --ad help' also doesn't yield any ~/.cache or ~/cache activity.

Please provide exact steps to trigger it.
Comment 15 Toralf Förster gentoo-dev 2017-04-17 09:31:05 UTC
(In reply to Coacher from comment #14)
lines 1063 ff of https://github.com/toralf/tinderbox/blob/master/bin/job.sh are needed IMO
Comment 16 Toralf Förster gentoo-dev 2017-04-17 09:32:28 UTC
(In reply to Toralf Förster from comment #15)
and maybe this too :

FEATURES="xattr preserve-libs parallel-fetch ipc-sandbox network-sandbox -news"

(line 241 of https://github.com/toralf/tinderbox/blob/master/bin/tbs.sh)
Comment 17 Coacher 2017-04-17 10:10:10 UTC
(In reply to Toralf Förster from comment #16)
> (In reply to Toralf Förster from comment #15)
> and maybe this too :
> 
> FEATURES="xattr preserve-libs parallel-fetch ipc-sandbox network-sandbox
> -news"
> 
> (line 241 of https://github.com/toralf/tinderbox/blob/master/bin/tbs.sh)
Still can't trigger it: https://paste.pound-python.org/show/AJkOwZUBbfgXF7ONyNnI/

Please attach `emerge -pqv media-video/mpv'.
Comment 18 Toralf Förster gentoo-dev 2017-04-17 10:12:31 UTC
(In reply to Coacher from comment #17)
tinderbox@mr-fox ~ $ scw ~/run/13.0-no-multilib-libressl_20170409-194102

mr-fox / # emerge -pqv media-video/mpv
[ebuild   R   ] media-video/mpv-0.24.0  USE="X alsa cdda cli dvb egl iconv jpeg libass lua opengl uchardet xscreensaver xv (-aqua) -archive -bluray (-coreaudio) -cplugins -cuda -doc -drm -dvd -encode -gbm -jack -lcms -libav -libcaca -libmpv -luajit -openal -oss -pulseaudio (-raspberry-pi) -rubberband -samba -sdl (-selinux) {-test} -tools -v4l -vaapi -vdpau -vf-dlopen -wayland -xinerama -zsh-completion" CPU_FLAGS_X86="-sse4_1" PYTHON_TARGETS="python2_7 python3_4 -python3_5"
Comment 19 Coacher 2017-04-18 05:19:41 UTC
Still can't reproduce with exact same versions as you have :(
Comment 20 Coacher 2017-04-20 14:36:18 UTC
Please attach temp/environment.
Comment 21 Coacher 2017-04-27 19:32:19 UTC
(In reply to Coacher from comment #20)
> Please attach temp/environment.
Ping.

Please also provide a tinderbox command I can use to trigger this as I'm unable to reproduce this problem on any of my regular systems.
Comment 22 Toralf Förster gentoo-dev 2017-04-27 19:43:16 UTC
(In reply to Coacher from comment #21)
I can't reproduce it here till now.

BTW there's no "tinderbox command" except the one which is used by every gentoo user at the command line too - look around line 931 of
https://github.com/toralf/tinderbox/blob/master/bin/job.sh :

 RunCmd "emerge --update $task"
Comment 23 Coacher 2017-04-28 07:28:47 UTC
(In reply to Toralf Förster from comment #22)
> (In reply to Coacher from comment #21)
> I can't reproduce it here till now.
So you too can't reproduce it?
Comment 24 Coacher 2017-05-01 15:16:12 UTC
Cannot reproduce whatever I do.

Tried emerge, ebuild, root, non-root, latest mpv, live mpv, latest mpv-bash-completion, live mpv-bash-completion with all the exports as seen in comment #17.

Please provide exact step by step instructions to trigger this bug using either regular emerge/ebuild or tinderbox script.
Sorry, but "take a look at some script and deduce" is not an exact step by step instructions. Closing for now.
Comment 25 Toralf Förster gentoo-dev 2017-07-21 16:37:51 UTC
got at the unstable amd64 chroot image 13.0_libressl_20170716-132702 this : app-shells/mpv-bash-completion-3.3.13 : sandbox issue (XDG_xxx_DIR related)
Comment 26 Toralf Förster gentoo-dev 2017-07-21 16:37:54 UTC
Created attachment 486270 [details]
emerge-info.txt
Comment 27 Toralf Förster gentoo-dev 2017-07-21 16:37:57 UTC
Created attachment 486272 [details]
app-shells:mpv-bash-completion-3.3.13:20170721-150551.log
Comment 28 Toralf Förster gentoo-dev 2017-07-21 16:38:01 UTC
Created attachment 486274 [details]
emerge-history.txt
Comment 29 Toralf Förster gentoo-dev 2017-07-21 16:38:04 UTC
Created attachment 486276 [details]
etc.portage.tbz2
Comment 30 Toralf Förster gentoo-dev 2017-07-21 16:38:07 UTC
Created attachment 486278 [details]
sandbox-1612.log
Comment 31 Toralf Förster gentoo-dev 2017-07-21 16:39:14 UTC
reproduce this :


# https://bugs.gentoo.org/show_bug.cgi?id=567192
#
export XDG_DESKTOP_DIR="/root/Desktop"
export XDG_DOCUMENTS_DIR="/root/Documents"
export XDG_DOWNLOAD_DIR="/root/Downloads"
export XDG_MUSIC_DIR="/root/Music"
export XDG_PICTURES_DIR="/root/Pictures"
export XDG_PUBLICSHARE_DIR="/root/Public"
export XDG_TEMPLATES_DIR="/root/Templates"
export XDG_VIDEOS_DIR="/root/Videos"

export XDG_RUNTIME_DIR="/root/run"
export XDG_CONFIG_HOME="/root/config"
export XDG_CACHE_HOME="/root/cache"
export XDG_DATA_HOME="/root/share"

then emerge the package with

FEATURES="xattr preserve-libs parallel-fetch ipc-sandbox network-sandbox -news"

should be enough
Comment 32 Coacher 2017-07-21 17:10:56 UTC
(In reply to Toralf Förster from comment #31)
> reproduce this :

$ cat bug586596.sh : https://paste.pound-python.org/show/HIyeCtjeVT1OcfatzlsT/
$ sh bug586596.sh emerge --info : https://paste.pound-python.org/show/wx9q2fRLgnRVEUM2WayP/
# sh bug586596.sh emerge -1v =app-shells/mpv-bash-completion-3.3.13 : https://paste.pound-python.org/show/U9SvVLy8GNpGUSbjzAkm/

Your suggested steps again don't reproduce the issue here.
Comment 33 Coacher 2017-07-21 17:12:05 UTC
I've mentioned before that these steps are not enough, see comment #17.
Comment 34 Toralf Förster gentoo-dev 2017-07-21 17:29:47 UTC
ah, forgot to mention: please take a look at xdg_environment_reset() and friends xdg_* - there're a lot of ebuilds using them to sane emerge software.
Comment 35 Coacher 2017-07-21 17:39:46 UTC
(In reply to Toralf Förster from comment #34)
> ah, forgot to mention: please take a look at xdg_environment_reset() and
> friends xdg_* - there're a lot of ebuilds using them to sane emerge software.
Thanks. I know very well how to solve these kind of issues, but I won't add workarounds for issues that only you can see. Sorry.
Comment 36 Coacher 2017-07-23 16:14:51 UTC
Tested in a clean ~amd64 chroot. After a successful emerge of app-shells/mpv-bash-completion-3.3.13 with all of your settings:

# bzgrep XDG /var/db/pkg/app-shells/mpv-bash-completion-3.3.13/environment.bz2
declare -x XDG_CACHE_HOME="/root/cache"
declare -x XDG_CONFIG_DIRS="/etc/xdg"
declare -x XDG_CONFIG_HOME="/root/config"
declare -x XDG_DATA_DIRS="/usr/local/share:/usr/share"
declare -x XDG_DATA_HOME="/root/share"
declare -x XDG_DESKTOP_DIR="/root/Desktop"
declare -x XDG_DOCUMENTS_DIR="/root/Documents"
declare -x XDG_DOWNLOAD_DIR="/root/Downloads"
declare -x XDG_MUSIC_DIR="/root/Music"
declare -x XDG_PICTURES_DIR="/root/Pictures"
declare -x XDG_PUBLICSHARE_DIR="/root/Public"
declare -x XDG_RUNTIME_DIR="/root/run"
declare -x XDG_TEMPLATES_DIR="/root/Templates"
declare -x XDG_VIDEOS_DIR="/root/Videos"

# cat /var/db/pkg/app-shells/mpv-bash-completion-3.3.13/FEATURES
assume-digests binpkg-logs buildpkg collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync metadata-transfer multilib-strict network-sandbox news parallel-fetch parallel-install preserve-libs protect-owned sandbox sfperms strict test unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr
Comment 37 Coacher 2017-07-23 16:20:52 UTC
Please do the following:
1. Re-create the required environment to trigger this issue,
   e.g. as you described in comment #31.
2. Run strace on the problematic command from your sandbox.log like this:
   `strace -e trace=mkdir -o strace.log mpv --no-config --ad help'
3. Attach the resulting strace.log here.
Comment 38 Toralf Förster gentoo-dev 2017-08-12 09:58:58 UTC
re-tested it today at affected image img1/13.0_libressl_20170716-132702 - issue could't be reproduced there