[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Bug report : A weak table reuse a string key that already free
- From: Roberto Ierusalimschy <roberto@...>
- Date: Tue, 22 Aug 2017 16:48:48 -0300
> 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