ltj-cctbreg について
とりあえず眺めた限りだと,\ltj@@cctb@org@defの定義と,luatexbase-cctb.sty (2010/10/10 v0.3) の \newluatexcatcodetable の定義の間には
ltj-cctbreg: \global\advance\lltxb@catcodetable@alloc\@ne luatexja-cctb: \global\advance\lltxb@catcodetable@alloc\tw@という違いがあります.そのため,
\unless\ifx\ltj@@cctb@org@def\newluatexcatcodetable % Failure: luatexbase-cctb is not of expected version! %%% \bebo <- the meaning of this control sequence? \ltj@@cctb@failure=3 % \fiでの比較が常に失敗してしまっています.\@ne を \tw@ に単純に書き換えればいいのかな(よくわかりませんが)?
cctbtest.tex で試してみました.従来の \@ne だとパッチが当たらず,
\newluatexcatcodetable(luatexbase-cctb) \char"F \char"11 \char"13 \char"15 \char"17 \newcatcodetable(luatex by HO) \char"9 \char"B \char"D \char"F \char"11と干渉は消えないようです.\tw@ にしたら,
\newluatexcatcodetable(luatexbase-cctb) \char"8010 \char"8012 \char"8014 \char"8016 \char"8018 \newcatcodetable(luatex by HO) \char"9 \char"B \char"D \char"F \char"11となって干渉しなくなっているようなので,commit 0336a9f で \tw@ に直しておきました.
ありがとうございます.試してみたのですが,luatexja-fontspec を読み込むと Segmentation fault が出るようになってしまいました.
\documentclass{ltjsarticle} \usepackage{luatexja-fontspec} \begin{document} \end{document}で,
lualatex test This is LuaTeX, Version beta-0.70.2-2012052410 (TeX Live 2012) restricted \write18 enabled. (./test.tex ... ************************************************* * LaTeX warning: "xparse/redefine-command" * * Redefining document command \oldstylenums with arg. spec. 'm' on line 107. ************************************************* ) (/usr/local/texlive/2012/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty (/usr/local/texlive/2012/texmf-dist/tex/latex/base/fontenc.sty (/usr/local/texlive/2012/texmf-dist/tex/latex/euenc/eu2enc.def) (/usr/local/texlive/2012/texmf-dist/tex/latex/euenc/eu2lmr.fd)(load: /home/kmae da/.texlive2012/texmf-var/luatex-cache/generic/fonts/otf/temp-lmroman10-regular .lua)) (/usr/local/texlive/2012/texmf-dist/tex/xelatex/xunicode/xunicode.sty (/usr/local/texlive/2012/texmf-dist/tex/latex/tipa/t3enc.defSegmentation faultとなります.
luatexja-fontspec を読み込むと Segmentation fault が出るように
LuaTeX r4486 で確認しました.こればっかりはマクロで解決するものでもないしなあ,時間があったら見てみます.
# 種別を「サポートリクエスト」に変更しました.
r4486 での gdb の出力を貼っておきます.読ませたコードは上のものと同じです.
(/usr/local/texlive/2012/texmf-dist/tex/latex/tipa/t3enc.def Program received signal SIGSEGV, Segmentation fault. 0x00000000004e044d in get_sa_item (head=0x1500000007, n=74) at ../../../source/texk/web2c/luatexdir/utils/managed-sa.w:65 65 if (head->tree != NULL) { (gdb) list 60 @ @c 61 sa_tree_item get_sa_item(const sa_tree head, const int n) 62 { 63 register int h; 64 register int m; 65 if (head->tree != NULL) { 66 h = HIGHPART_PART(n); 67 if (head->tree[h] != NULL) { 68 m = MIDPART_PART(n); 69 if (head->tree[h][m] != NULL) { (gdb) print head $1 = (const sa_tree) 0x1500000007 (gdb) print head->tree Cannot access memory at address 0x1500000017 (gdb) backtrace #0 0x00000000004e044d in get_sa_item (head=0x1500000007, n=74) at ../../../source/texk/web2c/luatexdir/utils/managed-sa.w:65 #1 0x00000000004d776e in get_cat_code (h=-32758, n=74) at ../../../source/texk/web2c/luatexdir/tex/textcodes.w:165 #2 0x00000000004d9162 in get_next_file () at ../../../source/texk/web2c/luatexdir/tex/textoken.w:823 #3 0x00000000004db3ec in get_next () at ../../../source/texk/web2c/luatexdir/tex/textoken.w:1435 #4 0x00000000004db4fd in get_token_lua () at ../../../source/texk/web2c/luatexdir/tex/textoken.w:1503 #5 0x00000000004be7a0 in scan_toks (macro_def=1, xpand=1) at ../../../source/texk/web2c/luatexdir/tex/scanning.w:2086 #6 0x00000000004a8d41 in prefixed_command () at ../../../source/texk/web2c/luatexdir/tex/maincontrol.w:2201 #7 0x00000000004a42fc in main_control () at ../../../source/texk/web2c/luatexdir/tex/maincontrol.w:905 #8 0x00000000004a0ebd in main_body () at ../../../source/texk/web2c/luatexdir/tex/mainbody.w:467 #9 0x00000000004757c5 in main (ac=2, av=0x7fffffffde78) at ../../../source/texk/web2c/luatexdir/luatex.c:471get_cat_code の引数 h の値が怪しい?
原因はこれかな? 以下で Segmentation fault が出ます.
\documentclass{article} \begin{document} % OK \chardef\tmpcctb"7FFF \luatexinitcatcodetable\tmpcctb \directlua{tex.print(\the\tmpcctb, 'a')} % NG \chardef\tmpcctb"8000 \luatexinitcatcodetable\tmpcctb \directlua{tex.print(\the\tmpcctb, 'a')} \end{document}tex.print() の第1引数に 0x8000 以上の値を入れると,signed で読まれてエラーになるみたいです.
自分でもよくわかりませんが,luatex-r4486_cctb.diff のようにすればいいのかな? (Taco に投げるべきだと思いますが)
修正は2箇所ですが,単純に
signed int cattable_field:16; line_catcode_table = (short) luacstring_cattable();を
unsigned int cattable_field:16; line_catcode_table = (unsigned short) luacstring_cattable();とするのはダメのようです(DEFAULT_CAT_TABLE := -1 のため).
自分でもよくわかりませんが,luatex-r4486_cctb.diff のようにすればいいのかな? (Taco に投げるべきだと思いますが)
試してみたところ,落ちなくなりました.
tex.print(0x10000, 'a')とかやっても何もエラーが出ないのが少し気になりますが,-1 とかでも何も出ないのでよいのかな. Taco さんに投げてみるとよいと思います.
luatexja-fontspec を読み込むと Segmentation fault が出るように
上流で fixされるまで,当面は commit c51f758 のようにして回避することにしましょう. luatexbase-cctb の使う範囲を "4000 = 16384 から "7FFF = 32767 の範囲にして, luatex.sty の使う範囲を "3FFF = 16383 までとしています.
LuaTeX r4519 で catcodetable の範囲が 0--32767 に制限されるようになりました.
fix bug 786 by limiting catcode tables to a 15-bit int.
TL 2013 pretest での luatexbase のアップデートにより,ltj-cctbreg.sty のパッチが当たらなくなっていたので修正しました (b6b0556). luatex.sty の \IncCatcodeTableStack の定義が luatexbase-cctb.sty によって上書きされているようで, とりあえずそちらに合わせたのですが,これで問題ないのでしょうか. 一応 cctbtest.tex のテストでは問題なく動いているように見えます.
(遅くなってすみません。)
ltj-cctbreg サブパッケージは luatex パッケージと luatexbase-cctb の「衝突」に 対処するための応急処置でした。
しかし、luatexbase の 0.6 版でこの「衝突」は解消されています。
なので、このサブパッケージは削除してしまってかまいません。
※詳細は省きますが、実際には、過去(多分 2011-04-18; 「パッチが当たらない」になるのはそれ以降) の更新でこの「衝突」は通常の使用では無害になっていました。
消しました (a507d16).
今更ですが,今のバージョンの LuaTeX-ja では,TeX Live 2012 で使用すると
という Warning が必ず出てます.ltj-cctbreg.sty を読む限りだと,これが出ているということは 本処理に入る前に \ltj@@cctb@check@failure で終了してしまうので,結局何もしていないように 思うのですが,それで正しいでしょうか? Warning を出す状態のまま放置されているのもどうかと思うので,あるべき姿にできればよいのですが.