[luatex] double free noded

Patrick Gundlach patrick at gundla.ch
Wed Jun 29 09:46:03 CEST 2011


Hi,

can someone explain this behavior to me?

test.tex:
------
\directlua{dofile("test.lua")}
\bye
------

test.lua:
------------------
local tenpt = 10 * 2^16

local r1 = node.new("rule")
r1.width = 2* tenpt
r1.height = tenpt
r1.depth = tenpt
local tmp = node.vpack(r1)
tex.box[666] = tmp

tmp = node.vpack(tex.box[666])
tex.box[777] = tmp

tex.shipout(777)

local r1 = node.new("rule")
r1.width = 2* tenpt
r1.height = tenpt
r1.depth = tenpt
local tmp = node.vpack(r1)

-- to make sure it's this box that is double freed:
-- print(tostring(tex.box[666])) 

tex.box[666] = tmp
------------------


this results in 

This is LuaTeX, Version beta-0.65.0-2011010915 (rev 4045) 
 restricted \write18 enabled.
(./test.tex [1]
! Attempt to double-free vlist node 198, ignored.
l.1 \directlua{dofile("test.lua")}
                                  
and node 198 seems to be the one in tex.box[666]

At the last line, tmp is a valid vbox, I assume, and assigning the vbox to the box register 666 seems to run a "free node" routine, which seems to fail. I suppose that the box 666 should have been cleared by tex.shipout(777) which has 666 in its vbox.

Patrick






More information about the luatex mailing list