[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Bug in cpcall
- From: Roberto Ierusalimschy <roberto@...>
- Date: Tue, 11 Mar 2008 09:13:47 -0300
> I believe cpcall does some improper memory handling somewhere because
> it attempts to free an invalid pointer. The attached c code provides a
> reproducible case. The basic idea is to limit the memory usage of a
> lua_State. (Looking at the code) In my application, I don't actually
> have to call cpcall multiple times (it actually happens the first
I did not test your program yet, but I think these is a small problem
with 'my_Alloc': it may fail even when reducing the size of a block.
("Lua assumes that the allocator never fails when osize >= nsize.")
This behavior may crash the GC.