lua-users home
lua-l archive

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


> > That is weird. The number of frames should be 2*n: for each module,
> > it needs one frame for 'require' and one frame for the module itself.
> > I tested with 10 nested modules (which used 20 frames) and did not
> > find any problem.
> >
> 
> The following bash script results in this output:
> 
> [...]

Neither the main thread nor coroutines has this behavior, but
independent threads are indeed being created with a very small
stack limit. The following change should fix the issue:

--- a/lstate.c
+++ b/lstate.c
@@ -288,3 +288,2 @@ static void preinit_thread (lua_State *L, global_State *g) {
   L->errorJmp = NULL;
-  L->nCcalls = CSTACKTHREAD;
   L->hook = NULL;
@@ -329,2 +328,3 @@ LUA_API lua_State *lua_newthread (lua_State *L) {
   preinit_thread(L1, g);
+  L1->nCcalls = getCcalls(L);
   L1->hookmask = L->hookmask;


-- Roberto