View Issue Details

IDProjectCategoryView StatusLast Update
0000773luatexluatex bugpublic2013-03-21 09:19
Reporteroberdiek Assigned ToTaco  
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
Platformi386-linux 
Product Version0.70.1 
Summary0000773: Undefined "\csname\endcsname" crashes after \if or \ifcat
DescriptionI have received a bug report for hyperref and could strip it down to a
bug in LuaTeX.

The following token sequence (tokens in angle brackets):

  <\if> <\noexpand> <\csname\endcsname>

crashes, if the third token <\csname\endcsname> is undefined.
That token is created by \csname and \endcsname without tokens inbetween.
Also it is needed to get rid of the side effect of \csname that an undefined
command is defined with meaning \relax:

  \begingroup\expandafter\endgroup
  \expandafter\if\expandafter\noexpand\csname\endcsname\relax\fi

In LuaTeX 0.70.1-2011061416 (rev 4277) of TeX Live (i386-linux)
the result is a crash, output of gdb:

| Program received signal SIGSEGV, Segmentation fault.
| 0x0814cf40 in conditional ()

The segmentation fault is also triggered by using \ifcat instead of \if.
Steps To ReproduceRun the test file through LuaTeX:

$ luatex --ini test

%%% test.tex %%%
\catcode`\{=1
\catcode`\}=2

\begingroup\expandafter\endgroup
\expandafter\if\expandafter\noexpand\csname\endcsname\relax\fi

\csname @@end\endcsname\end
%%% test.tex %%%
Additional Information
An older version 0.60.2-2010071421 (Web2C 2010) (rev 3736) (MiKTeX 2.9)
generates an error instead:

| ! Emergency stop.
| <recently read> \notexpanded: \csname\endcsname
|
| l.5 ...er\if\expandafter\noexpand\csname\endcsname
| \relax\fi

The following workaround avoids an undefined \csname\endcsname token
by giving it the meaning \relax without unnecessary execution of the
token:

  \expandafter\ifx\csname\endcsname\relax\fi
TagsNo tags attached.

Activities

oberdiek

2012-09-23 22:04

reporter  

a.txt (154 bytes)   
\catcode`\{=1
\catcode`\}=2

\begingroup\expandafter\endgroup
\expandafter\if\expandafter\noexpand\csname\endcsname\relax\fi

\csname @@end\endcsname\end
a.txt (154 bytes)   

oberdiek

2012-09-23 22:12

reporter   ~0000958

Also LuaTeX 0.70.2-2012062812 of TL 2012 crashes.

Issue History

Date Modified Username Field Change
2012-09-23 22:04 oberdiek New Issue
2012-09-23 22:04 oberdiek File Added: a.txt
2012-09-23 22:12 oberdiek Note Added: 0000958
2012-12-13 15:31 Taco Status new => resolved
2012-12-13 15:31 Taco Resolution open => fixed
2012-12-13 15:31 Taco Assigned To => Taco
2013-03-21 09:19 Taco Status resolved => closed