lua-users home
lua-l archive

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


Hello (yay, first post here).

I'm a developer of the MMO Regnum Online which uses LUA extensively on
both server and client. We've been watching LuaJIT 2.x development
with great interest as it could help - theoretically - to improve our
server concurrent player capacity.
We can build the server (with latest LuaJIT - beta6) in both 32 and 64
bit. 32 bit mode works, but 64bit mode crashes frequently when calling
lua_resume (we've been adding coroutines to the server engine lately).
For what I could figure out, the lua_resume execution ends overwriting
some registers (r12) where the 'this' pointer was stored.

Here's the troubled code:
...
self->push_lua_state(T); // here self is a valid pointer
ok = lua_resume(T, top - 2);
self->pop_lua_state(); // here 'self' is corrupted and points to some
weird location and the program crashes.
...

If someone could shed a light on this, I'll be eternally grateful.
Tell me if you need something else.

Best regards,
-- Marco