lua-users home
lua-l archive

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


Hi,

this is my traversal code copied right from the docu:

   if (mLuaScriptReadyToExecute)
   {
       if(0 /*normal/unyielded*/ == lua_status(mpLuaState))
       {
           //init lastCycleTimer timer before coroutine starts 1st time
           //to measure elapsed time

           if (mpLuaState && mResetRequires)
           {
               mResetRequires = false;
               lua_getfield(mpLuaState, LUA_REGISTRYINDEX, "_LOADED");

               if (lua_istable(mpLuaState, -1))
               {
                   lua_pushnil(mpLuaState);  /* first key */

                   while (lua_next(mpLuaState, -1))
                   {
/* uses 'key' (at index -2) and 'value' (at index -1) */
                       printf("%s - %s\n",
lua_typename(mpLuaState, lua_type(mpLuaState, -2)), lua_typename(mpLuaState, lua_type(mpLuaState, -1))); /* removes 'value'; keeps 'key' for next iteration */
                       lua_pop(mpLuaState, 1);
                   }
               }
           }
       }


First-chance exception at 0x00385cba (lua.dll) in entityManager.exe: 0xC0000005: Access violation reading location 0x75758f7f. the left ob the bot TValue parameters to luaO_rawequalObj seems to point into nirvana.

The callstack is shown here
http://img253.imagevenue.com/img.php?image=32004_lua_crash_callstack_122_417lo.jpg

No, I don't access lua_State from multiple threads.

Does anybody knows what I'm doing wrong?

Thank you in advance!