lua-users home
lua-l archive

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


Finally got around to setting up my VC6++ projects for Lua 5.1(work6). As per
the installation instructions, I organized the code into three projects:
- Lua Dynamic Library (Multithreaded DLL CRT): output = LUA.dll
- Lua Interpreter (Multithreaded DLL CRT), depends on LUA.dll: output = lua.exe
- Lua Compiler (Multithreaded DLL CRT), depends on LUA.dll: output = luac.exe

Unfortunately the very first thing I tried results in access violation. Can
someone try this code and tell me what the results are:

<lua code>
co = coroutine.create(function()

print (co) --> access violation

print (coroutine.status(co)) --> this however does not crash
</lua code>

The crash is consistent and occurs in the following function in ltable.c:
<c code>

** search function for strings
const TValue *luaH_getstr (Table *t, TString *key) {
  Node *n = hashstr(t, key);
  do {  /* check whether `key' is somewhere in the chain */
    if (ttisstring(gkey(n)) && rawtsvalue(gkey(n)) == key) /* <-- crash --- */
      return gval(n);  /* that's it */
    else n = gnext(n);
  } while (n);
  return &luaO_nilobject;
</c code>

I did not find any funky looking values for the variables on the stack when the
crash occurs. The only modification I made to 'luaconf.h' was to the

Is this a known bug?  Are there any official patches that I am missing to

Thanks in advance
Vijay Aswadhati