Discussion:
[MiKTeX] \write18 causing fatal error in xetex and xelatex after recent MiKTeX update
Christopher Weedall
2017-04-20 00:17:19 UTC
Permalink
Hi all,

I am hoping someone can help me either verify this problem was caused by
the recent MiKTeX update or how to dig deeper into what is causing the
problem, if it's only me.

First, this problem does not affect pdfTeX or pdfLaTeX for me. Second,
after the update, I encountered the issue that compiling with both XeTeX
and XeLaTeX with either \immediate\write18{} or \write18{} causes a fatal
error for xdvipdfmx where the file ends prematurely. The document class
(for XeLaTeX) can be anything, I get the same problem regardless.

Here are two MWE examples followed by the command line attempt to compile
them:

XeLaTeX:
\documentclass{article}

\begin{document}

Test

\immediate\write18{echo HELLO}%

%\write18{echo HELLO}%also causes problem

Test2

\end{document}


commands tried (same with the xelatex.exe variant):

miktex-xelatex.exe -enable-write18 test.tex

miktex-xelatex.exe --shell-escape test.tex

miktex-xelatex.exe -enable-write18 --shell-escape test.tex


XeTeX:

{\bf Test}

\immediate\write18{echo HELLO}%

%\write18{echo HELLO}%also causes problem

{\bf Test2}

\bye


commands tried (same with the xetex.exe variant):

miktex-xetex.exe -enable-write18 test.tex

miktex-xetex.exe --shell-escape test.tex

miktex-xetex.exe -enable-write18 --shell-escape test.tex



I noticed that the options -enable-8bit-chars and -enable-enctex are both
removed from MiKTeX's xetex and xelatex executables. So, I am thinking
this \write18 issue was introduced with these updates. Or perhaps the
method to access these features has changes? I searched on github and
MiKTeX's website for release notes and couldn't find anything relevant, but
maybe I missed it.


The errors in the logs give very little information and doesn't mean much
to me. But hopefully it can help others identify the root of the issue.
(I only include xelatex-related logs here, but xetex has the same errors).
No other logs have timestamps related to these tests or include anything
other than INFO messages.


Here is the console message from an attempted compile:


miktex-xelatex -enable-write18 test.tex
This is XeTeX, Version 3.14159265-2.6-0.99997 (MiKTeX 2.9.6300 64-bit)
entering extended mode
(test.tex
LaTeX2e <2017-04-15>
Babel <3.9r> and hyphenation patterns for 75 language(s) loaded.
("C:\Program Files\MiKTeX 2.9\tex\latex\base\article.cls"
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
("C:\Program Files\MiKTeX 2.9\tex\latex\base\size10.clo")) (test-xeltx2.aux)
Sorry, but miktex-xelatex did not succeed.

The log file hopefully contains the information to get MiKTeX going again:

C:/Users/MYUSERNAME/AppData/Local/MiKTeX/2.9/miktex/log/miktex-xelatex.log

You may want to visit the MiKTeX project page, if you need help.



If I remove \immediate (only using \write18), I receive this additional
error:


xdvipdfmx:fatal: File ended prematurely


Output file removed.



miktex-xelatex.log:

2017-04-20 10:00:01,099+1000 INFO miktex-xelatex - starting with command
line: miktex-xelatex -enable-write18 test.tex
2017-04-20 10:00:01,488+1000 FATAL miktex-xelatex - MiKTeX encountered an
internal error.
2017-04-20 10:00:01,488+1000 FATAL miktex-xelatex - Info:
2017-04-20 10:00:01,488+1000 FATAL miktex-xelatex - Source:
Programs/TeXAndFriends/xetex/xetex-miktex.h
2017-04-20 10:00:01,488+1000 FATAL miktex-xelatex - Line: 374



Finally, I wanted to mention that both immediately after the update and
many times while I was troubleshooting the issue, I refreshed the FNDB and
updated formats (both admin and user). To be safe, I also tried initexmf
--admin --mklinks --force as well. Documents compile fine otherwise (i.e.
without \write18). So, I'm thinking there was not any problem with the
update.


If I forgot anything important or relevant, let me know and I can send
those details.


Best,

Chris
Ulrike Fischer
2017-04-20 07:13:01 UTC
Permalink
Post by Christopher Weedall
Hi all,
I am hoping someone can help me either verify this problem was caused by
the recent MiKTeX update or how to dig deeper into what is causing the
problem, if it's only me.
It is not only you. I see it too (I tried in a current miktex NEXT
installation). Using \write18 in a document leads to a xetex crash
(regardless of options like --enable-write18, and also with
--no-pdf).

I suggest that you add an entry to the bug tracker.
--
Ulrike Fischer
http://www.troubleshooting-tex.de/
Christopher Weedall
2017-04-20 07:20:36 UTC
Permalink
Thanks for the confirmation. I'll go ahead and add it to the tracker.
Post by Ulrike Fischer
Post by Christopher Weedall
Hi all,
I am hoping someone can help me either verify this problem was caused by
the recent MiKTeX update or how to dig deeper into what is causing the
problem, if it's only me.
It is not only you. I see it too (I tried in a current miktex NEXT
installation). Using \write18 in a document leads to a xetex crash
(regardless of options like --enable-write18, and also with
--no-pdf).
I suggest that you add an entry to the bug tracker.
--
Ulrike Fischer
http://www.troubleshooting-tex.de/
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Q: How can I leave the mailing list?
A: See http://docs.miktex.org/faq/support.html#leavingml
Loading...