On 17 Jun 2014, at 14:07, Hironori KITAGAWA <[email protected]> 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



Reply via email to