[NTG-pdftex] segfault with \pdfadjustinterwordglue

Hans Hagen j.hagen at xs4all.nl
Tue May 26 15:48:23 CEST 2020


On 5/26/2020 3:25 PM, Hironobu Yamashita wrote:
> Hi Robert,
> 
> Confirmed here; it seems that pdftex.web L.3779
> 
> @d auto_kern == explicit
> 
> is the culprit.
> 
> In your proposed MWE, when the function adjust_interword_glue()
> is called, the tail node is \kern1pt thus (type=kern_node) and
> (subtype=explicit).  However, "@d auto_kern == explicit" is set,
> it falls through the following conditions.
> 
>      else if (type(p) = kern_node) and
>              (subtype(p) = auto_kern) and
>              (save_tail <> null) then
> 
> When I change that line to
> 
> @d auto_kern == 3 {|acc_kern| + 1}
> 
> the problem is gone.  I'm not sure whether there is some
> side effect.

That all depends on whether the machinery checks for a subtype ... when 
I look at the pdftex.web source (on the web that is) i see for instance 
that the line break code does some check:

   kern_node: if subtype(s)<>explicit then goto done

So when you change subtype 2 to 3 that will behave different. Now, I 
have no clue what this interword features does but you enter this code

  while (link(r) <> null) and (link(r) <> p) do
       r := link(r);
  if (link(r) = p) then
     set_char_and_font(r);

and there should probably be checks there, like

  while (r) and (link(r) <> null) and (link(r) <> p) do
       r := link(r);
  if (r) and (link(r) = p) then
     set_char_and_font(r);

so that you don't access null nodes

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the ntg-pdftex mailing list