lua-users home
lua-l archive

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


Hi All,

shouldn't this line:

https://github.com/lua/lua/blob/75ea9ccbea7c4886f30da147fb67b693b2624c26/ldo.c#L216

read 
lua_assert(lim <= L->stack_last + EXTRA_STACK);

with EXTRA_STACK added?

The assertion sometimes gets triggered in the code I'm working on. It's not easy to reproduce, as the stack size needs to be just right, and the GC needs to run at just the right time.

The relevant part of the call stack looks like this (running inside a coroutine):

    abort at <newlib_build>/newlib/abort.c:46

    stackinuse at <lua_build>/lua/ldo.c:216
    (inlined by) luaD_shrinkstack at <lua_build>/lua/ldo.c:222                        

    traversethread at <lua_build>/lua/lgc.c:549
    (inlined by) propagatemark at <lua_build>/lua/lgc.c:588                          

    singlestep at <lua_build>/lua/lgc.c:1057

    luaC_step at <lua_build>/lua/lgc.c:1137 (discriminator 2)

    luaD_precall at <lua_build>/lua/ldo.c:424

    luaD_precall at <lua_build>/lua/ldo.c:413
    (inlined by) luaD_call at <lua_build>/lua/ldo.c:498                              

    luaT_callTM at <lua_build>/lua/ltm.c:114

    luaV_finishget at <lua_build>/lua/lvm.c:182

    luaV_execute at <lua_build>/lua/lvm.c:845 (discriminator 10)

    luaD_call at <lua_build>/lua/ldo.c:499

    lua_pcallk at <lua_build>/lua/lapi.c:981

Line numbers are for lua 5.3.5:
https://github.com/lua/lua/tree/063d4e4543088e7a21965bda8ee5a0f952a9029e

Best regards,
Szymon Modzelewski