lua-users home
lua-l archive

Re: g->GCthreshold overflow, possible bug?

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


> Today I noticed some strange behavior in my lua application:
> My application disables lua autogc and manually calls
> lua_gc(LUA_GCSTEP) regularly. When memory usage exceeds 2G, each
> call to lua_gc(LUA_GCSTEP) becomes a full gc cycle (retval = 1).
> I managed to track down the cause of this problem to the following
> line in lgc.c:
> 
> #define setthreshold(g) (g->GCthreshold = (g->estimate/100) * g->gcpause)
> 
> When g->estimate exceeds 2G and gcpause remains its default value
> 200, GCthreshold will overflow uint32 range.
> [...]
> 
> Is this a bug?
Yes.
> Is there any known solution for this?
Did you try to change the pause to 100, to avoid the overflow?
-- Roberto

AltStyle によって変換されたページ (->オリジナル) /