[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: LuaJIT 2.0.0-beta5: Strange crash (probably my fault but ..)
- From: Nicolas <nicolas@...>
- Date: 26 Jan 2011 15:00:50 +0100
> The most likely cause for this is an immediately preceding call to
> a C function from your Lua code. If this call returns an undefined
> or bad value (e.g. more than it pushes on the stack), it'll mess
> up the internal Lua stack, which may lead to a crash later on.
Ah yes indeed, I found some bad cases, I must have been blind, I never
even know about the assert mode in lua :)
> > For reference, my docall method is as follow, nothing fancy:
> Not spectacularly efficient code, but I guess this doesn't matter
> much here. Remember that lua_pushcfunction() allocates memory for
> a new closure, each time you run it. I guess it would be better to
> use debug.traceback as an error handler, anyway.
Thanks, I'm now on the right track!