[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Facing GC infinite loop in Lua 5.1
- From: nerditation <nerditation@...>
- Date: Wed, 3 Feb 2021 22:50:35 +0800
On 2021/1/28 2:15, Wagner Fernando Fazio wrote:
> I’m looping forever when calling luaC_fullgc and can not realize why it is happening. Every call do singlestep() does nothing and sweeplist() keeps trying to mark objects as white in every call.
> At this moment, my debugger shows deadmask==33(0x21) and all are gch.marked==2.
> Can someone figure out situations where it may happen?
do you use a patched Lua or official release version? which exact version of Lua do you use?
or do you have a custom memory allocator?
if the gc got stuck in the sweep phase, I can only imagine there exists a cycle in the `allgc`
list, which should be a singly linked list through the `gch->next` field in every gc object.
so I suspect your allocator might caused a memory corruption and overwritten the `gch->next`
field of some gc objects, which happened to point to some other objects, thus making the `allgc`
list `infinitely` long.