I am starting to push the limits of my app and I am starting to see issues with lua.
I was able to extract an exemple of the problem I am having.
I am trying creating a hierarchy of lua table a bit like this :
{
asdf =
{
asdf =
{
asdf =
{
... many many times.
}
}
}
}
I made a small c function to build the hierarchy...
void makeManyTables(lua_State * const p_state, size_t const p_num)
{
for(size_t i = 0; i < p_num; ++i)
lua_newtable(p_state);
for(size_t i = 0; i < p_num; ++i)
lua_setfield(p_state, -2, "asdf");
}
... and I can test it like this :
lua_newtable(state); makeManyTables(state, 50);
It works when the "p_num" value is relatively small (30)... But it crash violently when I raise the bar to 50.
50 levels of tables seems a bit low...
this is the error I get when I try to run this code with 50 levels.
HEAP[Test.exe]: Invalid address specified to RtlValidateHeap( 00230000, 002374C0 ) Windows has triggered a breakpoint in Test.exe. This may be due to a corruption of the heap, which indicates a bug in Test.exe or any of the DLLs it has loaded.
I saw some post about heap corruption if lua is linked as a DLL, this is not my case, I have a single executable and all the files needed are included in this single project.
Have you ever saw this issue before?
Thanks,
Gab.






