lua-users home
lua-l archive

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


2011/3/23 Sylvain Fabre <sylvain.fabre@inpixal.com>:
> Le 23/03/2011 12:01, Mike Pall a écrit :
>>
>> Sylvain Fabre wrote:
>>>
>>> After approx. 6 hours of processing, i get the following lua error :
>>> "Internal error - Stack overflow", but with no other specific clues.
>>
>> The string "Internal error" appears nowhere in the source code of
>> LuaJIT. Also, a Lua stack overflow would show with a lower case
>> error message ("stack overflow").
>>
>> I suggest you look for the component that generates the error.
>
> Yes, sorry : "Internal error" is coming from our layer, and we get a "stack
> overflow" from LuaJIT (ie  in lower case).

You could try to lower the available stack size (I think that's
possible somewhere...) to avoid 6hour+ runtime for debugging. And a
traceback would certainly help to pinpoint the problem in no time ;)
Also, it could be that you don't do tail recursions correctly in some loop, like

function frame()
  -- stuff
  return frame()+1 -- <- +1 prevents successful tail recursion
end

Beyond that, I think to remember that some debug options disable tail
recursions and therefore can also lead to stack overflows where none
should happen. But could be wrong on that.

Cheers,
Eike