lua-users home
lua-l archive

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


See this thread for a fix!
http://lua-users.org/lists/lua-l/2005-06/msg00174.html


-----Original Message-----
From: lua-bounces@bazar2.conectiva.com.br
[mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Vijay
Aswadhati
Sent: 01 August 2005 08:14
To: lua@bazar2.conectiva.com.br
Subject: Lua 5.1 (work6): access violation ...

Greetings:

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("Hi")
     )

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
'LUA_ROOT'.

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

Thanks in advance
Vijay Aswadhati