[luatex] Setting internal parameters of TeX in a callback

Taco Hoekwater taco at elvenkind.com
Wed Jun 18 10:26:47 CEST 2014


On 17 Jun 2014, at 14:07, Hironori KITAGAWA <h_kitagawa2001 at yahoo.co.jp> wrote:

> Hello,
> 
> When I processed the following source (test1.tex) by LuaTeX rev 5021,
> I got "assertion failed" error:
> 
> ----
> %#!luatex
> \directlua{
>  callback.register('vpack_filter',
>    function(h)
>      tex.set('vbadness', 2000)
>      return h
>    end
>  )
> }
> 
> \vbox{}
> \bye
> ----
> $ luatex test1
> This is LuaTeX, Version beta-0.79.1 (TeX Live 2014/dev) (rev 5021) 
> restricted \write18 enabled.
> (./test1.texluatex: ../../../source/texk/web2c/luatexdir/tex/texnodes.w:1022: free_error: Assertion `p> my_prealloc' failed.
> ----
> 
> Is it dangerous to assign internal parameters of TeX 
> in a callback, as in test1.tex above?

The crash was a bug, and that was easily fixed (already committed to the luatex repo). However,
what assignments there do, is probably not what you want: it is functionally equivalent to:


   \vbox{}
   \vbadness2000

(to put it another way: any tex.set() inside the filter are acted upon *after* the closing brace of the box.

Best wishes,
Taco





More information about the luatex mailing list