lua-users home
lua-l archive

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

Thanks for the answer, it seems that it was indeed that missing parameter. By passing the main lua state as "from" the coroutines are properly executed. In my opinion this behaviour change should be listed alongside the version incompatibilities, as it's pretty difficult to track down.


Il giorno lun 2 nov 2020 alle ore 00:55 Andrew Gierth <> ha scritto:
>>>>> "Edoardo" == Edoardo  <> writes:

 Edoardo> I tried using debug.setcstacklimit when I first encountered
 Edoardo> this issue, but regardless of the value I set (in the whole
 Edoardo> range, from 100 to 39999) it always ends up with a stack
 Edoardo> overflow in the coroutine.

The problem is that you're not passing the "from" parameter when
resuming the coroutine.

5.4 only allows a minimal C stack limit when you do this (the purpose of
the "from" parameter is to propagate the existing C stack depth counter
from the current state to the new one). This seems to be the opposite of
5.3's behavior which is to assume the whole stack depth is available if
from is null.