New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ptex] 大量のフォント読込で Segmentation fault #152
Comments
おっと,そもそも ptex ではフォント数の上限が 256 みたい????? %#!ptex -ini
\tracingonline1 \tracingoutput1 \showboxdepth10000 \showboxbreadth10000
\expandafter\font\csname\romannumeral1\endcsname andk-Bold-tlf-ly1 \csname\romannumeral1\endcsname
\expandafter\font\csname\romannumeral2\endcsname andk-Bold-tlf-ot1 \csname\romannumeral2\endcsname
\expandafter\font\csname\romannumeral3\endcsname andk-Bold-tlf-sc-ly1--base \csname\romannumeral3\endcsname
\expandafter\font\csname\romannumeral4\endcsname andk-Bold-tlf-sc-ly1 \csname\romannumeral4\endcsname
\expandafter\font\csname\romannumeral5\endcsname andk-Bold-tlf-sc-ot1--base \csname\romannumeral5\endcsname
...
\expandafter\font\csname\romannumeral254\endcsname Comfortaa-Regular-T2C-Slanted--base \csname\romannumeral254\endcsname
\expandafter\font\csname\romannumeral255\endcsname Comfortaa-Regular-T2C-Slanted \csname\romannumeral255\endcsname
\expandafter\font\csname\romannumeral256\endcsname Comfortaa-Regular-T2C \csname\romannumeral256\endcsname
\expandafter\font\csname\romannumeral257\endcsname Comfortaa-Regular-TS1--base \csname\romannumeral257\endcsname
\expandafter\font\csname\romannumeral258\endcsname Comfortaa-Regular-TS1-Slanted--base \csname\romannumeral258\endcsname
\expandafter\font\csname\romannumeral259\endcsname Comfortaa-Regular-TS1-Slanted \csname\romannumeral259\endcsname
\expandafter\font\csname\romannumeral260\endcsname Comfortaa-Regular-TS1 \csname\romannumeral260\endcsname
\expandafter\font\csname\romannumeral261\endcsname Comfortaa-Regular-X2--base \csname\romannumeral261\endcsname
a\end
なぜかフォント |
pTeX では max_quarterword=255 なのが,e-pTeX, (e-)upTeX では max_quarterword=65535 であることが影響していそうな気がします(後で texmfmem.h の中身を調べます). |
あたりでした.まず TeX 側でノード p のフォントを示す font(p) は,C 言語では そこで texmfmem.h を見たところ,「1 つのノード」を表す型は次のようになっています(改行位置を改めとか,不要な部分を削除するなどしています)
欧文 TeX では
となり, 一方 pTeX 系では
となり, pTeX ではquarterword は unsigned char の別名,e-pTeX, (e-)upTeX ではquarterword は unsigned short の別名なので,全部まとめると pTeX p4.x だけフォント数の上限が256(欧文 TeX ですらそれ以上使える)ことになります. 解決策は次のどちらかです:
#81 への対応 (pTeX p4.0.0) で埋め込まれてしまったバグですが,なぜこうしてしまったのかは覚えていません……. |
調査ありがとうございます。確かに TL2021 の ptex (p3.9.0) では上限に引っかかりませんでした…。意図せず pTeX-p4.0.0 でフォント数上限が 256 に減っていたのですね。元どおり使えるようにするには
だと理解しますが b7665e0 での texmfmem.h の条件文変更を元に戻すと何か不都合があるのか試します。 [edit] いやでも e-(u)pTeX が問題ないので「pTeX は廃止してしまう」の方が手っ取り早い気がする…。 |
b7665e0 では |
もう一案の「条件文は変更後のママ,pTeX で
くらいの影響で済むように思います。どちらがよいでしょう。 |
こちらの方が pTeX ←→ upTeX/e-pTeX/e-upTeX の差分を減らせるので 4e9dafc で試しています。 |
大丈夫そうなのでマージしました。r64914 |
大量のフォントを読込でメモリを消費すると,ptex が Segmentation fault: 11 する場合があります。
私のところでは r64841 からビルドした ptex で toomany.tex.txt で落ちましたが,同じソースでは uptex, eptex, euptex は落ちません。
といった上限に引っかからずに落ちるには,かなり微妙な占有状況が必要なようです。
The text was updated successfully, but these errors were encountered: