lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> I found a bug of lua 5.3.4 in our project, but it's hardly to make a simple
> pure lua minimal reproducible example.

Many thanks for the report. At least in my machine, I can reproduce the
bug with a pure Lua example, using valgrind. The following code (mainly
your Lua code without the C around it) is enough for valgrind to signal
an access to a collected object:

------------------------------------------------------------
local a = setmetatable({}, {__mode = 'kv'})

a['ABCDEFGHIJKLMNOPQRSTUVWXYZ' .. 'abcdefghijklmnopqrstuvwxyz'] = {}
a[next(a)] = nil
collectgarbage()
a['ABCDEFGHIJKLMNOPQRSTUVWXYZ' .. 'abcdefghijklmnopqrstuvwxyz'] = {}
------------------------------------------------------------

I will have a look at it.

-- Roberto