LoginSignup
3
3

More than 5 years have passed since last update.

TeXエンジンが Abort trap 6 で落ちる

Last updated at Posted at 2014-07-18

最近のTeXエンジンは,-shell-escape が有効な状態のときに,

\input|"command args" % plain TeX
\@@input|"command args" % LaTeX

とすることで,外部コマンドの標準出力をそのままソースに流し込むことができます。

この機能を用いてTeXソースをコンパイルしている最中に,TeXエンジン(コンパイラ)が Abort trap 6 で落ちるという,比較的珍しいエラーに遭遇しました。
「問題が再現する最小限のソース」まで切り詰めてみたところ,次のソースに至りました。plain TeX documentです。

sample.tex
\input|"echo '\string\openin0.'"
\input|""
\bye

このソースを

$ ptex -shell-escape sample

でコンパイルしようとすると,次のように Abort trap 6 で落ちます(TeX Live 2014 on Mac OS X 10.9 で確認)。

This is pTeX, Version 3.14159265-p3.5 (utf8.euc) (TeX Live 2014) (preloaded format=ptex)
 \write18 enabled.
(./sample.tex (./sample.tex)Assertion failed: (s != 0), function maketexstring, file ../../../texk/web2c/lib/texmfmp.c, line 2558.
Abort trap: 6

pTeX系列の (e)(u)pTeX の4種類のエンジン,および XeTeX でも再現しました。
一方,pdfTeX や LuaTeX では発生しませんでした。

なお,LaTeXでも同様です。

sample2.tex
\documentclass{article}
\begin{document}
\makeatletter
\@@input|"echo '\string\openin0.'"
\@@input|""
\end{document}
$ platex -shell-escape sample2
This is e-pTeX, Version 3.14159265-p3.5-130605-2.6 (utf8.euc) (TeX Live 2014) (preloaded format=platex)
 \write18 enabled.
entering extended mode
(./sample2.tex
pLaTeX2e <2006/11/10> (based on LaTeX2e <2014/05/01> patch level 0)
Babel <3.9k> and hyphenation patterns for 79 languages loaded.
(/Applications/TeXLive/texlive/2014/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/Applications/TeXLive/texlive/2014/texmf-dist/tex/latex/base/size10.clo))
(./sample2.aux) (./sample2.aux)Assertion failed: (s != 0), function maketexstring, file ../../../texk/web2c/lib/texmfmp.c, line 2558.
Abort trap: 6

この現象の原因はよく分かりませんが,普通はこんなことはあまりしないので,実害は少ないでしょう。

追記 (2014/07/19)

問題の texmfmp.c を角藤先生が改修してくださいました。次の TeX Live 2015 では修正されるはずです。

追記 (2015/09/10)

同様の案件をもう一件見つけました

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3