|
> After a stack overflow in a coroutine, the GC appears not to clean up
> its stack. This seems to happen at least in Lua 5.1.5 and one built
> from Git commit ea39042e13645f63713425c05cc9ee4cfdcf0a40 (5.4.6+)
> (Debian amd64).
This is expected behavior. After an error in a coroutine, you can still
inspect its stack (e.g., to make a trace), so the stack cannot be
cleared.
Once the coroutine itself becomes garbage, then its stack
can be collected: