lua-users home
lua-l archive

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

Hi all!

I'm trying to move to Lua 5.1.1 from Lua 5.0.2.

While porting, I experience crash in luaM_realloc_() call inside
garbage collection inside lua_close() call.

 block = (*g->frealloc)(g->ud, block, osize, nsize);

Debugger shows that g->ud is NULL. Can anyone give me any hints on how
to debug such crashes in Lua?

More information follows.

Thanks in advance,


Output window text:
HEAP[GameTI-d.exe]: Invalid Address specified to RtlValidateHeap(
003D0000, 1014F9E8 )
Windows has triggered a breakpoint in GameTI-d.exe.

This may be due to a corruption of the heap, and indicates a bug in
GameTI-d.exe or any of the DLLs it has loaded.

Call stack:
	ntdll.dll!_RtlpBreakPointHeap@4()  + 0x28 bytes	
	ntdll.dll!_RtlpValidateHeapEntry@12()  + 0x113 bytes	
	ntdll.dll!_RtlValidateHeap@12()  + 0xe0 bytes	
	kernel32.dll!_HeapValidate@12()  + 0x14 bytes	
	msvcr80d.dll!_CrtIsValidHeapPointer(const void *
pUserData=0x1014fa08)  Line 1963	C++
	msvcr80d.dll!_free_dbg_nolock(void * pUserData=0x1014fa08, int
nBlockUse=1)  Line 1252 + 0x9 bytes	C++
	msvcr80d.dll!_free_dbg(void * pUserData=0x1014fa08, int nBlockUse=1)
Line 1194 + 0xd bytes	C++
	msvcr80d.dll!free(void * pUserData=0x1014fa08)  Line 1152 + 0xb bytes	C++
	GameTI-d.exe!l_alloc(void * ud=0x00000000, void * ptr=0x1014fa08,
unsigned int osize=32, unsigned int nsize=0)  Line 632 + 0xc bytes	C
	GameTI-d.exe!luaM_realloc_(lua_State * L=0x01e58a68, void *
block=0x1014fa08, unsigned int osize=32, unsigned int nsize=0)  Line
79 + 0x1d bytes	C
	GameTI-d.exe!luaH_free(lua_State * L=0x01e58a68, Table *
t=0x020b7028)  Line 376 + 0x24 bytes	C
	GameTI-d.exe!freeobj(lua_State * L=0x01e58a68, GCObject *
o=0x020b7028)  Line 383 + 0xd bytes	C
	GameTI-d.exe!sweeplist(lua_State * L=0x01e58a68, GCObject * *
p=0x01e58afc, unsigned int count=4294967149)  Line 424 + 0xd bytes	C
	GameTI-d.exe!luaC_freeall(lua_State * L=0x01e58a68)  Line 487 + 0x12 bytes	C
	GameTI-d.exe!close_state(lua_State * L=0x01e58a68)  Line 108 + 0x9 bytes	C
	GameTI-d.exe!lua_close(lua_State * L=0x01e58a68)  Line 212 + 0x9 bytes	C