Menu

#141 xetex crash on enough invalid utf-8

Future
closed
nobody
None
5
2018-02-03
2017-07-20
karl berry
No

as reported by leo liu on the tex-live list, xetex crashes on enough invalid utf-8 input. his files attached. the problem here is that a .png file is being \read (due to the multiple dots in the image filename -> treated as EPSF), so naturally there is tons of invalid UTF-8. but the point is, xetex shouldn't ever crash.

Invocation is just "xelatex 2.tex" ... thanks, karl.

1 Attachments

Discussion

  • Akira Kakuto

    Akira Kakuto - 2017-07-22

    The following comment may not help, sorry.
    It seems that the actual crash occurs at or near
    the line 8348 in xetex.web:
    cur_cmd:=eq_type(cur_cs); cur_chr:=equiv(cur_cs);

    Akira

     
  • Hironobu Yamashita

    It seems the following source is enough to force XeTeX crash:

    % ================
    \def\A{}
    \openin1=badfile
    \read1 to \A
    \closein1
    \edef\B{\A}
    \end
    % ================

    The file being read ("badfile") contains only 4 bytes:
    F4 A7 81 81

    (These four bytes are not so specific, because other
    byte sequences can also reproduce the crash.)

    The files are attached.

    Best,
    Hironobu Yamashita

     
  • Akira Kakuto

    Akira Kakuto - 2017-11-06

    I think that an attached patch XeTeX_ext.c.diff fixes the
    problem. There are no crashes for badutf.tgz
    and x3badfile.zip

    Best,
    Akira

     
  • Hironobu Yamashita

    I think that an attached patch XeTeX_ext.c.diff fixes the problem.

    It works! Thanks -- Hironobu

     

    Last edit: Hironobu Yamashita 2017-11-06
  • Jonathan Kew

    Jonathan Kew - 2017-11-07

    Thanks for the patch, Akira; looks fine. I applied it to the SF repository, so this should be fixed for the next version.

     
  • Jonathan Kew

    Jonathan Kew - 2018-02-03

    Should be fixed in b7ef352d2c0dd164f339eaf3d522cc752bb185c4.

     
  • Jonathan Kew

    Jonathan Kew - 2018-02-03
    • status: open --> closed
     

Anonymous
Anonymous

Add attachments
Cancel