View Issue Details

IDProjectCategoryView StatusLast Update
0000786luatexluatex bugpublic2013-03-21 10:19
ReporterTaco Assigned ToTaco  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Summary0000786: Segmentation fault by catcode table >= 0x8000
DescriptionHello all,

The following source causes a Segmentation fault on LuaLaTeX (r4486):

---- test.tex ---
\documentclass{article}
\begin{document}
\chardef\tmpcctb"8000
\luatexinitcatcodetable\tmpcctb
\directlua{tex.print(\the\tmpcctb, 'a')}
\end{document}
----

I found the catcode table index is only signed short, and
I think this is the cause of a Segfault.

> signed int cattable_field:16;
  (inputstack.h l.37)
> line_catcode_table = (short) luacstring_cattable();
  (textoken.w, l.1281)

If I replaced these two lines by the following respectively,
the above test.tex can be processed without error.
> int cattable_field;
> line_catcode_table = luacstring_cattable();
(Perhaps we also need "check_cattable_range()" in ltexlib.c)

Regards
Hironori KITAGAWA
TagsNo tags attached.

Activities

Taco

2012-12-14 10:24

administrator   ~0001008

fixed by limiting the valid catcodetable range to 15 bits.

Issue History

Date Modified Username Field Change
2012-12-02 10:10 Taco New Issue
2012-12-02 10:10 Taco Status new => assigned
2012-12-02 10:10 Taco Assigned To => Taco
2012-12-14 10:24 Taco Note Added: 0001008
2012-12-14 10:24 Taco Status assigned => resolved
2012-12-14 10:24 Taco Resolution open => fixed
2013-03-21 10:19 Taco Status resolved => closed