[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Crash (and/or going nuts) in case of error in __gc (Lua 5.4)
- From: Roberto Ierusalimschy <roberto@...>
- Date: Wed, 19 Jun 2019 08:54:30 -0300
> >> I originally got this in my (C++ bridge) library where results were
> >> even more weird, including runtime errors (accusing me in calling
> >> table), syntax errors, segfaults, double-frees and more.
>
> [...]
>
> Looks to me like a stack error; the error object left on the stack by
> luaD_pcall is never popped, so the state of the stack is messed up by
> the garbage collector. The subsequent error will depend on where the GC
> was invoked from, so it's likely to be quite variable.
>
> I guess there needs to be an L->top -= 1; after the luaE_warning calls.
Many thanks for the original report and for this prompt diagnostic.
-- Roberto