Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 581302 - dev-tex/xmltex, app-text/jadetex: Unescaped '&' in fmtutil format.cnf files
Summary: dev-tex/xmltex, app-text/jadetex: Unescaped '&' in fmtutil format.cnf files
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: TeX project
URL:
Whiteboard:
Keywords:
: 555310 606782 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-04-26 21:58 UTC by Ed Catmur
Modified: 2017-01-22 14:31 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Catmur 2016-04-26 21:58:31 UTC
The format.*.cnf fmtutil files used and installed by xmltex and jadetex contain an unescaped '&' character intended as the '&format' signifier argument to pdftex:

/usr/portage/dev-tex/xmltex/files/format.xmltex.cnf
xmltex          pdftex	language.dat	&latex xmltex.ini
pdfxmltex       pdftex	language.dat	&pdflatex pdfxmltex.ini
                                        ^-- here

(and jadetex similarly)

This appears to confuse fmtutil:

fmtutil: running `pdftex -ini  -jobname=pdfxmltex -progname=pdfxmltex &pdflatex pdfxmltex.ini' ...
This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015) (preloaded format=pdflatex)
 restricted \write18 enabled.
This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015) (INITEX)
 restricted \write18 enabled.
**
! End of file on the terminal... why?
[...]
fmtutil [ERROR]: `pdftex -ini  -jobname=pdfxmltex -progname=pdfxmltex &pdflatex pdfxmltex.ini' failed

It looks like fmtutil is passing the pdftex command line to system without escaping the '&', so it gets interpreted as the shell background control operator.

Escaping the '&' with a backslash works:

xmltex          pdftex	language.dat	\&latex xmltex.ini
pdfxmltex       pdftex	language.dat	\&pdflatex pdfxmltex.ini
                                        ^-- here

app-text/texlive-core-2015::gentoo was built with the following:
USE="X cjk luajittex xetex -doc -source -tk"
Comment 1 Martin von Gagern 2016-08-20 21:15:10 UTC
Adding some more details, in part to make this report easier to find by pasting relevant portions of command output that others might be searching for.

Apparently this causes texmf-update to not properly recreate jadetex.fmt upon upgrades, causing version mismatch errors (much like bug 456646):

This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015) (preloaded format=pdfjadetex)
 restricted \write18 enabled.
---! /var/lib/texmf/web2c/pdftex/pdfjadetex.fmt doesn't match pdftex.pool
(Fatal format file error; I'm stymied)

Furthermore, re-merging jadetex can fail to install relevant files like /var/lib/texmf/web2c/pdftex/pdfjadetex.fmt, since errors go unnoticed by the ebuild:

Transcript written on jadetex.log.
fmtutil [ERROR]: `pdftex -ini  -jobname=pdfjadetex -progname=pdfjadetex -translate-file=cp227.tcx &pdflatex pdfjadetex.ini' failed
fmtutil [ERROR]: `pdftex -ini  -jobname=jadetex -progname=jadetex -translate-file=cp227.tcx &latex jadetex.ini' failed
fmtutil [INFO]: Failure during builds: 2
>>> Source compiled.

This can lead to failing mktexfmt runs if someone tries to run pdfjadetex:

kpathsea: Running mktexfmt pdfjadetex.fmt
…
mktexfmt: running `pdftex -ini  -jobname=pdfjadetex -progname=pdfjadetex -translate-file=cp227.tcx &pdflatex pdfjadetex.ini' ...
…
mktexfmt [ERROR]: `pdftex -ini  -jobname=pdfjadetex -progname=pdfjadetex -translate-file=cp227.tcx &pdflatex pdfjadetex.ini' failed
mktexfmt [INFO]: Failure during builds: 1
…
I can't find the format file `pdfjadetex.fmt'!

All of this I recently observed in bug 555310 which appears to be essentially caused by this issue here. So thanks for this report, it helped me a lot finding the actual cause for all this mess. I hope we can get this fixed soon; adding backslashes to those files and performing a revbump should not require a user-supplied patch imo.
Comment 2 Sven Müller 2016-11-29 08:28:02 UTC
Can confirm: 

files/format.jadetex.cnf
# JadeTeX
jadetex		pdftex		language.dat	-translate-file=cp227.tcx \&latex jadetex.ini
pdfjadetex	pdftex		language.dat	-translate-file=cp227.tcx \&pdflatex pdfjadetex.ini

creates /var/lib/texmf/web2c/pdftex/pdfjadetex.fmt and builds fine with fontconfig (bug 55310).
Comment 3 Sven Müller 2016-11-29 08:31:34 UTC
Of course I mean bug 555310.

By the way: is there an edit function to at least fix type errors, discovered after pressing the "Save changes" button?
Comment 4 Andrey Grozin gentoo-dev 2016-12-18 05:32:35 UTC
Can somebody commit this fix? It's very tiresome to get failures in emerge -avuND @world every time fontconfig is updated (bug #555310).

The fix works. I can commit it myself, but these packages are not mine.
Comment 5 Andrey Grozin gentoo-dev 2016-12-18 05:33:19 UTC
*** Bug 555310 has been marked as a duplicate of this bug. ***
Comment 6 Alexis Ballier gentoo-dev 2016-12-20 12:37:33 UTC
(In reply to Andrey Grozin from comment #4)
> The fix works. I can commit it myself, but these packages are not mine.

Just commit it and get kudos :)
Comment 7 Alexis Ballier gentoo-dev 2017-01-22 14:31:02 UTC
ommit d4c91741323539e953077dc60166d10bf0e34c87
Author: Alexis Ballier <aballier@gentoo.org>
Date:   Sun Jan 22 15:30:31 2017 +0100

    app-text/jadetex: properly escape & in fmtutil format.cnf files, bug #581302
    
    Package-Manager: Portage-2.3.3, Repoman-2.3.1

commit 2a81e34363911c49175fd5080442ad6f41bfd53e
Author: Alexis Ballier <aballier@gentoo.org>
Date:   Sun Jan 22 15:29:35 2017 +0100

    dev-tex/xmltex: properly escape & in fmtutil format.cnf files, bug #581302
    
    Package-Manager: Portage-2.3.3, Repoman-2.3.1



thanks!
Comment 8 Alexis Ballier gentoo-dev 2017-01-22 14:31:10 UTC
*** Bug 606782 has been marked as a duplicate of this bug. ***