Bug#794228: texlive-base: mktexdir parallel execution race condition
Package: texlive-base
Version: 2015.20150703-1
Severity: normal
Dear Maintainer,
There is a potential race condition in the mktexdir program. If two
instances of mktexdir try to create the same directory simultaneously,
one may error with, for example,
mkdir: cannot create directory ‘././home/mike/.texmf-var/fonts/pk/ljfour’: File exists
I can easily demonstrate this by repeatedly running a simple script such
as
$ rm -rf ~/.texmf-var && \
( /usr/share/texlive/texmf-dist/web2c/mktexdir \
~/.texmf-var/fonts/pk/ljfour/jknappen/ec || echo "FAIL: $?" ) & \
( /usr/share/texlive/texmf-dist/web2c/mktexdir \
~/.texmf-var/fonts/pk/ljfour/jknappen/ec || echo "FAIL: $?" )
mkdir: cannot create directory ‘././home/mike/.texmf-var’: File exists
FAIL: 1
Specifically, this can occur in a parallel build of Texinfo
documentation when the dvips and texi2pdf commands happen to run
simultaneously. If the font cache directory does not already exist, e.g.
buildd environment, both programs will try to create it and this error
can occur.
Refer to Ubuntu buildd log of octave [1] for a real-world occurrence. I
have not been able to reproduce on my own, only by digging down through
the TeX stack and running low-level utilities mktexpk or mktexdir as in
example shown above.
[1]: https://launchpadlibrarian.net/212257965/buildlog_ubuntu-wily-i386.octave_4.0.0-3_BUILDING.txt.gz
Thanks for your work maintaining TeX Live.
-- System Information:
Debian Release: stretch/sid
APT prefers testing
APT policy: (500, 'testing'), (1, 'experimental'), (1, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 4.0.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages texlive-base depends on:
ii debconf [debconf-2.0] 1.5.57
ii libpaper-utils 1.1.24+nmu4
ii tex-common 6.02
ii texlive-binaries 2015.20150524.37493-5
ii ucf 3.0030
ii xdg-utils 1.1.0~rc1+git20111210-7.4
Versions of packages texlive-base recommends:
ii lmodern 2.004.4-5
Versions of packages texlive-base suggests:
ii atril [postscript-viewer] 1.8.1+dfsg1-5
ii evince [postscript-viewer] 3.16.1-1
ii ghostscript [postscript-viewer] 9.06~dfsg-2
ii perl-tk 1:804.033-1
pn xpdf-reader | pdf-viewer <none>
Versions of packages tex-common depends on:
ii dpkg 1.18.1
ii ucf 3.0030
Versions of packages tex-common suggests:
ii debhelper 9.20150628
Versions of packages texlive-base is related to:
ii tex-common 6.02
ii texlive-binaries 2015.20150524.37493-5
-- debconf information:
tex-common/check_texmf_missing:
texlive-base/texconfig_ignorant:
tex-common/check_texmf_wrong:
texlive-base/binary_chooser: pdftex, dvips, dvipdfmx, xdvi
Reply to: